Q1.
A database table called TVRange shows the main features and prices of a range of
televisions.
TVCode ScreenSize Satellite SmartTV SoundBar Price$
TV90SaSmSd 90 YES YES YES 9750.00
TV75SaSmSd 75 YES YES YES 8500.00
TV75SaSd 75 YES NO YES 8000.00
TV65SaSmSd 65 YES YES YES 6000.00
TV65SmSd 65 NO YES YES 5000.00
TV65SaSd 65 YES NO YES 5000.00
TV55SaSmSd 55 YES YES YES 4000.00
TV55SaSd 55 YES NO YES 3500.00
Give the name of the field that is most suitable to be the primary key.
State the reason for this choice.
Field ..........................................................................................................................................
Reason .....................................................................................................................................
Q2.The database uses the data types:
Text-character-Boolean-integer-real-date/time.
Complete the table to show the most appropriate data type for each field. Each data type must be
different.
Field Data type
TVCode
ScreenSize
SmartTV
Price$
Complete the structured query language (SQL) query to return the television (TV) code,
screen size and price of all Smart TVs in the database table.
SELECT TVCode, ......................................................., .......................................................
....................................................... TVRange
WHERE SmartTV = ;
Q3.A music streaming service has a new database table named Songs to store
details of songs available for streaming. The table contains the fields:
• SongNumber – the catalogue number, for example AG123
• Title – the title of the song
• Author – the name of the song writer(s)
• Singer – the name of the singer(s)
• Genre – the type of music, for example rock
• Minutes – the length of the song in minutes, for example 3.75
• Recorded – the date the song was recorded.
(a) Identify the field that will be the most appropriate primary key for this table.
............................................................................................................................................. [1]
(b) Complete the table to identify the most appropriate data type for the fields in
Songs
Fiel Data
d type
SongNumber
Title
Recorded
Minutes
[2]
(c) Explain the purpose of the structured query language (SQL) statements.
SUM (Minutes) FROM Songs WHERE
Genre = "rock"; COUNT (Title)
FROM Songs WHERE Genre = "rock";
...................................................................................................................................
................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................