0
0
SQLquery~20 mins

First Normal Form (1NF) in SQL - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
1NF Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
Identify 1NF Violation in Table Data

Consider the following table Orders:

OrderID | Customer | Items
------- | -------- | -----------
1       | Alice    | Pen, Notebook
2       | Bob      | Pencil
3       | Carol    | Eraser, Sharpener, Ruler

Which of the following statements best describes why this table violates the First Normal Form (1NF)?

AThe <code>Customer</code> column contains NULL values.
BThe <code>OrderID</code> column has duplicate values.
CThe <code>Items</code> column contains multiple values in a single cell, violating atomicity.
DThe table has no primary key defined.
Attempts:
2 left
💡 Hint

1NF requires each column to hold atomic (indivisible) values.

query_result
intermediate
2:00remaining
Result of Query on 1NF Compliant Table

Given a table Students with columns StudentID, Name, and PhoneNumber, where each student has only one phone number stored per row (1NF compliant). The table data is:

StudentID | Name  | PhoneNumber
--------- | ----- | -----------
1         | John  | 123-4567
2         | Jane  | 234-5678
3         | Mike  | 345-6789

What will be the output of the query:

SELECT Name, PhoneNumber FROM Students WHERE PhoneNumber LIKE '234%';
AName: Jane, PhoneNumber: 234-5678
BName: John, PhoneNumber: 123-4567
CNo rows returned
DName: Mike, PhoneNumber: 345-6789
Attempts:
2 left
💡 Hint

Look for phone numbers starting with '234'.

schema
advanced
2:30remaining
Design a 1NF Compliant Table Schema

You need to design a table Books to store book information including multiple authors per book. Which schema design ensures the table complies with First Normal Form (1NF)?

ABooks(BookID INT, Title VARCHAR, Authors JSON) storing authors as a JSON array.
BBooks(BookID INT, Title VARCHAR), and a separate Authors(BookID INT, AuthorName VARCHAR) table linking authors to books.
CBooks(BookID INT, Title VARCHAR, Author1 VARCHAR, Author2 VARCHAR, Author3 VARCHAR) with fixed author columns.
DBooks(BookID INT, Title VARCHAR, Authors VARCHAR) where Authors stores comma-separated author names.
Attempts:
2 left
💡 Hint

1NF requires atomic values and no repeating groups in a single table.

🔧 Debug
advanced
2:30remaining
Identify the 1NF Violation in SQL Table Definition

Review the following SQL table definition:

CREATE TABLE Employees (
  EmployeeID INT PRIMARY KEY,
  Name VARCHAR(100),
  Skills VARCHAR(255)
);

The Skills column stores multiple skills separated by commas (e.g., 'SQL,Python,Java'). What is the problem with this design regarding First Normal Form (1NF)?

AThe <code>Skills</code> column violates 1NF because it stores multiple values in one field.
BThe <code>EmployeeID</code> is not unique.
CThe <code>Name</code> column allows NULL values.
DThe table lacks a foreign key constraint.
Attempts:
2 left
💡 Hint

1NF requires each column to hold atomic values.

🧠 Conceptual
expert
3:00remaining
Why is First Normal Form (1NF) Important in Database Design?

Which of the following best explains the main reason why First Normal Form (1NF) is essential in relational database design?

AIt reduces data redundancy by splitting tables into smaller related tables.
BIt ensures that each table has a primary key to uniquely identify rows.
CIt enforces referential integrity between tables using foreign keys.
DIt guarantees that all columns contain atomic values, preventing multi-valued attributes and enabling reliable querying.
Attempts:
2 left
💡 Hint

Think about what atomic values mean and why they matter.