Databases and SQL Flashcards
What is a flat file database?
A flat file database is a database of just one table.
It’s an organised computerised system that makes it easy to search, select and store information. It stores information until specifically deleted.
What is a relational database?
A relational database is a structured database that is made up of more than one table. It allows data to be separated and connected across several tables.
What is a primary key?
A primary key is an unique identifier for each record. It uniquely identifies a record in one table and a table can only have one primary key.
What is a table?
A table is a collection of record for a specific theme.
What is a field?
A field is categories for each piece of data in a table.
Give some examples of a field.
First name
Surname
Student ID
What is a record?
A record is a row of data for one object, person, or place.
Why can data redundancy be a problem?
Data redundancy can be a problem because data can be repeated in a database table, and it makes the database file much larger than it needs to be.
Why can data inconsistency be a problem?
Data inconsistency can be a problem because the more redundant data there is, the more likelihood there is that errors are introduced and that some of that data will be inconsistent. This would create differences in the data stored on a database.
What is a foreign key?
A foreign key is a primary key from one table that appears in another table to link the two together.
Why might the primary key for one table, not be the same primary key in another table?
A primary key provides a mechanism for ensuring that the rows in a table are unique. Other columns might also contain unique values, but a table can contain only one primary key. Because the primary key must be able to identify each row, no columns that participate in a primary key can contain NULL values.
What are comparison operators?
= - Equal to > - Greater than < - Less than >= - Greater than or equal to <= - Less than or equal to <> OR =! - Not equal to
Logical Operators:
AND
AND - TRUE if both conditions are TRUE
Logical Operators:
BETWEEN
BETWEEN - TRUE if the range is within the comparisons
Logical Operators:
OR
OR - TRUE if any of the conditions are TRUE