COSC309 – DATABASE MANAGEMENT SYSTEMS
ASSIGNMENT
1) Define the following Database terms: i) Database ii) Database Management
System iii) Database schema iv) Data model v) Entity vi) Attribute vii) Primary
key viii) Foreign Key ix) Candidate key x) Referential Integrity.
i. Database: A Database is an organized, electronic collection of structured data
or information, controlled by a database management system (DBMS) to allow
for efficient storage, retrieval, management, and modification of that data.
ii. Database Management System: A Database Management System (DBMS) is
a software package or system used to facilitate the creation and maintenance of
a computerized database.
iii. Database Schema: The database schema is the structure of
a database described in a formal language supported typically by a relational
database management system (RDBMS). The term "schema" refers to the
organization of data as a blueprint of how the database is constructed (divided
into database tables in the case of relational databases).
iv. Data Model: A data model is used to hide storage details and present the users
with a conceptual view of the database.
v. Entity: An entity is a "thing" or "object" in the real world. An entity contains
attributes, which describe that entity. So anything about which we store
information is called an entity. Entities are recorded in the database and must be
distinguishable, i.e., easily recognized from the group.
vi. Attribute: Attributes are properties or characteristics of an entity. Attributes are
used to describe the entity. The attribute is nothing but a piece of data that gives
more information about the entity. Attributes are used to distinguish one entity
from the other entity. Attributes help to categorize the entity and the entity can
be easily retrieved and manipulate the entity. Attributes can help the database to
be more structural and hierarchical. An entity with no attribute is of no use in
the database.
Example
Let's take the student as an entity. Students will have multiple attributes such as
roll number, name, and class.
These attributes are used to describe the student in more detail.
vii. Primary Key: A primary key in a table that uniquely identifies each row and
column or set of columns in the table. The primary key is an attribute or a set of
attributes that help to uniquely identify the tuples(records) in the relational table.
A primary key index is automatically created for each table with a primary key
column.
viii. Foreign Key: A foreign key is an attribute of a relationship or group of
attributes that could serve as the primary key of another relationship to which it
is connected through a relationship.
ix. Candidate Key: A candidate key is any attribute or combination of attributes
that uniquely identifies rows in the table and the attribute that forms the key can
not be further reduced.
x. Referential Integrity: Reference Consistency A database constraint known as
referential integrity ensures that relationships between tables are correct and
consistent. A foreign key in one table must match a primary key value in
another table, or it must be NULL, according to this rule.
2) If you are called upon to design a database system for managing Distance
Learning Center - Ahmadu Bello University, Zaria, how will go about the job?
Database System for Distance Learning Centre (DLC), Ahmadu Bello
University, Zaria
1. Introduction
This proposal outlines the design and implementation of a robust database system
for the Distance Learning Centre (DLC), Ahmadu Bello University, Zaria. The
system will support core academic, financial, and administrative processes,
ensuring efficiency, security, and scalability.
2. Objectives
• Provide a centralized and reliable system for managing student records,
admissions, registration, fees, and results.
• Ensure data integrity, security, and compliance with regulatory requirements.
• Enable integration with e-learning platforms (LMS), payment
gateways, and communication systems.
• Support performance, scalability, and disaster recovery.
3. Core Processes Supported
1. Programme & course management
2. Admissions and student onboarding
3. Student records management
4. Course registration and enrolment
5. Fee invoicing and payments
6. Teaching delivery and LMS integration
7. Assessment, exams, and grading
8. Results processing and graduation eligibility
9. Communications and notifications
10. Analytics and statutory reporting
4. Data Model (Entities & Relationships)
Core entities include: Student, Staff/Instructor, Department, Faculty, Programme,
Course, Session, Semester, StudyCentre, Enrollment, Assessment, Grade, Result,
Invoice, Payment, User, Role, Permission, and AuditEvent.
Relationships:
- Programme Department/Faculty
- ProgrammeCurriculum Course
- Student Programme Enrollment CourseOffering
- Enrollment AssessmentItem Grade
- Student Invoice Payment
- User Role Permission
- All actions logged in AuditEvent
5. Security Measures
• Role-based access control (RBAC)
• Row-level security for sensitive data
• Encryption of sensitive information at rest and in transit
• Strict audit logging of all operations
• Regular backups and disaster recovery planning
6. Performance & Scalability
• Database normalization (3NF) for integrity
• Partitioning of large tables (sessions, enrollments)
• Indexes and materialized views for performance
• Background jobs for heavy computations (e.g., GPA recalculations)
• Scalable design for future growth
7. Project Timeline
• Weeks 1–2: Requirements gathering, ERD design, and data dictionary approval
• Weeks 3–4: Core schema implementation, RBAC, and auditing
• Weeks 5–6: LMS and payment gateway integrations
• Weeks 7–8: Exams, results, reporting, and performance tuning
• Final: Documentation, training, and handover
8. Deliverables
• Entity-Relationship Diagram (ERD)
• SQL schema (DDL) and seed data
• API documentation (OpenAPI)
• Admin and user manuals
• Deployment and backup plan
• Training sessions for Registry, Bursary, Exams, and ICT teams
3. Using the Entities below, draw the entity relationship diagram for the
following by using crows foot notation and give the English like equivalence of
the diagram:
STUDENT (RegNumber, OtherNames, Gender, DOB, Phone, Email, LgaID,
ProgCode, DateAdmitted)
COURSE (CourseCode, CourseDescription, CreditUnits, DateCreated,
IsActive, DateRetired)
ER diagram (Crow’s-foot notation) — using the given entities
Given entities & attributes
STUDENT(RegNumber, OtherNames, Gender, DOB, Phone, Email, LgaID,
ProgCode, DateAdmitted).
COURSE(CourseCode, CourseDescription, CreditUnits, DateCreated, IsActive,
DateRetired)
Crow’s-foot relationships (textual + English-like equivalence)
I will describe the ER in Crow’s-foot style in words and give the English sentence
forms.
Entities:
STUDENT (PK: RegNumber)
COURSE (PK: CourseCode)
Relationships to include (typical for such simple pair of entities):
1. STUDENT — ENROLLS_IN — COURSE (many-to-many)
A student can enroll in many courses, and a course can have many students.
Implement with an associative table ENROLLMENT (EnrollmentID,
RegNumber FK → STUDENT, CourseCode FK → COURSE, Session,
Semester, DateRegistered, Grade).
Crow’s-foot textual notation (each relationship line):
STUDENT 1 —< ENROLLMENT >— 1 COURSE
(In crow’s-foot: STUDENT (1) — ENROLLMENT (M) — COURSE (1) as
part of the associative representation; overall the STUDENT to COURSE is
M:N via ENROLLMENT.)
English-like equivalences (sentences)
“One student may enroll in zero, one, or many courses.”
“One course may be taken by zero, one, or many students.”
“ENROLLMENT records which STUDENT (RegNumber) is enrolled in which
COURSE (CourseCode) and when.”
4. Let's assume we have a relation named "Students" with the following
attributes: StudentID, Name, Age, and GPA. Write relational algebra
expressions to:
i. Select all students who are 20 years old.
ii. Project only the Name and GPA of students.
iii. Find the average GPA of all students.
iv. Select students with a GPA greater than 3.5 and age less than 25.
v. Project the Name and Age of students who have a GPA greater than 3.0.
vi. Find the maximum GPA among students.
Relational Algebra Expressions
i. Select all students who are 20 years old:
σ_{Age = 20}(Students)
ii. Project only the Name and GPA of students:
π_{Name, GPA}(Students)
iii. Find the average GPA of all students:
γ_{avg(GPA)}(Students)
iv. Select students with GPA > 3.5 and Age < 25:
σ_{GPA > 3.5 ∧ Age < 25}(Students)
v. Project Name and Age of students with GPA > 3.0:
π_{Name, Age}(σ_{GPA > 3.0}(Students))
vi. Find the maximum GPA among students:
γ_{max(GPA)}(Students)
5. Write SQL statement that will generate the table below: Subscribers_Table.
SQL statement to generate the Subscribers_Table as specified
The assignment table requires SubscriberID as AutoNum (auto-increment), PK;
Surname (VARCHAR 30, required), OtherNames (VARCHAR 50 required),
Gender (VARCHAR 6 required), DOB DATE required, Tribe VARCHAR 25
optional.
Here is a standard SQL CREATE TABLE for many RDBMS. I provide a
PostgreSQL version and a generic SQL/SQL Server/MySQL variant.
PostgreSQL (recommended)
CREATE TABLE Subscribers_Table (
SubscriberID SERIAL PRIMARY KEY,
Surname VARCHAR(30) NOT NULL,
OtherNames VARCHAR(50) NOT NULL,
Gender VARCHAR(6) NOT NULL,
DOB DATE NOT NULL,
Tribe VARCHAR(25) NULL
);
MySQL
CREATE TABLE Subscribers_Table (
SubscriberID INT AUTO_INCREMENT PRIMARY KEY,
Surname VARCHAR(30) NOT NULL,
OtherNames VARCHAR(50) NOT NULL,
Gender VARCHAR(6) NOT NULL,
DOB DATE NOT NULL,
Tribe VARCHAR(25) NULL
) ENGINE=InnoDB;