10: Fundamentals of Databases Flashcards
Relational Database
A database where data is held in multiple tables, which are linked together by relationships
Primary Key
An attribute in a database table, that acts as a unique identifier for each record
Composite Primary Key
A primary key that consists of multiple attributes
Attribute
A category heading for each item of data in a column of a table
Foreign Key
A primary key of one table, that appears in another table to create a relationship between them
First Normal Form (3)
- Each record has a primary key
- Data is atomic
- No repeating group of attributes
Second Normal Form
No partial dependencies (where a non-key attribute varies with only part of a composite primary key, a new table must be created)
Third Normal Form
No non-key dependencies (where one non-key attribute varies with another, a new table must be created)
Benefits of Normalised Databases (3)
- Reduction in the amount of duplicated data
- Improved data and referential integrity
- Elimination of insertion, update and deletion anomalies
SQL Retrieve Command
SELECT column_1, column_2, …
FROM table
WHERE condition[s]
ORDER BY column [DESC]
LIMIT num_limit
OFFSET num_offset
SQL Update Command
UPDATE table
SET column_1 = new_value_1, column_2, = new_value_2, …
WHERE condition[s]
SQL Insert Command
INSERT INTO table [(column_1, column_2, …)]
VALUES (value_1, value_2, …)
SQL Delete Command
DELETE FROM table
WHERE condition[s]
SQL Create Table Command
CREATE TABLE table (
column_1 datatype_1 [PRIMARY KEY],
column_2 datatype_2,
…
[FOREIGN KEY (foreign_key_1) REFERENCES other_table (primary_key),
…]
)
A Client Server Database System Provides ____
Simultaneous access to the database for multiple clients