This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: L AB 7 D ATA D ESIGN PRINCIPLES OF GOOD DATA DESIGN With modern database programs such as Access it is relatively easy to create a database. But creating a well-designed database is another matter. With a well-designed database it is easy to enter and update information and generally simple to create the queries needed to report the information. On the other hand, a poorly designed database is difficult to maintain, difficult to query, and difficult to modify. In this chapter, we will learn about entity relationships, discuss the general principles of good database design, and then put those principles into practice. Good database design can be summarized in four rules: Give each entity a unique primary key Eliminate calculated attributes Make sure each attribute relates to or describes the primary key Eliminate repeating attributes What do these rules mean and how do we apply them? Let's take an example database. A group of students in a dorm have decided that they want to create a DVD library of the DVDs they own. They want a database to track the DVDs that are available and who owns them (i.e. where to find them). When first learning to design databases, it is important that you be able to visualize the data. A good tool for doing that is to enter sample data into Excel or another spreadsheet. The initial draft of the spreadsheet is shown below. Title Genre Year Rating Director Min Hr:Min Star Star Star #Discs Owned By Phone Signs Drama 2002 PG-13 M. Night Shyamalan 106 1:46 Mel Gibson Joaquin Phoenix 2 M. Johnson 1663 Unbreakable Drama 2000 PG-13 M. Night Shyamalan 106 1:46 Bruce Willis Samuel L. Jackson 2 M. Johnson 1663 The Matrix Action 1999 R Wachowski Brothers 136 2:16 Keanu Reeves Laurence Fishburne Carrie-Anne Moss 1 R. Ramiriz 2892 Braveheart Action 1995 R Mel Gibson 177 2:57 Mel Gibson Patrick McGoohan Sophie Marceau 1 T. Sufolo 1877 Dr. Strangelove Comedy 1964 PG Stanley Kubrick 93 1:33 Peter Sellers George C. Scott Sterling Hayden 1 T. Sufolo 1877 Fellowship of the Ring Action 2001 PG-13 Peter Jackson 181 3:01 Elijah Wood Ian McKellen Viggo Mortensen 4 T. Sufolo 1877 Mystery Men Comedy 1999 PG-13 Kinka Usher 121 2:01 Ben Stiller Hank Azaria Janeane Garofalo 1 R. Ramiriz 2892 Casablanca Drama 1942 NR Michael Curtiz 102 1:42 Humphrey Bogart Ingrid Bergman Claude Rains 1 M. Johnson 1663 The Maltese Falcon Mystery 1941 NR John Huston 101 1:41 Humphrey Bogart Peter Lorre Sydney Greenstreet 1 R. Ramiriz 2892 Spider-Man Action 2002 PG-13 Sam Raimi 121 2:01 Tobey Maguire Willem Dafoe Kirsten Dunst 2 D. Gregson 3288 Monsters, Inc. Comedy 2001 G Peter Doctor 92 1:32 John Goodman Billy Crystal 2 D. Gregson 3288 Band of Brothers Action 2001 NR David Frankel 600 10:00 Damian Lewis Donnie Wahlberg Ron Livingston 6 R. Ramiriz 2892 This is Spinal Tap Comedy 1984 R Rob Reiner 83 1:23 Christopher Guest Michael McKean Harry Shearer 1 D. Gregson 3288 The Matrix Action 1999 R Wachowski Brothers 136 2:16 Keanu Reeves Laurence Fishburne Carrie-Anne Moss...
View Full Document
- Spring '12
- Entity-relationship model, primary key, R. Ramiriz M. Johnson R. Ramiriz D. Gregson D. Gregson R. Ramiriz D. Gregson D. Gregson M. Johnson