Chapter 8 SB Answers
Chapter 8 SB Answers
2 a) Suggestions include:
Access
Oracle
dBase
MySQL
Filemaker
b) storage space not wasted, reduction in redundant data stored, consistent data, independent
data.
3 a) See glossary
c) A normalised relational database is a data base in 3NF, where entities do not contain repeated
groups of attributes, any non-key attributes depend upon the primary key and are independent,
there are no partial dependencies, and the table contains no non-key dependencies.
Activity 8A
Staff Name and staff number are stored twice so the is redundant data.
Data could be inconsistent if the staff number was altered in the payroll file and not the sales file
or vice versa.
The data is not independent, for example, the fields are stored in a different order and in the
payroll file the first name and second name are stored in different fields, but in the sales program
they are stored together in the same field.
Activity 8B
Attributes for the table Teacher: teaching licence number, date of birth, address
Cambridge International AS & A Level Computer Science Answers
Activity 8C
Activity 8D
(P SOR\HH (P SOR\HH
3RVLWLRQ
1XP EHU 1DP H
Employee Table
Contact Table
&RQWDFW (P SOR\HH
1XP EHU 1XP EHU
Cambridge International AS & A Level Computer Science Answers
E-R Diagam
Activity 8E
1 a) i) See Section 8.1.1
ii) See Section 8.1.2
b)
i) Normalisation is the process of organising data to be stored in a database into two or more
tables and relationships between the tables, so that data redundancy is minimised.
ii) Normalisation is carried out by the following:
First Normal Form (1NF) – ensuring that entities do not contain repeated groups of
attributes.
Second Normal Form (2NF) – ensuring that entities are in 1NF and any non-key
attributes depend upon the primary key. There are no partial dependencies.
Third Normal Form (3NF) – ensuring that entities are in 2NF and all non-key
attributes are independent. The table contains no non-key dependencies.
2 a)
Part (Part Number, Part Description, Date Last Ordered, Number in Stock, Minimum Order
Level, Position in Warehouse)
Manufacturer (Manufacturer Name, Manufacturer Address, Manufacturer Contact Details)
Part Manufacturer (Part Number, Manufacturer Name)
b)
Cambridge International AS & A Level Computer Science Answers
Activity 8F
1 a) See Section 8.2.1
b) See Section 8.2.1 last paragraph
2 a) See Section 8.2.1 and 8.2.2
b) The use of access rights to limit what can be seen or changed:
Administrators would have full access rights to everything.
Teachers may be able to see most items but only change details about themselves and their
pupils.
Pupils may only have the right to see data about themselves but not change it.
Activity 8G
CREATE TABLE Teacher(
TeacherName CHARACTER,
Address CHARACTER,
TeacherDateOfBirth DATE);
ALTER TABLE Teacher ADD PRIMARY KEY (LicenceNumber);
ALTER TABLE Class ADD FOREIGN KEY LicenceNumber REFERENCES Teacher (LicenceNumber);
Activity 8H
Cambridge International AS & A Level Computer Science Answers
Activity 8I
SELECT COUNT(STUDENTSUBJECT.ExamMark)
FROM STUDENTSUBJECT;
SELECT AVG(STUDENTSUBJECT.ExamMark)
FROM STUDENTSUBJECT;
Alice WC
Charles PC
Ahmed QR
FirstName ProgramName NoOfDays Customer
Cambridge International AS & A Level Computer Science Answers
2 a)
i) Database Management System
ii) Issue usernames and passwords to stop unauthorised access to the data. Set access rights so
only relevant staff can edit certain parts of the data.
iii) Setup search criteria to find the data that matches the criteria set
iv) By storing data in (separate) linked tables data redundancy is reduced/data
duplication is controlled. Compatibility/data integrity issues are reduced as data only needs
to be updated once/is only stored once. Unwanted or accidental deletion of linked data is
prevented as the DBMS will flag an error.
b) i) The Primary Key in CLASS is ClassID. The Foreign Key of CLASS-GROUP is ClassID.
ii) Many-to-one
iii)
SELECT StudentID, FirstName
FROM STUDENT
WHERE TutorGroup = "10B" // WHERE (TutorGroup = "10B")
ORDER BY LastName ASC;
iv)
SELECT STUDENT.LastName
FROM STUDENT, CLASS-GROUP
WHERE ClassID = "CS1" // WHERE (ClassID = "CS1") AND CLASS-
GROUP.StudentID = STUDENT.StudentID;