BACKGROUND •Terms - data,information, file record, table, row , column, transaction, concurrency •Concepts - data integrity, data redundancy, •Type of databases – single-user, shared, etc. •Meta data versus actual operational data •Functions of a DBMS 1.Data Dictionary Management 2.Data Storage Management 3.Data presentation ( access through SQL) 4.Security 5.Multi-User (transaction) 6.Back-up and Recovery (stores multiple versions) •Data Models 1.Attributes 2.Relationships (1-1, 1-many) 3.Constraints •Using Access 1.Different views – Dataview, Datasheet 2.Declaring column datatypes 3.Primary keys 4.Relationship diagrams 5.Cascade deleting NORMALILZATION •Definition – Remove redundancies by segmenting and eliminating dependencies •Normal Forms •1st Normal – No repeating fields •2nd Normal – No partial dependencies •3rd Normal – No transitive dependencies SQL SELECT STATEMENTS •Column Select •- rename column with AS •- * means all columns •- [ ] for column name with embedded spaces •Use of aggregate functions •FROM •Join tables, rename tables •WHERE •RELATIONAL ALGEBRA comparisons •Can implement logical join •GROUP BY •Creates Summary Record •Having is similar to where clause •ORDER BY (sort criteria) • ASC or DESC Steps in normalization 3 Table with multivalued attributes, not in 1st normal form 4 Table with no multivalued attributes and unique rows, in 1st normal form 5 Functional dependency diagram for INVOICE Order_ID Order_Date, Customer_ID, Customer_Name, Customer_Address Customer_ID Customer_Name, Customer_Address Product_ID Product_Description, Product_Finish, Unit_Price Order_ID, Product_ID Order_Quantity Therefore, NOT in 2nd Normal Form 6 Figure 5-28 Removing partial dependencies Getting it into Second Normal Form Partial dependencies are removed, but there are still transitive dependencies 7 Third Normal Form 2NF PLUS no transitive dependencies (functional dependencies on non-primary-key attributes) Note: This is called transitive, because the primary key is a determinant for another attribute, which in turn is a determinant for a third Solution: Non-key determinant with transitive dependencies go into a new table; non-key determinant becomes primary key in the new table and stays as foreign key in the old table 8
© Copyright 2024 Paperzz