Mada za sehemu hiiDemonstrate mastery of Advanced principles of databases and database management systemsMada 6
- Describe the basic concepts of Relational Database Design, ER Model, SQL, NoSQL, big data, and data warehouse
- Demonstrate understanding of database design (conceptual, logical, physical, normalization etc)
- Demonstrate understanding of database models
- Describe different database management systems (Parallel, distribution)
- Describe the emerging Database Models, Technologies and Application
- Design database using SQL and PHP
Database Design
Database design is the process of creating a structured data model that defines how data is stored, organized, and manipulated. This process moves through three distinct levels—conceptual, logical, and physical—each serving a specific purpose in building an efficient and reliable database system.

Conceptual Data Model
The conceptual data model provides a high-level overview of organizational data, focusing on business concepts and rules without technical details. It identifies the essential data elements and business events, designed for a business audience. Key characteristics include independence from hardware and software specifications, comprehensive coverage of business concepts, and representation of organizational data needs.
Logical Data Model
The logical data model defines data structures such as entities, tables, and their relationships in detail. It is independent of any specific DBMS, making it adaptable to various database systems. The logical model specifies precise data attributes, integrates with other logical models, and adheres to normalization processes up to the Third Normal Form (3NF).
Physical Data Model
The physical data model describes the actual implementation of data in a database for a specific system. It represents data storage within a DBMS, considering technical and performance factors. The physical model includes table names, column names, data types, keys, indexes, views, and access profiles. This model depends on a particular DBMS version or technology.
Scenario: A bus company operates buses on various routes according to a schedule.
Step 1: Conceptual Data Model
Identify entities and their relationships:
- Entities: Route, Bus Company, Schedule
- Relationships:
- One route can have one or many bus companies (1:M)
- One route can have one or multiple schedules (1:M)
Step 2: Logical Data Model
Identify attributes and keys:
Route entity:
- route_number (Primary Key)
- route_name
- origin
- destination
Bus Company entity:
- company_id (Primary Key)
- route_number (Foreign Key)
- owner_name
- post_code
Schedule entity:
- schedule_number (Primary Key)
- route_number (Foreign Key)
- departure_time
- arrival_time
Step 3: Physical Data Model
Define tables with column names and data types:
Table: route
| Column | Data Type |
|---|---|
| route_number | INTEGER |
| route_name | VARCHAR(50) |
| origin | VARCHAR(50) |
| destination | VARCHAR(50) |
Table: bus_company
| Column | Data Type |
|---|---|
| company_id | INTEGER |
| route_number | INTEGER |
| owner_name | VARCHAR(50) |
| post_code | INTEGER |
Table: schedule
| Column | Data Type |
|---|---|
| schedule_number | INTEGER |
| route_number | INTEGER |
| departure_time | TIME |
| arrival_time | TIME |
ER modeling uses three main elements to represent database structure:
- Entities: Real-world objects stored in the database (represented as rectangles)
- Attributes: Properties of entities (represented as ovals)
- Relationships: How entities interact with each other (represented as diamonds)
Cardinality Types
- One-to-One (1:1): One entity associates with at most one entity in another set
- One-to-Many (1:M): One entity associates with multiple entities in another set
- Many-to-One (M:1): Multiple entities associate with single entity
- Many-to-Many (M:N): Multiple entities associate with multiple entities
Normalization organizes data into tables to minimize redundancy and prevent anomalies. The main normal forms are:
First Normal Form (1NF)
A table is in 1NF when it contains only atomic (single) values—no multi-valued attributes.
Example: Converting to 1NF
Given this unnormalized table:
| emp_id | emp_name | emp_address | emp_mobile |
|---|---|---|---|
| 101 | Hamis Waya | Iringa | 0658000770 |
| 102 | Erick Misitu | Mbeya | 0713876776; 0767000771 |
The emp_mobile column contains multiple values, violating 1NF. After normalization:
| emp_id | emp_name | emp_address | emp_mobile |
|---|---|---|---|
| 101 | Hamis Waya | Iringa | 0658000770 |
| 102 | Erick Misitu | Mbeya | 0713876776 |
| 102 | Erick Misitu | Mbeya | 0767000771 |
Second Normal Form (2NF)
A table is in 2NF when it is in 1NF and all non-key attributes are fully functionally dependent on the entire primary key—no partial dependencies.
Example: Converting to 2NF
Given this table:
| Teacher_id | Subject | Teacher_age |
|---|---|---|
| 25 | Computer | 40 |
| 25 | Biology | 40 |
| 47 | English | 35 |
The primary key is {Teacher_id, Subject}. However, Teacher_age depends only on Teacher_id (a subset of the key), creating partial dependency. Decompose into:
Teacher table:
| Teacher_id | Teacher_age |
|---|---|
| 25 | 40 |
| 47 | 35 |
Teacher_Subject table:
| Teacher_id | Subject |
|---|---|
| 25 | Computer |
| 25 | Biology |
| 47 | English |
Third Normal Form (3NF)
A table is in 3NF when it is in 2NF and no transitive functional dependencies exist—non-prime attributes depend only on the primary key.
Example: Converting to 3NF
Given this table with transitive dependency:
| emp_id | emp_name | emp_pc | emp_reg | emp_city | emp_district |
|---|---|---|---|---|---|
| 1001 | John Miti | 282005 | AR | Arusha | Arumeru |
Here, emp_reg, emp_city, and emp_district depend on emp_pc, which depends on emp_id—creating transitive dependency. Decompose into:
Employee table:
| emp_id | emp_name | emp_pc |
|---|---|---|
| 1001 | John Miti | 282005 |
Employee_address table:
| emp_pc | emp_reg | emp_city | emp_district |
|---|---|---|---|
| 282005 | AR | Arusha | Arumeru |
- Primary Key (PK): Unique identifier for each row; cannot be null
- Candidate Key: Minimal set of attributes that uniquely identify a row
- Alternate Key: Candidate keys not selected as primary key
- Foreign Key (FK): Attribute linking to another table's primary key
In Tanzania, database design principles are applied when developing student information systems for schools. For example, when creating a school management database, you would design a conceptual model identifying entities like Students, Subjects, and Results, then create a logical model with proper relationships (a student studies multiple subjects), and finally implement the physical model with tables, data types, and indexes in MySQL or Access. This ensures data is stored efficiently without redundancy, allowing quick retrieval of student marks, generation of reports, and prevention of data inconsistencies—such as a student appearing with different names in different records.
Swali
What is the main purpose of a conceptual data model in database design?
Ingia ili kuwasilisha jibu lako na lihesabiwe katika umahiri wako.
Ingia ili kufanya mazoeziMwalimu
Umekwama? Niulize chochote kuhusu mada hii.
Ingia ili kumuuliza Mwalimu wa AI wa Sonza kuhusu swali hili.
Ingia ili kuuliza