Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Database design & Normalization (1NF, 2NF, 3NF)

522,920 views

Published on

Brief introduction about database design & Database normalization basics

Published in: Education, Technology
  • Gout is now curable - and this is how I cured mine. ★★★ https://url.cn/5KTbhTX
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Read this heartfelt letter below from Sonasi Samita, a disease-ridden man stricken with kidney failure, diabetes, gout, heart problems, and blindness. He tells his tear-jerking story on how the Demolisher system has totally changed his life! Sonasi says he's convinced that the Demolisher system is God's answer to his prayers!  http://t.cn/A6zP24pL
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Tattoo surgery too expensive? Lemon + this ingredient can take it off, Safe, effective, and inexpensive. ●●● http://t.cn/A67tYrNv
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Easy and hassle free way to make money online! I have just registered with this site and straight away I was making money! It doesn't get any better than this. Thank you for taking out all the hassle and making money answering surveys as easy as possible even for non-techie guys like me! ★★★ https://tinyurl.com/vd3y33w
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Database design & Normalization (1NF, 2NF, 3NF)

  1. 1. www.lib.ku.edu/instruction Database Design Practical Database Design for Relational Database Management Systems Overview A little background and terminology: What is a relational database? What is a primary key? What is a foreign key? Things to know about designing a database: The normalization process and how/why use it Relating tables Types of relationships 9/19/07 2© 2007 Instructional Services at KU Libraries, The University of Kansas
  2. 2. www.lib.ku.edu/instruction Relational Database Management System Collection of information organized in tables Tables are also “relations” Tables are constructed and associated to each other through shared fields–“common” fields Fields are also “columns” or “attributes” A set of attributes comprises a record Records are also “rows” or “tuples” Tables are related through common fields designated as primary and foreign keys Allow us to find, update, and delete data quickly, and help to ensure accuracy 9/19/07 3 Primary and Foreign Key Fields Primary Key Primary key fields must be unique and cannot contain a null value. Each table should have a primary key field. Concatenated keys: using more than one field as a primary key field. Foreign Key: Fields in a table that refer to the primary key in another table The data in this field must exactly match data contained in the primary key field. 9/19/07 4© 2007 Instructional Services at KU Libraries, The University of Kansas
  3. 3. www.lib.ku.edu/instruction What is Normalization? The process by which we efficiently organize data to achieve these goals: Eliminating redundancy Ensuring data is stored in the correct table Eliminating need for restructuring database when data is added. Five levels of normal form In order to achieve one level of normal form, each previous level must be met Third normal form is sufficient for most typical database applications. 9/19/07 5 First Normal Form (1NF) There are no repeating or duplicate fields. Each cell contains only a single value. Each record is unique. Identified by primary key 9/19/07 6© 2007 Instructional Services at KU Libraries, The University of Kansas
  4. 4. www.lib.ku.edu/instruction Example item colors price tax T-shirt red, blue 12.00 0.60 polo red, yellow 12.00 0.60 T-shirt red, blue 12.00 0.60 sweatshirt blue, black 25.00 1.25 Table is not in first normal form because: Multiple items in color field Duplicate records / no primary key 9/19/07 7 Example item color price tax T-shirt red 12.00 0.60 T-shirt blue 12.00 0.60 polo red 12.00 0.60 polo yellow 12.00 0.60 sweatshirt blue 25.00 1.25 sweatshirt black 25.00 1.25 Table is now in first normal form. 9/19/07 8© 2007 Instructional Services at KU Libraries, The University of Kansas
  5. 5. www.lib.ku.edu/instruction Second Normal Form (2NF) All non-key fields depend on all components of the primary key. Guaranteed when primary key is a single field. 9/19/07 9 Example item color price tax T-shirt red 12.00 0.60 T-shirt blue 12.00 0.60 polo red 12.00 0.60 polo yellow 12.00 0.60 sweatshirt blue 25.00 1.25 sweatshirt black 25.00 1.25 Table is not in second normal form because: price and tax depend on item, but not color 9/19/07 10© 2007 Instructional Services at KU Libraries, The University of Kansas
  6. 6. www.lib.ku.edu/instruction Example item color item price tax T-shirt red T-shirt 12.00 0.60 T-shirt blue polo 12.00 0.60 polo red sweatshirt 25.00 1.25 polo yellow sweatshirt blue sweatshirt black Tables are now in second normal form. 9/19/07 11 Third Normal Form (3NF) No non-key field depends upon another. All non-key fields depend only on the primary key. 9/19/07 12© 2007 Instructional Services at KU Libraries, The University of Kansas
  7. 7. www.lib.ku.edu/instruction Example item color item price tax T-shirt red T-shirt 12.00 0.60 T-shirt blue polo 12.00 0.60 polo red sweatshirt 25.00 1.25 polo yellow sweatshirt blue sweatshirt black Tables are not in third normal form because: tax depends on price, not item 9/19/07 13 Example item color item price T-shirt red T-shirt 12.00 T-shirt blue polo 12.00 polo red sweatshirt 25.00 polo yellow sweatshirt blue price tax sweatshirt black 12.00 0.60 25.00 1.25 Tables are now in third normal form. 9/19/07 14© 2007 Instructional Services at KU Libraries, The University of Kansas
  8. 8. www.lib.ku.edu/instruction Another Example Name Assignment 1 Assignment 2 Jeff Smith Article Summary Poetry Analysis Nancy Jones Article Summary Reaction Paper Jane Scott Article Summary Poetry Analysis Table is not in first normal form because: Assignment field repeating First and last name in one field No (guaranteed unique) primary key field 9/19/07 15 Another Example Assignment ID Description 1 Article Summary Assignment ID Student ID 2 Poetry Analysis 1 1 3 Reaction Paper 1 2 1 3 2 1 Student ID First Name Last Name 2 3 1 Jeff Smith 3 2 2 Nancy Jones 3 Jane Scott Tables are in third normal form. 9/19/07 16© 2007 Instructional Services at KU Libraries, The University of Kansas
  9. 9. www.lib.ku.edu/instruction Relationships Relationships are created between tables using the primary key field and a foreign key field One to One Relationship One record in a table relates to one record in another table One to Many Relationship One record in a table can relate to many records in another table Many to Many Relationship Many records in one table can relate to many records in another table 9/19/07 17 Relationships in First Example item color item price T-shirt red T-shirt 12.00 T-shirt blue polo 12.00 polo red sweatshirt 25.00 polo yellow sweatshirt blue sweatshirt black price tax one to one 12.00 0.60 one to many 25.00 1.25 9/19/07 18© 2007 Instructional Services at KU Libraries, The University of Kansas
  10. 10. www.lib.ku.edu/instruction Relationships in Second Example Assignment ID Description 1 Article Summary Assignment ID Student ID 2 Poetry Analysis 1 1 3 Reaction Paper 1 2 1 3 2 1 2 3 Student ID First Name Last Name 3 2 1 Jeff Smith one to one 2 Nancy Jones one to many 3 Jane Scott many to many 9/19/07 19 Bibliography Hernandez, Michael J. Database Design for Mere Mortals. San Francisco: Addison-Wesley, 1997. Chapple, Mike. “ Database Normalization Basics.” 5 August 2001. Online. Internet. Available http://databases.about.com/library/weekly/aa080501a.htm Association for Geographic Information. GIS Dictionary. 1999. Online. Internet. Available http://www.geo.ed.ac.uk/agidexe/term?821 Wise, Barry. “Database Normalization and Design Techniques.” 1 August 2000. 6 pp. Online. Internet. Available http://www.phpbuilder.com/columns/barry20000731.php3 9/19/07 20© 2007 Instructional Services at KU Libraries, The University of Kansas
  11. 11. www.lib.ku.edu/instruction Further Reading Harrington, Jan L. Relational Database Design Clearly Explained. San Diego: Academic Express, 1998. Chapple, Mike. “Choosing a Database Product.” 6 May 2001. Online. Internet. Available http://databases.about.com/library/weekly/aa050601a.htm Gilmore, W.J. “Introduction to Database Normalization.” 27 November 2000. Online. Internet. Available http://www.devshed.com/Server_Side/MySQL/Normal/Normal 1/page1.html 9/19/07 21© 2007 Instructional Services at KU Libraries, The University of Kansas

×