CH 9-10
CH 9-10
Q X
[4]
(b) Complete the truth table for the given logic expression.
Working space
P Q R X
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
[4]
2 A database table called Booking28 stores details of hotel rooms and bookings for the week
beginning Monday 7 July 2025.
RoomNo Type Guests Rate$ Mon Tue Wed Thu Fri Sat Sun
101D Double 2 99.99 T T T T F T T
102D Double 2 99.99 T T T F T T T
103F Family 4 150.00 T T T T T T T
104S Single 1 72.50 F T T F T T T
105S Single 1 72.50 F T T F T T T
106T Twin 2 120.00 T T T T F T T
201F Family 4 160.00 F F T T T T T
202D Double 2 120.00 T F T T T T T
203T Twin 2 120.00 T F T T T T T
204T Twin 2 125.00 T F T F T T T
205S Single 1 79.99 T F T T F T T
301D Double 2 200.00 F T T F F T T
302T Twin 2 200.00 T T T T F T T
303P Suite 4 500.00 T T T T F T T
304P Suite 6 700.00 F F F F T T T
(a) State the number of fields and records in this database table.
Fields ........................................................................................................................................
Records ....................................................................................................................................
[2]
(b) State the reason why the Type field would not be suitable as a primary key.
...................................................................................................................................................
............................................................................................................................................. [1]
(c) The database uses only the data types:
• alphanumeric
• character
• Boolean
• integer
• real
• date/time.
Complete the table to show the fields that could have the given data types.
Only one field name is required in each box and each field name must be different.
(d) Give the output that would be produced by the structured query language (SQL) statement:
FROM Booking28
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
3 Four logic gates and five logic gate symbols are shown.
Draw one line to link each logic gate to its correct symbol. Not all logic gate symbols will be used.
AND
NAND
NOR
XOR
[4]
4 Complete the paragraph about databases. Use terms from the list. You may need to use a term
more than once. Some of the terms in the list will not be used.
A T H W
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
[4]
6 Building materials are sold in bags. A new database table called BuildStock has been set up to
store details about the materials for sale. Part of this table is given.
(a) Write the output from this structured query language (SQL) statement.
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(b) (i) Complete this SQL statement to display only the names of all the materials that are out
of stock.
SELECT .............................................................................................................................
FROM ..................................................................................................................................
WHERE ...............................................................................................................................
[2]
(ii) Explain how another SQL statement using a different field could be used to display the
same information.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]