Top Banner
Exam Preparation Day QUESTION 5 – RELATIONAL DATABASE MANAGEMENT SYSTEMS
24

Question 5 - 2k15 Exam Preparation Day

Feb 15, 2017

Download

Education

Leon Marsden
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Question 5 - 2k15 Exam Preparation Day

Exam Preparation DayQUESTION 5 – RELATIONAL DATABASE MANAGEMENT SYSTEMS

Page 2: Question 5 - 2k15 Exam Preparation Day

a. (i) Identify one issue with storing the data in a single table, as shown above.

Page 3: Question 5 - 2k15 Exam Preparation Day

a. (i) Identify one issue with storing the data in a single table, as shown above.

- Repetitive data wastes disk space. Costs money.

- Repetitive data is time consuming to type. Wastes employees’ time, costs money. Inefficient.

- Repetitive data entry / typing may result in errors. Results from queries / outputs may be inaccurate. Unreliable.

Page 4: Question 5 - 2k15 Exam Preparation Day

a. (ii) Explain how a relational database can resolve the issue you identified in part (a)(i).

Page 5: Question 5 - 2k15 Exam Preparation Day

a. (ii) Explain how a relational database can resolve the issue you identified in part (a)(i).

- By normalising data into source tables, in this case into Customer (or Business) and Product (or Drinks), the amount of initial data entry is reduced. The benefits include reduced disk space, accuracy, ease of data entry.

Page 6: Question 5 - 2k15 Exam Preparation Day

b. (i) Discuss the effect of having Customer ID (C_ID) and Product ID (P_ID) as composite keys in Items Table.

Page 7: Question 5 - 2k15 Exam Preparation Day

b. (i) Discuss the effect of having Customer ID (C_ID) and Product ID (P_ID) as composite keys in Items Table.

- This would not be an ideal composite foreign key because any combination of Product and Customer could only occur once. This would have the effect of, for example, Freed’s Drinks only being able to purchase 24 Coke Cans on one occasion.

Page 8: Question 5 - 2k15 Exam Preparation Day

b. (ii) Discuss the effect of having Customer ID (C_ID) and Date (I_Date) as composite keys in Items Table.

Page 9: Question 5 - 2k15 Exam Preparation Day

b. (ii) Discuss the effect of having Customer ID (C_ID) and Date (I_Date) as composite keys in Items Table.

- This would not be an ideal composite foreign key because any combination of Product and Date could only occur once. This would have the effect of, for example, Freed’s Drinks only being able to purchase one product on Friday October.

Page 10: Question 5 - 2k15 Exam Preparation Day

b. (iii) Discuss an appropriate composite keys for the Items Table.

Page 11: Question 5 - 2k15 Exam Preparation Day

b. (iii) Discuss an appropriate composite keys for the Items Table.

- C_ID, IP_TS (item purchase Time / Date Stamp)…? CHECK THIS

Page 12: Question 5 - 2k15 Exam Preparation Day

c. (i) Two of the entities in the database are ‘Customers’ and ‘Products’. Explain the relationship between these two entities.

Page 13: Question 5 - 2k15 Exam Preparation Day

c. (i) Two of the entities in the database are ‘Customers’ and ‘Products’. Explain the relationship between these two entities.

- One customer can purchase Many item types. One item type can be purchased by Many customers. The relationship is therefore Many to Many and can be resolved by including a transaction table with foreign keys from each source table.

Page 14: Question 5 - 2k15 Exam Preparation Day

c. (ii) Complete the diagram above to include the Table Relationships.

Page 15: Question 5 - 2k15 Exam Preparation Day

c. (ii) Complete the diagram above to include the Table Relationships.

Page 16: Question 5 - 2k15 Exam Preparation Day

c. (iii) Explain the table relationship between ‘Customers’ and ‘Products’ in the context of this table relationship diagram from part (ii)

Page 17: Question 5 - 2k15 Exam Preparation Day

c. (iii) Explain the table relationship between ‘Customers’ and ‘Products’ in the context of this table relationship diagram from part (ii)

It’s still a many to many relationship, but it’s been resolved by the inclusion of the Items table, with a sub-form / portal into this via the Invoice table to include multiple purchases at any given time. CHECK THIS, unsure what’s being asked.

Page 18: Question 5 - 2k15 Exam Preparation Day

c. again Design an appropriate query that will output this information.

Page 19: Question 5 - 2k15 Exam Preparation Day

c. again Design an appropriate query that will output this information.

SELECT P_ID P_Name P_CostPrice QuantityI_Date

FROM ProductsProductsProductsItems Invoice

WHERE No query, all items sorted

SORTBY or ORDERBY Quantity, descending

STOPAT 1 (for most popular product)

3 (for top three products)

**NOTE: Assumes Quantity is a summary field that totals all for a given P_ID. If not, may need an additional field.

Page 20: Question 5 - 2k15 Exam Preparation Day

d. Discuss how the database for Big Drink Supplies could be expanded to automate the ordering system and reduce user error.

Page 21: Question 5 - 2k15 Exam Preparation Day

d. Discuss how the database for Big Drink Supplies could be expanded to automate the ordering system and reduce user error.

Repeating weekly / monthly automated orders. Script is run to email is sent to customers seven days prior to order being processed. Order details generated from DB based on previous (or first) orders. If nothing is done by the processing date, order proceeds. If there’s a problem, customer can login and alter details themselves via a web interface to the database (bypassing data entry by an employee, eliminating errors when transcribing e.g. from phone calls or email). Whenever data is entered, a pop up or summary of the order is shown to the user to ensure that the entered data is correct prior to the order proceeding and funds being withdrawn.

Page 22: Question 5 - 2k15 Exam Preparation Day

e. Explain the recommended practices that a database developer will need to implement to ensure that customer’ personal information is not disclosed to unauthorised clerical staff.

Page 23: Question 5 - 2k15 Exam Preparation Day

e. Explain the recommended practices that a database developer will need to implement to ensure that customer’ personal information is not disclosed to unauthorised clerical staff.

- Login details (username and password) on computer and database start up. User groups / permissions prevent clerical staff from accessing certain information.

- Local encryption of working copies of data.

- Viewing of clients’ data will have visible data obfuscated.

- Emails, physical paper etc. with customer details are destroyed once data is entered.

- Onsite and offsite backups are secured / encrypted.

Page 24: Question 5 - 2k15 Exam Preparation Day

Questions?