SQL tables Flashcards
What are table anomalies?
anomalies cause problems to the database
causes by poor planning or unnormalized database
-can be avoided with normalization
what are Update/modification anomalies?
inconsistencies that result from data redundancy or partial update
-incorrect data may be changes
what are Insertion anomalies?
- Inability to add data to a database due to missing data
- issues can happen when adding info to a database
- avoided by entering correct details- consistent with row values
what are deletion anomalies?
-unintended loss of data from deleting other data
least likely anomoly to notice or to stop you from proceeding
most costly in terms of recovery
What is normalization?
normalization removed redundant data
-improved storage and efficiency, data integrity and scalability
normalization splits existing tables, into multiple tables which rejoin each time a query is issued
What are the five steps of normalization
First normal form second normal form third normal form boyce-codd normal form forth normal form
First normal form must have these 4 qualifications
unique attribute name
unique row
single attribute value
no repeating file groups
Second normal form must have these 2 qualifications
- Table is in 1NF
- all non-key attributes all fully depend on primary ke
Third normal form must have these 2 qualifications
- Table is in 2NF
- non primary key attributes do not depend on other non primary key attributes
- transive dependencies are removed and placed in another table
What are transive dependencies?
Non key, dependent on non key
What is a multi values dependency?
when two or more independent multi valued facts about the same attribute occur in the same table
What is a functional dependency
When one keys value is fully dependent on another key