ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions

Higher Computing Science 2015 Question 12 (CfE)

10 marks · Keys and the data dictionary

Identify a suitable primary key for the Sale table. Draw an entity-relationship diagram to illustrate the relationships between the four tables. A report is produced each time a customer makes an order. An example is shown below. Customer Mr D Gryffe Order no 10728 12 Gourock Crescent Date 23/4/15 Item Number ordered Cost Grease spray 1 £6·99 Bell wire (100 m) 1 £8·50 Towel radiator 1 £121·50 Disposable mouse trap 2 £9·98 Total £146·97 This report is based on a query. State a list of the tables and fields that would be used in this query and any criteria that would be used to select the above data. The report includes a single total of £146·97 after the four subtotals. Describe how this can be done in the report. A hardware company uses a relational database with the four tables shown below. Customer Item Order Sale Customer ID Item ID Order no Order no * Customer name Description Customer ID * Item ID * Customer address Cost Date Quantity Customer email Image

Marking scheme

Order no, Item ID Both required Sale Customer Order Item • Customer to Order + Item to Sale + Order to Sale all related and no others • Two of above three are the correct 1:M • All three above are the correct 1:M 1 mark for each bullet Many representations are possible. Accept 1:M, 1:N, 1:∞ and crow’s feet. Customer.Customer name Customer.Customer address Item.Description Item.Cost Order.Order no (or Sale.Order no) Order.Date Sale.Quantity [Order no]=10728 • Award one mark for all four tables (Customer, Item, Order, Sale) • Award one for six or seven correct fields • Award one mark for criteria of [order no] = 10728. Cannot attain the mark awarded for bullet point two if two or more fields that should not be included are stated in an answer. Do not penalise for additional search criteria eg customer name. Allow tables and fields to be expressed separately. SUM([Sale.Quantity]*[Item.Cost]) and is placed in the Report Footer • Use of SUM or clear description • Quantity*Item cost used or clear description • Report Footer or Summary field 1 mark for each bullet

Previous question: Higher Computing Science 2015 Question 11 (CfE)

Next question: Higher Computing Science 2015 Question 13 (CfE)