Represents one entity set, e.g. a Students table stores every student in the school.
Tables are unordered, a DBMS can physically store rows anywhere as long as the logical structure is preserved.
Record (tuple / row):
One horizontal line of data inside a table.
Integrity rules (such as NOT NULL or CHECK) are validated at the record level when it is inserted or updated.
Example
Contains all attribute values describing a single entity instance, for example, Student #1024’s name, birth‑date and grade.
Field (attribute / column)
Vertical slice specifying a single data item (e.g., Email VARCHAR (100)).
Every record supplies one atomic value for the field, drawn from the column’s defined data type and domain.
Columns can carry constraints (default values, uniqueness) and metadata (comments, collation, masks).
Primary key
Column(s) chosen to uniquely label each record, cannot be NULL.
Guarantees entity integrity and is automatically indexed, speeding joins and searches.
Other tables reference it through foreign keys (e.g., StudentID in Students).
Secondary key (alternate / secondary index)
Any non‑primary column (or set) indexed to speed look‑ups.
May contain duplicates (e.g., LastName in Students) or be unique (NationalID), but uniqueness is not required.
Improves query performance without enforcing identity.
Foreign key
Column(s) holding values that match a primary key in another (or the same) table.
Enforces referential integrity: prevents orphaned rows, and can cascade updates/deletes if configured.
Example
ClassID in Students references Classes(ClassID).
Candidate key
Any minimal field set whose values are unique and non‑null, qualifies to become the primary key.
A table can have multiple candidate keys (e.g., StudentID, NationalID, Email) but only one is selected as the primary key.
Composite primary key
Primary key formed by two or more columns whose combined value is unique.
Common in junction tables, Enrollments(StudentID, CourseID), where neither column alone is unique but together they prevent duplicate enrolments.
Join (inner join)
Relational operation that merges rows from two tables where specified columns match (usually a foreign‑key ↔ primary‑key pair).
Returns only the intersecting rows, non‑matching rows are excluded.
Example
SELECT s.Name, c.Title FROM Students s INNER JOIN Enrollments e ON s.StudentID = e.StudentID INNER JOIN Courses c ON e.CourseID = c.CourseID
End of article
Flashcards
Remember key concepts with flashcards
15 flashcards
What is a foreign key?
Lesson
Recap your knowledge with an interactive lesson
10 minute activity
Note
What is Database?
A database is an organized collection of structured information, or data, typically stored electronically in a computer system. Databases are designed to manage large amounts of information efficiently and allow users to retrieve, update, and manipulate data easily.
DefinitionDatabaseA structured collection of data that is stored and accessed electronically from a computer system.AnalogyThink of a database like a digital filing cabinet where each drawer represents a table, and each file within the drawer represents a record.ExampleA library database might contain tables for books, authors, and borrowers, allowing librarians to quickly find information about any book or borrower.
Unlock the rest of this chapter with aFreeaccount
Nice try, unfortunately this paywall isn't as easy to bypass as you think. Want to help devleop the site? Join the team at https://revisiondojo.com/join-us. exercitation voluptate cillum ullamco excepteur sint officia do tempor Lorem irure minim Lorem elit id voluptate reprehenderit voluptate laboris in nostrud qui non Lorem nostrud laborum culpa sit occaecat reprehenderit
Definition
Paywall
(on a website) an arrangement whereby access is restricted to users who have paid to subscribe to the site.
anim nostrud sit dolore minim proident quis fugiat velit et eiusmod nulla quis nulla mollit dolor sunt culpa aliqua
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Note
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation.
Excepteur sint occaecat cupidatat non proident
Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.
Hint
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum.