0% found this document useful (0 votes)
22 views8 pages

Unit9 23 Sy

igcse cs0478 past paper 2023 Questions Summary for Unit 9 Databases igcse cs0478 2023真题 第九单元 习题汇总

Uploaded by

Big shuang Li
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views8 pages

Unit9 23 Sy

igcse cs0478 past paper 2023 Questions Summary for Unit 9 Databases igcse cs0478 2023真题 第九单元 习题汇总

Uploaded by

Big shuang Li
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

author(wechat): bigshuang2020

12

10 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
TV55SmSd 55 NO YES YES 3500.00
TV50SaSmSd 50 YES YES YES 2500.00

20
TV50Sa 50 YES NO NO 1750.00
TV50Sm 50 NO YES NO 1750.00
TV40Sa 40
0 YES NO NO 1200.00
g2
TV40 40 NO NO NO 950.00
TV32 32 NO NO NO 650.00
an

(a) Give the name of the field that is most suitable to be the primary key.
hu

State the reason for this choice.

Field ..........................................................................................................................................
gs

Reason .....................................................................................................................................
bi

...................................................................................................................................................
[2]

© UCLES 2023 0478/21/M/J/23


1
author(wechat): bigshuang2020
13

(b) 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$

20
[2]

(c) Complete the structured query language (SQL) query to return the television (TV) code,

0
screen size and price of all Smart TVs in the database table.
g2
SELECT TVCode, ......................................................., .......................................................

....................................................... TVRange
an

WHERE SmartTV = .......................................................;


[4]
hu
gs
bi

© UCLES 2023 0478/21/M/J/23 [Turn over


2
author(wechat): bigshuang2020
10

10 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

Field Data type

SongNumber

20
Title

0
g2
Recorded

Minutes
an

[2]
hu

(c) Explain the purpose of the structured query language (SQL) statements.

SUM (Minutes) FROM Songs WHERE Genre = "rock";


gs

COUNT (Title) FROM Songs WHERE Genre = "rock";


bi

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2023 0478/22/M/J/23


3
author(wechat): bigshuang2020
11

11 The variables P and Q are used to store data in a program. P stores a string. Q stores a character.

(a) Write pseudocode statements to declare the variables P and Q, store "The world" in P and
store 'W' in Q

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

(b) Write a pseudocode algorithm to:


• convert P to upper case
• find the position of Q in the string P (the first character in this string is in position 1)
• store the position of Q in the variable Position

...................................................................................................................................................

20
...................................................................................................................................................

...................................................................................................................................................
0
g2
...................................................................................................................................................

...................................................................................................................................................
an

...................................................................................................................................................

...................................................................................................................................................
hu

...................................................................................................................................................
gs

...................................................................................................................................................

............................................................................................................................................. [4]
bi

(c) Give the value of Position after the algorithm has been executed with the data in
question 11(a).

...................................................................................................................................................

............................................................................................................................................. [1]

© UCLES 2023 0478/22/M/J/23 [Turn over


4
author(wechat): bigshuang2020
10

10 A database table called Site1 stores details of some holiday homes at a holiday park. The
database shows the type of home, number of guests, whether it is privately owned and the weekly
rate to hire it.

Name Type Private Rate$ NumberGuest


Bay Lodge Lodge NO 1000 10
Bay View Cabin NO 400 4
Blue Skies Cabin NO 350 4
Cliff View Cabin NO 650 6
Coppice Lodge Lodge NO 1200 12
Green Lodge Lodge NO 1000 8
Henry Cabin YES 300 2
Hikers’ Rest Retreat NO 750 6
Poppy Cabin NO 300 2

20
Summer Joy Retreat YES 750 6
Valley View Cabin NO 600 6
West Lodge Lodge 0 YES 1200 12
g2
(a) State the number of fields and the number of records in this database table.
an

Fields ........................................................................................................................................

Records ....................................................................................................................................
hu

[2]

(b) Describe the purpose of a primary key.


gs

...................................................................................................................................................
bi

............................................................................................................................................. [1]

© UCLES 2023 0478/23/M/J/23


5
author(wechat): bigshuang2020
11

(c) The database uses the data types:


• alphanumeric
• character
• Boolean
• integer
• real
• date/time.

Complete the table to show the most appropriate data type for each field.

Field Data type


Type
Private
Rate$
NumberGuest
[2]

20
(d) Give the output that would be produced by the structured query language (SQL) statement:

SELECT Name, NumberGuest, Rate$


FROM Site1 0
g2
WHERE NumberGuest >= 10;

...................................................................................................................................................
an

...................................................................................................................................................

...................................................................................................................................................
hu

...................................................................................................................................................
gs

...................................................................................................................................................

............................................................................................................................................. [3]
bi

© UCLES 2023 0478/23/M/J/23 [Turn over


6
author(wechat): bigshuang2020
10

9 A shop that sells books has set up a new database table called BookList to store book details.
Part of this table is given.

CatNo Title Fiction Author PaperBack Price StockLevel


BK01 The Princes’ Story Yes B Penn Yes 4.50 500
BK02 The Princesses’ Story Yes B Penn Yes 4.50 350
BK03 Computer Science No Way Yu Yes 19.99 20
BK04 The Modern World No P Patel No 25.00 5
BK05 The Ancient World Yes P Patel No 25.00 5
BK06 Computer Science No R Dale Yes 27.35 8
BK07 The Princes’ Story Yes B Penn No 12.50 3
BK08 The Princesses’ Story Yes B Penn No 12.50 0
BK12 Famous Five Yes E Bly Yes 2.75 45

20
BK15 Secret Seven Yes E Bly Yes 2.75 25
BK16 The Last Knight Yes P Mann Yes 5.99 7
BK17 The Dark Tower
0 Yes P Mann Yes 5.99 5
g2
BK19 The Final Chase Yes P Mann Yes 5.99 5
BK21 Maths Today Part 1 No B Ward Yes 6.75 25
an

BK22 Maths Today Part 2 No B Ward Yes 6.75 15


BK23 Maths Today Part 3 No B Ward Yes 6.75 10
hu

BK26 Maths Today Workbook No B Ward Yes 6.75 30


BK27 Knitting for Beginners No A Smith Yes 6.99 3
gs

BK30 Woodwork for Beginners No A Smith Yes 6.99 4


BK31 Networking for Beginners No A Smith Yes 6.99 0
bi

(a) State the number of records in this part of the database table.

............................................................................................................................................. [1]

(b) (i) Give the name of the field that would be used for the primary key.

..................................................................................................................................... [1]

(ii) State the reason for choosing this field for the primary key.

...........................................................................................................................................

..................................................................................................................................... [1]

© UCLES 2023 0478/22/F/M/23


7
author(wechat): bigshuang2020
11

(c) Complete the table to identify the most appropriate data type for each field based on the data
shown in the table BookList

Field Data type

CatNo

Title

Fiction

Price

[2]

(d) Write the output from this structured query language (SQL) statement.

20
SELECT CatNo, Title, Author

FROM BookList
0
g2
WHERE StockLevel = 0;

...................................................................................................................................................
an

...................................................................................................................................................
hu

...................................................................................................................................................

............................................................................................................................................. [2]
gs

(e) Complete this SQL statement to display all the titles by the author B Penn.

SELECT .....................................................................................................................................
bi

FROM .........................................................................................................................................

WHERE .....................................................................................................................................;
[2]

© UCLES 2023 0478/22/F/M/23 [Turn over


8

You might also like