After completing the lessons in this module, you should be able to:
Describe the relational database model
Describe the structure of a relational database
Explain how relational database tables are linked to access data
Explain why SQL is the lingua franca of relational databases
Describe the functions of a relational database management system
The next lesson introduces you to the structures of the relational database model.
Here is a quick overview of the primary elements of a relational database.
These elements will be described in more detail as you continue with the course.
A relational database is a collection of related data tables.
Columns describe the specific pieces of information in the table and
each row stores the corresponding data.
For example a "Customer" table may contain columns:
CustID, Name, City, Item ID, Description, Qty, Total
The table would then have customer data stored in the rows of the table.
A primary key is one column or compilation of several columns
(concatendated primary key
that has a unique value, making each row unique in the table.
Every table must have a primary key
because it is used to link data in related tables
For example, the primary key of the Customer table would be the column called "CustomerId", whereas the Order History table may have "OrderID" as a primary key.
A foreign key is the primary key from another table and is used to relate rows of data between tables.
For example, the Order History table has a primary key of "OrderId" to identify each record. To know which customer placed the order,
the data from the customer's "CustomerID" column from the Customer table is stored in the Order History row.
Queries then can be performed to join the data from both tables together in business applications.