DATABASES Flashcards
What is a DB
persistent and structured collection of data
What is a record
Single unit in a database, made up of fields (name ,Id,etc)
What is a transaction
Change in state of a database
What is transaction file
A file of events
What is a master file
Principal file that stores basic details about a business (eg supermarket stock)
What is a flat file database
One table in the database, no other tables
What is a entity
Any thing represented in a database like a student or bag
What is a relational database
Database with one or more tables with unique keys to provide a relations between data
What is a tuple
Same as record
What is a primary key
Unique key to a row
What is a foreign key
A field repeated from another table
What is a secondary key
Additional key used with the primary key to locate a piece of data, narrowing down the data. It’s not unique but it is unique to a smaller number of fields making the search possibly faster
What is data redundancy
Unnecessary repeated data
What is database normalisation
Where collection of data is gradually (in 3 steps) organised into tables to remove data redundancies
Requirements for 1NF
No duplicate columns
Has primary key
Data is atomic
Requirements for 2NF
1NF
every field is dependent on the primary key
Requirements for 3NF
2NF
No transitive dependencies, fields cannot depend on a non key field
NO MANY TO MANY RELATIONSHIPS
What is a composite key
Combination of multiple keys, eg first and surname
What does CRUD mean in a RDB
DB must be able to have create read update and delete rows
What is transaction processing
Processing which provides a response to a user in a short time
What is data integrity
Data is intended and is fit for purpose
What is meant by referential integrity [2]
Ensuring that changes in a database are consistent (so) if a record is removed all references are also removed
What are the ACID rules in a database
ATOMICITY - changes in a database are performed, or not performed
CONSISTENCY - constant state of the database before and after
ISOLATION - transactions are performed in isolation, so nothing can interrupt it, only until data has been committed
DURABILITY - once A change is made is must not be lost
SQL to select name and address from customer table , where the name must be cox
SELECT “NAME”, “ADDRESS” FROM “Customers” WHERE “Name” = “Cox”;