Databases Practice Question
Databases Practice Question
(a) State why the table is not in First Normal Form (1NF).
....................................................................................................................................
........
...................................................................................................................................
....[1]
(b) The database design is changed to:
SalesPerson (FirstName, Shop)
SalesProducts (FirstName, ProductName, NoOfProducts, Manufacturer)
Using the data given in the first attempt table (ShopSales), show how
these data are now stored in the revised table designs.
Table: SalesPerson
Table: SalesProducts
[3]
(b) The database design has three tables to store the classes that
students attend. STUDENT(StudentID, FirstName, LastName, Year,
TutorGroup) CLASS(ClassID, Subject)
CLASS-GROUP(StudentID, ClassID)
Primary keys are not shown. There is a one-to-many relationship between CLASS
and
CLASS–GROUP.
(i) Describe how this relationship is implemented.
...................................................................................................................................
........
...................................................................................................................................
........
...................................................................................................................................
....[2]
(ii) Describe the relationship between CLASS-GROUP and STUDENT.
....................................................................................................................................
...[1]
(iii) Write an SQL script to display the StudentID and FirstName of all
students who are in the tutor group 10B. Display the list in alphabetical
order of LastName.
....................................................................................................................................
.......
...................................................................................................................................
........
...................................................................................................................................
........
...................................................................................................................................
....[4]
(iv) Write an SQL script to display the LastName of all students who attend
the class whose ClassID is CS1.
....................................................................................................................................
.......
...................................................................................................................................
........
...................................................................................................................................
........
...................................................................................................................................
........
...................................................................................................................................
........
...................................................................................................................................
........
...................................................................................................................................
........