7 Data redundancy leads to a waste of storage space because one
has duplicate data.
8 The MODIFY clause changes values in a table.
9 Values that are specified by the BETWEENoperator are
inclusive.
10 You can change a column's datatype, size, and default value by
using the ALTERstatement.
SECTIONB: CONCEPTS
1. Using an example explain what a composite key is.
[Marks: 10)
[2 Marks]
2. Explain the one use of the DESCkeyword and give an example.
[2 Marks]
3. Name and describe the types of anomalies and give a practical example of each.
[6 Marks]
SECTIONC: COMPREHENSION
[Marks: 40)
1. Given the following scenario create an appropriate ERdiagram. Include at least 3 attributes
and 1 primary Key for each entity. Include the cardinality and relationships. Use Crow's Foot
Notation.
[17 Marks]
A hospital has a set of patients and a set of medical doctors. Information gathered from the
patient includes their id#, name, date seen by the doctor. The doctor has a doctor#, name
and specialisation. A doctor can perform one or more tests on a single patient. A test
consists of the testname, testdate, result. A doctor can perform one or more tests on many
patients in a given day.
2. Write an SQL statement to create a new table named CHOMMIE with attributes for ID,
First_name, last_name, birthday, and Cellphone#. Decide on your own about reasonable
column names and data types and include a primary Key.
[7 Marks]
3. Write a query to Insert five records containing information about people you know, at least
one person should have a last_name of 'Zulu'.
[5 Marks]
4. Write a query to display all the records, ordered by last_name in descending order.
[3 Marks]
5. Your friend with the last_name 'Zulu' has changed their cellphone number to 0812345678.
Write a query to make this modification in the Chommie table.
[3 Marks]
Page I 3