FirstHack Learn
Log in Sign up free
Lessons in this course 0/6 All courses DBMS and SQL

CSE

Progress0 / 6 lessons
  1. 1. Why databases exist and what a table really is
  2. 2. SELECT, WHERE, ORDER BY and LIMIT
  3. 3. JOINs, with a worked two-table example
  4. 4. GROUP BY, aggregates, and HAVING vs WHERE
  5. 5. Keys and normalisation up to 3NF
  6. 6. Transactions, ACID, and what happens on a crash

Courses › DBMS and SQL

Keys and normalisation up to 3NF

One badly designed table, fixed step by step through 1NF, 2NF and 3NF.

14 min read · Lesson 5 of 6 · Pro

Keys first, because normalisation is defined in terms of them

Super key — any set of columns that uniquely identifies a row. {roll_no} works. So does {roll_no, name}, wastefully.

Candidate key — a super key with nothing spare. Remove any column and it stops being unique. {roll_no} is a candidate key; {roll_no, name} is not, because name is dead weight.

Primary key — the candidate key you chose. One per table.

Foreign key — a column that points at another table's primary key.

Composite key — a primary key made of two or more columns together, like {roll_no, subject_code} in an enrolment table.

The rest of this lesson is Pro

The free lessons of DBMS and SQL finish what they start — read those first if you have not. This one goes further, and it is part of the paid half.

A pass opens the paid lessons of every course, the mock test papers and the company-wise series. It ends on its own date; nothing renews by itself.

Get a pass — from ₹29 for 7 days

Already bought one? Log in.