0% found this document useful (0 votes)
81 views5 pages

DDL DML Ws

AS cse

Uploaded by

Saifullah Zayeed
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)
81 views5 pages

DDL DML Ws

AS cse

Uploaded by

Saifullah Zayeed
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/ 5

6

3 A shop manager has designed a relational database to store customer orders.

The database will have the following tables:

CUSTOMER(CustomerID, FirstName, LastName, Town)

SHOP_ORDER(OrderNo, CustomerID, OrderDate)

SUPPLIER(SupplierID, EmailAddress, TelephoneNumber)

ITEM(ItemNumber, SupplierID, Description, Price)

ORDER_ITEM(ItemNumber, OrderNo, Quantity)

(a) Complete the entity-relationship (E-R) diagram for the relational database.

SHOP_ORDER CUSTOMER

ORDER_ITEM SUPPLIER

ITEM

[3]

(b) Identify three advantages of a relational database compared to a file-based approach.

1 ................................................................................................................................................

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

2 ................................................................................................................................................

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

3 ................................................................................................................................................

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

© UCLES 2023 9618/11/O/N/23


7

(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]

© UCLES 2023 9618/11/O/N/23 [Turn over


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.

The database has these three tables:

COMPANY(TelephoneNumber, CompanyID, CompanyName)

PHOTOGRAPH(PhotoID, TelescopeID, DateTaken, TimeTaken, Elevation)

TELESCOPE(TelescopeID, CompanyID, SerialNumber)

(a) Complete the following table by writing the correct answer for each item.

Item Answer

a suitable field for the primary key in


COMPANY

a candidate key in TELESCOPE

the degree of relationship between


TELESCOPE and PHOTOGRAPH

[3]

(b) A Database Management System (DBMS) has several features.

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.

SELECT ........................................... (.............................................................)

FROM TELESCOPE

WHERE .................................................. LIKE ...............................................;


[4]

© UCLES 2022 9618/13/O/N/22


5

(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]

(e) The photographs are stored as bitmap images.

Complete the statements about bitmap images by writing the missing words.

The ................................................................................. of a bitmap image is the number of

bits that are used to store each pixel.

Metadata about the image is stored in the .................................................................................

of the file.
[2]

(f) Describe the purpose of a query processor in a DBMS.

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

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

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

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

© UCLES 2022 9618/13/O/N/22 [Turn over

You might also like