THE KENYA NATIONAL EXAMINATIONS COUNCIL
DIPLOMA IN INFORMATION COMMUNICATION TECHNOLOGY
MODULE II
DATABASE MANAGEMENT SYSTEMS
Time: 3 hours
INSTRUCTIONS TO CANDIDATES:
This paper consists of EIGHT questions.
Answer FIVE of the EIGHT questions in the spaces provided.
Candidates should answer the questions in English.
This paper consists of 6 printed pages.
Candidates should check the question paper to ensure that all the pages are printed as indicated and that no questions are missing.
© 2024 The Kenya National Examinations Council
QUESTION 1
- Outline four characteristics of a primary key in a database. (4 marks)
- Uniqueness: Ensures each record is unique.
- Not Null: Cannot have null values.
- Immutable: Values cannot be changed once set.
- Single Column or Composite: Can be one column or a combination of columns.
- Distinguish between an associative record and a regular record as used in a database. (4 marks)
- Associative Record: Connects two tables with a many-to-many relationship.
- Regular Record: Represents a single entity and its attributes.
- Describe each of the following terms as used in a database: (6 marks)
(i) Data Entity: A distinct object or concept, represented by a table in a database.
(ii) Data Dictionary: A centralized repository of information about database objects, such as tables, columns, and indexes.
(iii) Database Instance: A specific realization of the database data at a given point in time. - Explain, with examples, the need for entity-relationship diagrams in database design. (6 marks)
- ER diagrams help visualize data relationships, define database structure, and identify entities, attributes, and keys, improving design accuracy and communication among stakeholders.
- Outline four challenges posed by integrating Artificial Intelligence into databases. (4 marks)
- Data Privacy Concerns
- High Computational Requirements
- Complex Integration Processes
- Data Quality and Bias Issues
- Distinguish between relational and non-relational models used in database systems. (4 marks)
- Relational Model: Uses tables with rows and columns, ideal for structured data.
- Non-Relational Model: Uses formats like key-value pairs, documents, or graphs, suitable for unstructured data.
QUESTION 2
- Identify the entities labeled (i) and (ii). (2 marks)
- Entity (i): Book
- Entity (ii): Author
- Write SQL statements for: (6 marks)
(i) Creating the table for Book: CREATE TABLE Book ( BookID INT PRIMARY KEY, Title VARCHAR(255), ISBN VARCHAR(20), PublishedDate DATE );
- (ii) Adding the column “Author” to the table “Book”:
ALTER TABLE Book ADD Author VARCHAR(255);
QUESTION 3
- Explain the function of the marker (⊆) as used in the diagram. (2 marks)
- The marker (⊆) indicates a subset relationship, showing that an entity is a subset of another entity or class.
- Describe two cross-features that have been used in the diagram. (2 marks)
- Attribute Linking: Attributes are directly linked to entities.
- Primary and Foreign Keys: Primary keys uniquely identify records, while foreign keys establish relationships between tables.
- State the meaning of null value as used in databases. (1 mark)
- A null value represents missing or unknown data in a field.
- Outline three circumstances that may lead to the occurrence of null values in a table. (3 marks)
- Missing Data Entry
- Not Applicable Field
- Uninitialized Column during Table Creation
- Write the SQL for each question, explaining the following conditions: (4 marks)
(i) Optional Qualifier: Allows fields to accept null values, providing flexibility in data entry.
(ii) Universal Qualifier: Ensures all rows meet a specific condition before executing a query. - Distinguish between WHERE and HAVING clauses as used in Structured Query Language. (2 marks)
- WHERE filters rows before grouping occurs, while HAVING filters groups after the aggregation.
- Explain two reasons why the provided table violates the 2NF. (2 marks)
- It has partial dependencies.
- Non-key attributes depend only on part of the composite key.
- Represent the Student relation in 2NF. (3 marks)
- Separate the relation into two tables: one for Students and another for Marks, eliminating partial dependencies.