Introduction
Hi everyone! 🤗
I’m back with a new set of SQL questions. They aren't too complicated (I think), but I've often struggled to explain them clearly 🥹. I could give examples from my own use, but I couldn't always find the right words to describe them.
I'll keep this intro short, so let's dive into the questions! 🤓
In this example, StudentID is the primary key. Each student has only one StudentID.
...
Candidate key
A candidate key is a set of columns that can uniquely identify each row in a table. A table can have multiple candidate keys, but only one will be chosen as the primary key. A candidate key must be minimal and cannot include extra columns.
Table vehicles
{EmployeeID, Email}and{EmployeeID, Email, PhoneNumber}are Super Keys because the combination of those columns can uniquely identify each record.
...
Alternate Key
When a primary key is selected, any remaining key becomes an alternate key.
Table Authors
Primary Key => EmployeeID (Unique for each employee).
Unique Key => Email (Each email is unique).
...
Composite Key
These keys are made up of two or more columns that uniquely identify a record.
Table CourseEnrollments
Table customers
And the table Departments
SOCIAL SHARE CARD GENERATOR