0478_m23_qp_22
A paper of Computer Science, 0478
Questions:
11
Year:
2023
Paper:
2
Variant:
2

Login to start this paper & get access to powerful tools

2
5
6
8
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 BK02 The Princesses’ Story Yes B Penn Yes 4.50 BK03 Computer Science No Way Yu Yes 19.99 BK04 The Modern World No P Patel No 25.00 BK05 The Ancient World Yes P Patel No 25.00 BK06 Computer Science No R Dale Yes 27.35 BK07 The Princes’ Story Yes B Penn No 12.50 BK08 The Princesses’ Story Yes B Penn No 12.50 BK12 Famous Five Yes E Bly Yes 2.75 BK15 Secret Seven Yes E Bly Yes 2.75 BK16 The Last Knight Yes P Mann Yes 5.99 BK17 The Dark Tower Yes P Mann Yes 5.99 BK19 The Final Chase Yes P Mann Yes 5.99 BK21 Maths Today Part 1 No B Ward Yes 6.75 BK22 Maths Today Part 2 No B Ward Yes 6.75 BK23 Maths Today Part 3 No B Ward Yes 6.75 BK26 Maths Today Workbook No B Ward Yes 6.75 BK27 Knitting for Beginners No A Smith Yes 6.99 BK30 Woodwork for Beginners No A Smith Yes 6.99 BK31 Networking for Beginners No A Smith Yes 6.99 State the number of records in this part of the database table. Give the name of the field that would be used for the primary key. State the reason for choosing this field for the primary key. 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 Write the output from this structured query language (SQL) statement. SELECT CatNo, Title, Author FROM BookList WHERE StockLevel = 0; Complete this SQL statement to display all the titles by the author B Penn. SELECT FROM WHERE ;
10
11
The one-dimensional (1D) array TeamName[] contains the names of teams in a sports league. The two-dimensional (2D) array TeamPoints[] contains the points awarded for each match. The position of each team’s data in the two arrays is the same. For example, the team stored at index 10 in TeamName[] and TeamPoints[] is the same. The variable LeagueSize contains the number of teams in the league. The variable MatchNo contains the number of matches played. All teams have played the same number of matches. The arrays and variables have already been set up and the data stored. Each match can be played at home or away. Points are recorded for the match results of each team with the following values: • 3 – away win • 2 – home win • 1 – drawn match • 0 – lost match. Write a program that meets the following requirements: • calculates the total points for all matches played for each team • counts the total number of away wins, home wins, drawn matches and lost matches for each team • outputs for each team: – name – total points – total number of away wins, home wins, drawn matches and lost matches • finds and outputs the name of the team with the highest total points • finds and outputs the name of the team with the lowest total points. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays, variables or constants; you may assume that this has already been done. All inputs and outputs must contain suitable messages. You do not need to initialise the data in the arrays TeamName[] and TeamPoints[] or the variables LeagueSize and MatchNo