110 likes | 245 Views
Databases. Part 2. Overview. 4 easy pieces When a database is needed Complex data: normalizing Referential Integrity Queries: SQL. 4 easy pieces. Tables Queries Forms Reports. When a database is needed. Multiple entities Redundancy and Errors Anomalies: Delete, Update, Insert.
E N D
Databases Part 2
Overview • 4 easy pieces • When a database is needed • Complex data: normalizing • Referential Integrity • Queries: SQL
4 easy pieces • Tables • Queries • Forms • Reports
When a database is needed • Multiple entities • Redundancy and Errors • Anomalies: Delete, Update, Insert
Normalization • 1st Normal Form • No duplicate rows • Primary Key • Row and Column order doesn’t matter • A field has 1 piece of data • Separate First and Last name • No repeating groups
No Repeating Groups Good Bad
More Normalization • 2nd Normal Form • 3rd Normal Form • Boyce-Codd Normal Form • 4th Normal Form • 5th Normal Form • Domain/key Normal Form • 6th Normal Form
Referential Integrity • If delete Mary, orphaned phone #? • Cascade Deletes • Cascade Updates Friends Phones
SQL Design View • What is an Access Query? • Try it SELECT Friends.Last, Friends.First, Phones.Phone FROM Friends INNER JOIN Phones ON Friends.ID = Phones.ID ORDER BY Friends.Last, Friends.First, Phones.Phone; Datasheet View SQL View