Database Fundamentals
What to know
A database is an organised collection of related data managed by a database management system (DBMS). Data lives in tables made of records (rows) and fields (columns). Each field has a data type: text, number, date, currency, yes/no, or a link to another table. A primary key uniquely identifies each record and cannot be blank or duplicated; a foreign key in one table points to a primary key in another, creating relationships such as one customer to many orders. Good relational design avoids duplication: repeating a customer's address in every order is a redundancy problem to be split into its own table.
Queries ask questions of the data (for example SELECT Name FROM Students WHERE Grade = 10), forms provide friendly data entry, and reports produce printable output. Sorting orders records, filtering selects them, and indexes speed up searches. A relational database enforces validity through data types, required fields and key constraints.
Traps
Field versus record is the classic swap: a field is a column, a record is a row. A table is not a database. A query result is not stored data unless it is saved as a table or view. Two students may share a name, but no two records may share a primary key. Text fields cannot be summed, and dates stored as text will not sort correctly.
Worked example
In a Students table, StudentID is the primary key because each value is unique and never blank; ClassID appears there as a foreign key pointing to the Class table.