Cambridge AS Level Computer Science 9618 · 8.3 Data Definition Language (DDL) and Data Manipulation Language (DML)

Q26 · 9618/13/M/J/25 Q6

Worked solution from the Databases Paper 1 Theory Fundamentals booklet, Part 2 of 2.

Q269618/13/M/J/25original Q6Structured · 18 marks
Question 6 from 9618/13/M/J/25

Worked solution

(a)

Draw four lines, each with a crow's foot at the "many" end:

CUSTOMER to ORDER: one-to-many, crow's foot at ORDER [1]

ORDER to ORDER_PRODUCT: one-to-many, crow's foot at ORDER_PRODUCT [1]

PRODUCT to ORDER_PRODUCT: one-to-many, crow's foot at ORDER_PRODUCT [1]

SUPPLIER to PRODUCT: one-to-many, crow's foot at PRODUCT [1]

(b)

Text values go in quotation marks. Keep the values in the same order as the fields.

INSERT INTO PRODUCT
VALUES ("002323", "Blue ball point 2mm", 50, 5.00, "SFX223");

INSERT INTO PRODUCT [1]

VALUES with opening and closing brackets [1]

ProductID, ProductName and SupplierID entered as strings in quotation marks, in the correct fields [1]

Quantity (50) and cost (5.00) entered in the correct fields [1]

Another accepted form names the fields first: INSERT INTO PRODUCT (ProductID, ProductName, QuantityInBox, Cost, SupplierID).

(c)

SELECT CustomerName, COUNT(OrderID) AS NotCollected
FROM ORDER INNER JOIN CUSTOMER
ON ORDER.CustomerID = CUSTOMER.CustomerID
WHERE Collected = FALSE
GROUP BY CUSTOMER.CustomerID;

Selecting the customer name and a COUNT of a field from ORDER with a suitable title (AS NotCollected) [1]

Joining ORDER and CUSTOMER [1]

The condition Collected = FALSE [1]

GROUP BY customer ID or customer name [1]

(d)(i)

Write any three other items a data dictionary stores:

Relationships [1]

Views [1]

Data types [1]

Another accepted item: validation rules.

(d)(ii)

Write any three uses of the developer interface:

To create, modify or delete database objects (such as tables and queries) [1]

To create a form for data input, and add tools to it such as drop-down boxes or buttons [1]

To design a report that shows output in an organised way [1]

Another accepted use: to add a menu so users can choose different actions or run different queries.

KEY IDEAIn an E-R diagram the crow's foot goes on the table that holds the foreign key.
TOTAL 18 marks

Official mark scheme

Mark scheme for 9618/13/M/J/25 question 6
VIDEO
▶ Whole paper

Video solution of the whole paper · by Ismail Adeleke. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.