# data[].attributes.body
Normalization helps you organize your tables. You remove repeating data. You reduce update errors. You improve query accuracy. The goal is a stable structure.

Students only need to follow clear steps to reach better table designs. Start with First Normal Form. Move up when the structure holds.

Key points:

Normalization improves consistency.

Each table stores one subject.

Each column stores a single value.

Each table should rely on a primary key.

Higher normal forms remove partial and transitive dependencies.

# data[].attributes.body
Your group prepares one unnormalized table based on your project topic.

Follow these steps.

Identify your system topic.
Examples: booking, inventory, food ordering, student activity, clinic record.

Select one process in your system that stores repeated details.
Examples: one customer with multiple orders, one patient with multiple visits, one booking with multiple services.

Build one unnormalized table. Include:
– One main entity such as Customer, Patient, Student, User.
– At least three repeating attributes such as Item1, Item2, Item3 or Service1, Service2, Service3.
– At least two attributes linked to each repeated item such as Price1, Price2, Price3 or Quantity1, Quantity2, Quantity3.

Include a minimum of five sample rows of data.

Prepare the table in Excel.
Columns must show the repeated groups clearly.

Submit the table in your Google Drive folder and bring it to class for normalization steps.

https://forms.gle/Zwva4hPedpBrTmk1A

# data[].attributes.attachment_link.description
Access Google Forms with a personal Google account or Google Workspace account (for business use).

# data[].attributes.body
Scenario
Customers place orders. Each order includes multiple products. Products belong to categories. A category contains many products. An order contains many products and a product appears in many orders.

Task for students
• Identify main entities
• Identify M:N relationship and associative table

# data[].attributes.body
1. Task: Create a Digital Identity Card about yourself, but with a twist — it must include:

Name & a fun fact about yourself.

A “motto” or “tagline” that represents you.

3 keywords that best describe your learning/working style.

A creative element (e.g., meme, doodle, Canva design, mini-video, or even a hand-drawn version scanned).

2. Format: Students can choose any medium (poster, infographic, short TikTok-style video, or even simple PowerPoint/Google Slide).

3. Deadline: Submit before the next face-to-face class.

4. Presentation: In class, each student gets 2 minutes to present their card.

# data[].attributes.body
HI, my name is Rozniza

# data[].attributes.attachment_link.title
Card - Rozniza Ali A Journey of Learning (1)

# data[].attributes.body
Hi ! My name is Nur Amirah Najwa

# data[].attributes.body
Hi , my name is Khairina

# data[].attributes.body
Hi! My name is Nuraisha Dayini

# data[].attributes.attachment_link.title
Pink and Black Modern Business Name Id Card

# data[].attributes.body
Hi , my name is Adlina

# data[].attributes.body
Hello! my name is Faris Ameer

# data[].attributes.attachment_link.title
Beige Watercolor Graphic Designer Resume CV A3 Landscape

# data[].attributes.body
hi my name is fatin alyssa

# data[].attributes.body
Hi. My name is Satishwaran.

# data[].attributes.body
Hi my name is nurin

# data[].attributes.attachment_link.title
Black and White Doodle Self Introduction Presentation

# data[].attributes.attachment_caption
Hi..i'm Zaidatul Syazni binti Ahmad Zakuan

# data[].attributes.body
NUR A’LIAH BINTI NAZIM

# data[].attributes.attachment_link.title
Black and White Bold All About Me Instagram Post_20251005_100806_0000

# data[].attributes.body
Hi I am ruban

# data[].attributes.body
Hi, nama saya Habannakah

# data[].attributes.attachment_link.title
Blue and Pink Modern and Retro About Me Poster-2

# data[].attributes.body
Hi my name is Affieq

# data[].attributes.body
MY NAME IS AHMAD ALIF ZULFADHLI BIN AHMAD NADZMI

# data[].attributes.attachment_link.title
Beige Yellow Retro All About Me Poster_20251005_104645_0000

# data[].attributes.body
Basic SELECT

Task:
Display all information from the STUDENT table.

answer:

SELECT * FROM STUDENT;

# data[].attributes.body
Selecting Columns

Task:
Show only course code and title from the COURSE table.

Sql:

SELECT CourseCode, Title

FROM COURSE;

# data[].attributes.body
Column Alias

Task:
Display lecturer name as “Lecturer” and department as “Dept”.

SQL:

SELECT LecName AS Lecturer, Department AS Dept

FROM LECTURER;

# data[].attributes.body
Computed Column

Task:
List product ID, price, quantity, and total value (Price × Quantity) as TotalValue.

Answer (SQL):

# data[].attributes.body
DISTINCT Clause

Task:
Display a list of unique CourseCode values.

Answer (SQL):

SELECT DISTINCT CourseCode FROM ENROLLMENT;

# data[].attributes.body
ORDER BY

Task:
List customers ordered alphabetically by Name.

Answer (SQL):

SELECT * FROM CUSTOMER

ORDER BY Name ;

# data[].attributes.body
WHERE Clause

Task:
List products priced above 100.

Answer (SQL):

SELECT * FROM PRODUCT WHERE Price > 100;

# data[].attributes.body
Logical Operators

Task:
Display employees who work in IT and earn more than 2500.

Answer (SQL):

# data[].attributes.body
GROUP BY

Task:
Find total sales amount by region.

Answer (SQL):

SELECT Region, SUM(Amount) AS TotalSales

FROM SALES

GROUP BY Region;

# data[].attributes.body
HAVING Clause

Task:
Show regions where total sales are greater than 600.

Answer (SQL):

# data[].attributes.body
INNER JOIN

Task:

List customer names with their corresponding order totals.

Answer (SQL):

SELECT customer.Name, `order`.Total

FROM customer

INNER JOIN `order`

ON customer.CustID = `order`.CustID;

# data[].attributes.body
LEFT JOIN

Task:
Show all students and their enrolled course, if any.

Answer (SQL):

# data[].attributes.body
Subquery

Task:
List employees earning more than the average salary.

Answer (SQL):

# data[].attributes.body
Set Operator (UNION)

Task:
Combine both lists into one list of all unique employee names.

Answer (SQL):

# data[].attributes.body
LIKE and Wildcards

Task:
Find all students whose names start with “Ami”.

Answer (SQL):

SELECT * FROM student

WHERE Name LIKE 'Ami%';

# data[].attributes.body
BETWEEN

Task:
Display orders where the amount is between 300 and 700.

Answer (SQL): SELECT *

FROM ORDER

WHERE Amount BETWEEN 300 AND 700;

SELECT *

FROM ORDER

WHERE Amount >= 300 AND Amount <= 700;

# data[].attributes.body
COUNT and Aggregate Function

Task:
Count how many students are enrolled in each course.

Answer (SQL): SELECT COUNT(*) AS total_student

FROM ENROLLMENT;

# data[].attributes.body
IS NULL

Task:
Find customers with missing phone numbers.

Answer (SQL):

SELECT * FROM Customer WHERE Phone IS NULL

# data[].attributes.headline
Case Study: Branch and Staff Relationship

# data[].attributes.subject
Case Study: Branch and Staff Relationship

# data[].attributes.body
If you try to insert or update a branchNo in the Staff table that doesn’t exist in Branch, it will be rejected.

INSERT INTO Staff VALUES ('S004', 'Aiman', 'B999'); -- ERROR

Reason: Branch B999 doesn’t exist in the Branch table.

# data[].attributes.headline
Subclauses: ON DELETE / ON UPDATE Actions

# data[].attributes.subject
Subclauses: ON DELETE / ON UPDATE Actions

# data[].attributes.body
CASCADE

FOREIGN KEY (branchNo)

REFERENCES Branch(branchNo)

ON DELETE CASCADE

ON UPDATE CASCADE;

If a branch is deleted or its branchNo is changed,
→ all related staff records will also be deleted or updated automatically.

Example:

DELETE FROM Branch WHERE branchNo = 'B001';

Result:

B001 deleted from Branch.

All staff working under B001 (Ali, Fatimah) are also deleted from Staff.

# data[].attributes.headline
Subclauses: ON DELETE / ON UPDATE Actions

# data[].attributes.subject
Subclauses: ON DELETE / ON UPDATE Actions

# data[].attributes.body
SET NULL

FOREIGN KEY (branchNo)

REFERENCES Branch(branchNo)

ON DELETE SET NULL

ON UPDATE SET NULL;

If a branch is deleted or updated,
→ the branchNo in the Staff table becomes NULL.

DELETE FROM Branch WHERE branchNo = 'B001';

# data[].attributes.headline
Subclauses: ON DELETE / ON UPDATE Actions

# data[].attributes.subject
Subclauses: ON DELETE / ON UPDATE Actions

# data[].attributes.body
SET DEFAULT

FOREIGN KEY (branchNo)

REFERENCES Branch(branchNo)

ON DELETE SET DEFAULT;

# data[].attributes.headline
Several different types of keys are used in the relational model

# data[].attributes.subject
Several different types of keys are used in the relational model

# data[].attributes.body
University Database

Table: Student

Table: Enrollment

Task:

1. What is key attribute in Student? Why?

2. Define the entity integrity and explained.

3. Identify the null example, explained.

4. Explain by providing example for referential integrity.

5. Define Super key.

6. Define Primary key.

7. Define foreign key.

8. Define alternate key.

# data[].attributes.headline
Subclauses: ON DELETE / ON UPDATE Actions

# data[].attributes.subject
Subclauses: ON DELETE / ON UPDATE Actions

# data[].attributes.body
NO ACTION (default)

FOREIGN KEY (branchNo)

REFERENCES Branch(branchNo)

ON DELETE NO ACTION;

You cannot delete a branch if staff are still linked to it.

The database will reject the delete.

Example:

DELETE FROM Branch WHERE branchNo = 'B001';

ERROR: Cannot delete Branch ‘B001’ because Staff records still reference it.

# data[].attributes.body
Scenario
Your library stores books. Each book is written by one author. One author writes many books. Members borrow books. A member borrows many books. A book is borrowed many times.

Task for students
• Identify entities
• Identify relationships
• Identify primary keys
• Draw ERD

# data[].attributes.body
Table: StudentCourse
StudentID | StudentName | Course1 | Course2 | Course3 | Lecturer1 | Lecturer2 | Lecturer3

Issues:

1. Repeating groups like Course1, Course2, Course3.

2. Mixed subjects in one table.

3. Hard to update lecturers.