Fundamentals of Databases Flashcards
Flat file database
Allows the user to specify data attributes for only one table at a time, storing those attributes independently. There is no link between the different tables
Relational database
Like Flat file but allowing the user to specify information about multiple tablet and the relationships between those tables
Primary key
An attribute that provides a unique identifier for every entity in a database table.
Foreign key
Attribute in a table which is the primary key in another, related table
What is normalising databases
Ensuring that entities contained no repeated data
Why normalise
So they are efficient without any compromise to the integrity of its data. Also easier to maintain and helps reduce the number of mistakes
First normal form
Not contain any repeating attributes
Referred to as having atomic data (no Single column containes more than one value)
Second normal form
Conform to 1nf
No partial key dependencies ( when a non key attribute doesnt depend on the whole of the composite key)
Third normal form
Conform to 2NF
Have no non key dependencies
ALL NON KEY ATTRIBUTES DEPEND ON THE KEY, THE WHOLE KEY AND NOTHING BUT THE KEY
SELECT (SQL)
Retrieve data
SELECT <attributes> FROM <table> WHERE <condition></condition></attributes>
UPDATE (SQL)
Used to modify
UPDATE <table> SET <attribute> = value WHERE <attribute> = value</attribute></attribute>
DELETE (SQL)
Removing entities
DELETE FROM <table> WHERE <condition></condition>
INSERT (SQL)
Add new record
INSERT INTO <table> () VALUES ()
Record lock
When a record is accessed, its immediately locked to others until the first user is finished
Serialisation
Requests from users are placed in a queue, when one user is finished the next command is executed