Compsci Is For Nerds Flashcards
Database
Collection of interrelated persistent data stores without unnecessary redundancies to serve one or more applications
DBMS
Database Management System enables users to create maintain and control access
DBMS Disadvantage
Complexity, cost of management, performance, converting old data
Rows and columns
Rows called records column given distinct nane
Must be unique to prevent redundancies
Field
Attribute within a record carrying data, makes primary key
Entity
A table, attributes are shown as column headings
Must have primary key
Things that can only have one instance cannot be entities
Candidate Key
Minimal number of attributes uniquely identifting occurence of an entity
Primary key is chosen candidate key to identify records
Attribute lore
If max amount of values is known it can be an attribute, if an attribute has its own attribute it should be a seperate entity referenced by ID
Weak entity vs Strong entity
Weak entity is a child as one box and strong entity is a parent as box with outline
1NF Check
A table must not have more than one entry in any field
1NF Fix
Duplicate the rest of the row in the offending field
Non 1NF problems
Slow search
Inserting deleting updating difficult and error prone
Wasted space
Key Field (Candidate Key)
Different for every row so can be used to identify each row
Fields may need to be combined to form a key
Dependent key
If we know the value of a record from other records it is dependent
B is dependent on A
A: Determinant
B: Dependent
Non key fields are dependent on key fields
2NF Check
Check in 1NF
All non key fields must depend on whole table key