0
0
DBMS Theoryknowledge~30 mins

First Normal Form (1NF) in DBMS Theory - Mini Project: Build & Apply

Choose your learning style9 modes available
First Normal Form (1NF) in Database Design
📖 Scenario: You are designing a simple database table to store information about students and their enrolled courses. Initially, the data is not organized properly and violates the First Normal Form (1NF).Your task is to transform this data into 1NF by ensuring each field contains atomic (indivisible) values and there are no repeating groups.
🎯 Goal: Build a table structure that follows the First Normal Form (1NF) rules by separating repeating course entries into individual rows.
📋 What You'll Learn
Create an initial table with student names and their courses in a single field (violating 1NF).
Add a helper variable to hold the delimiter used in the courses field.
Write the core logic to split the courses into atomic values and create a new table with one course per row.
Complete the final table structure that follows 1NF with no repeating groups.
💡 Why This Matters
🌍 Real World
Database designers and developers use normalization, starting with 1NF, to organize data efficiently and avoid problems like data duplication and update anomalies.
💼 Career
Understanding 1NF is essential for roles such as database administrator, data analyst, and software developer to design reliable and maintainable databases.
Progress0 / 4 steps
1
Create initial table with repeating groups
Create a dictionary called students_courses with these exact entries: 'Alice': 'Math,Science', 'Bob': 'History,Math', and 'Charlie': 'Science'. This represents students with their courses in a single string, which violates 1NF.
DBMS Theory
Need a hint?

Use a dictionary with student names as keys and a single string of courses separated by commas as values.

2
Add delimiter configuration
Create a variable called delimiter and set it to the string ',' to represent the separator used in the courses string.
DBMS Theory
Need a hint?

Set the delimiter variable to a comma string to split the courses later.

3
Split courses into atomic values
Create an empty list called normalized_table. Use a for loop with variables student and courses to iterate over students_courses.items(). Inside the loop, split courses by delimiter and for each course, append a tuple (student, course) to normalized_table.
DBMS Theory
Need a hint?

Use nested loops: outer loop over dictionary items, inner loop over split courses.

4
Complete the 1NF table structure
Create a list called final_table and assign it the value of normalized_table. This represents the final table structure that follows First Normal Form (1NF) with one course per row and no repeating groups.
DBMS Theory
Need a hint?

Simply assign the normalized list to a new variable representing the final 1NF table.