DDL DML Ws
DDL DML Ws
(a) Complete the entity-relationship (E-R) diagram for the relational database.
SHOP_ORDER CUSTOMER
ORDER_ITEM SUPPLIER
ITEM
[3]
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
[3]
(c) (i) Write a Structured Query Language (SQL) script to define the database called SHOP.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Write the SQL script to return the total quantity of items that the customer with the ID of
HJ231 has ordered.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
2 The relational database ASTRONOMY is used to store data about telescopes, the companies that
own the telescopes and the photographs taken by the telescopes.
(a) Complete the following table by writing the correct answer for each item.
Item Answer
[3]
Identify the feature that describes the relationship between data and its structure.
............................................................................................................................................. [1]
(c) Complete the SQL script to return the total number of telescopes owned by the company
whose ID begins with HW.
FROM TELESCOPE
(d) Write the SQL script to add one field to the table PHOTOGRAPH to store the resolution of the
photograph, e.g. 1920 × 1068.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Complete the statements about bitmap images by writing the missing words.
of the file.
[2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]