Tables, Records & Fields
A table is a collection of records. Each record is made of fields.
Each field has a data type such as String/Text, Integer, Float/Real, Boolean, Date & Time, etc.
Primary Keys, Foreign Keys & Relationships
The primary key is a unique identifier for each record.
e.g. the candidate number field is a primary key in the student table.
When a primary key is used to link records between two tables, it becomes a foreign key in the linked table.
There are 3 types of relationships to link tables:
- One-to-One Relationships,
- One-to-Many Relationships,
- Many-to-Many Relationships.
Entity Relationship Diagram (ERD)
En Entity Relationship Diagram is used to represent all the entities/tables with their attributes/fields and the relationships between these entities.
SQL Language
SQL stands for Structured Query Language. SQL is a standard language used to query a relational database. SQL can be used to:
- SELECT records from one or more tables
- INSERT new records into a table
- UPDATE records from a table
- DELETE records from a table
The basic syntax of the SQL language is as follows:
SQL can also be used to change the structure of a database e.g. creating, editing or dropping tables and indexes.
Learn how to define your own SQL queries
To recap…
Each record is made of
Each field has a such as string/text, , real/float, , date & time, etc.
The key is a unique for each record.
e.g. the candidate number field is a primary key in the student table.
When a primary key is used to link records between two tables, it becomes a key in the .