Copyright © 2005 Ed Lance Fundamentals of Relational Database Design By Ed Lance.

Slides:



Advertisements
Similar presentations
Designing MS-Access Tables
Advertisements

Designing Tables in Microsoft Access By Ed Lance.
Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
Chapter 10: Designing Databases
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
The Relational Database Model:
Introduction to Databases CIS 5.2. Where would you find info about yourself stored in a computer? College Physician’s office Library Grocery Store Dentist’s.
Microsoft Access 2002 By Ian Cole Lecturer in ICT.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Database Design Overview. 2 Database DBMS File Record Field Cardinality Keys Index Pointer Referential Integrity Normalization Data Definition Language.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
Chapter 6 Data Flow Diagramming Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
Phil Brewster  One of the first steps – identify the proper data types  Decide how data (in columns) should be stored and used.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
File and Database Design SYS364. Today’s Agenda WHTSA DBMS, RDBMS, SQL A place for everything and everything in its place. Entity Relationship Diagrams.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
CHAPTER 7 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Microsoft Access Lecture -13- By lec. (Eng.) Hind Basil University of Technology Department of Materials Engineering 1.
DAY 14: ACCESS CHAPTER 1 Tazin Afrin October 03,
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
IE 423 – Design of Decision Support Systems Database development – Relationships and Queries.
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
1 A Guide to MySQL 2 Database Design Fundamentals.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
1.NET Web Forms Business Forms © 2002 by Jerry Post.
Introduction to Databases Trisha Cummings. What is a database? A database is a tool for collecting and organizing information. Databases can store information.
1 A Guide to MySQL 2 Database Design Fundamentals.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Unit 4 Object Relational Modeling. Key Concepts Object-Relational Modeling outcomes and process Relational data model Normalization Anomalies Functional.
Database collection of related information stored in an organized form Database program software tool for storage & retrieval of that information.
M1G Introduction to Database Development 4. Improving the database design.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
1 CSE 2337 Introduction to Data Management Access Book – Ch 1.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
GIS Data Models GEOG 370 Christine Erlien, Instructor.
In this session, you will learn to: Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form Appreciate.
IT The Relational DBMS Section 05. Relational Database Theory Normalization for Logical Database Design.
Lesson 2: Designing a Database and Creating Tables.
Access Chapter 1: Intro to Access Objectives Navigate among objects in Access database Difference between working in storage and memory Good database file.
Lection №4 Development of the Relational Databases.
Instructor: Pavlos Pavlikas1 How Data is Stored Chapter 8.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
Connecting (relating) Data Tables to get Custom Records (Queries) Database Basics.
Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer.
Retele de senzori Curs 2 - 1st edition UNIVERSITATEA „ TRANSILVANIA ” DIN BRAŞOV FACULTATEA DE INGINERIE ELECTRICĂ ŞI ŞTIINŢA CALCULATOARELOR.
Data Resource Management Application Layer TPS A RCHITECTURE Data Layer Sales/MarketingHR Finance/Accounting Operations Spreadsheet Data MS Access Accounts.
Database Planning Database Design Normalization.
MS Access. Most A2 projects use MS Access Has sufficient depth to support a significant project. Relational Databases. Fairly easy to develop a good user.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall. 1 Skills for Success with Microsoft ® Office 2007 PowerPoint Lecture to Accompany.
SQL Basics Review Reviewing what we’ve learned so far…….
Normalisation FORM RULES 1NF 2NF 3NF. What is normalisation of data? The process of Normalisation organises your database to: Reduce or minimise redundant.
NORMALISATION OF DATABASES. WHAT IS NORMALISATION? Normalisation is used because Databases need to avoid have redundant data, which makes it inefficient.
1 SQL SERVER 2005 Express CE-105 SPRING 2007 Engr. Faisal ur Rehman.
Understanding Data Storage
Databases Chapter 9 Asfia Rahman.
A Guide to SQL, Eighth Edition
Chapter 4 Relational Databases
Normalization Referential Integrity
Relational Database Model
Normalization Normalization theory is based on the observation that relations with certain properties are more effective in inserting, updating and deleting.
Presentation transcript:

Copyright © 2005 Ed Lance Fundamentals of Relational Database Design By Ed Lance

Copyright © 2005 Ed Lance About Me Independent Database Consultant Worked with Access since 1.0 Many years designing, developing, tuning, and developing with databases. Code with.Net platform

Copyright © 2005 Ed Lance What’s this about relationships? Relational Database is a database system that organizes data according to (more or less) the rules of relational set theory. (Codd) In a relational database, we break up data into multiple tables. These tables have ‘pointers’ (keys) in the data that relate rows in one table to rows in another. This allows us to have multiple dimensions in our data without going insane.

Copyright © 2005 Ed Lance Why do I care? Relational Database Design is important because… –It allows us to organize our data in a way that doesn’t limit the user. –It allows us to model very complex data with relative ease. –It eliminates duplicate data that is hard to maintain. –It provides us a way to search and retrieve data with an easy language and gets us out of having to write all our own data handling code.

Copyright © 2005 Ed Lance The Penalties for Not Doing It Poor database performance Can’t write queries to get data the way you want it. Lots of extra work (code) to get reports they way you want. Always doing kludges to get around the design. When the customer wants to add one more of something, it’s a design change (“I need six phone numbers instead of five.”) Updating data is a nightmare

Copyright © 2005 Ed Lance Basic Concepts KeysIndexesRelationships Normal Forms

Copyright © 2005 Ed Lance Primary Keys We need to be able to uniquely identify rows in a table. Natural key – Use one or more columns together that aren’t repeated. Identity – or Autonumber, a unique number for each row, managed by the system. PK’s help us connect data in other tables to rows in the current table.

Copyright © 2005 Ed Lance Indexes An index is a data structure used by a database engine to make searches faster. Data is generally stored in the order it was input. We want to be able to filter and order by any column (or set of columns). Indexes are defined by you, but maintained by the engine. You can index one column or a set of columns.

Copyright © 2005 Ed Lance Indexes Deciding which columns to create indexes for is a matter of judgment and skill. An index can have a huge impact (usually good) on performance of queries. Too many indexes can bog down database when modifying data. Indexes do take space on disk.

Copyright © 2005 Ed Lance Relationships We use columns in tables to contain pointers to rows in other tables. By using primary key columns, we can uniquely identify rows in a table. Then by using the value of the primary key in other tables, we can tie the tables together. Columns that contain key values from another table are called foreign keys.

Copyright © 2005 Ed Lance Relationships In order for this to work, we must be careful that we don’t end up with foreign keys that point to rows that don’t exist. This is called Referential Integrity Most database engines (inc. Access, SQL Server) can enforce this for you.

Copyright © 2005 Ed Lance Relationship Types 1 – 1 –If two tables really represent the same set of items. In other words they could be merged into one table. 1 – Many –Items in one table are related to one or more items in another table. (One library has many books.) Many – Many –Items in one table are related to one or more items in another table, but the relationship exists the other way as well. (One doctor has many patients, but each patient may have more than one doctor)

Copyright © 2005 Ed Lance Relationships Finding these relationships in your customer’s data and designing tables to correctly model them is the art of relational database design. Look for repetition in existing data. Look for ‘add-on’ fields that are used to add similar items (PhoneNumber1, PhoneNumber2)

Copyright © 2005 Ed Lance Tips for Designing Think of tables as entities (nouns). –Books, products, people, events, orders Think of relationships as verbs. –Books have authors. –Products have suppliers –Orders have order details (the set of items being ordered) Test phrases for relationship types –Suppliers have many products, but each product has only one supplier. (one-to-many)

Copyright © 2005 Ed Lance What is Normal? The process of organizing relational data can be called Normalization. Codd (and follow on people) defined criteria for increasing levels of normalization in data. In the practical world we care about the first three.

Copyright © 2005 Ed Lance Normal Forms 1NF – First Normal Form –No duplicate data in columns. This means we have to break up our data into relational tables, and establish key values. NameAddressPhone1Phone2 TitleAuthorISBN.... Codd, Lance

Copyright © 2005 Ed Lance Normal Forms NameAddressPhone1Phone2 Ed NamesIDNameAddress1Ed1234NamesIDPhoneNumber

Copyright © 2005 Ed Lance Normal Forms TitleAuthorISBN.... RDBMS Codd, Lance PubsIDName1Codd 1LancePubIDTitleISBN1RDBMS

Copyright © 2005 Ed Lance Normal Forms 2NF – Second Normal Form –Be in 1NF. –All columns must be dependent on the whole primary key, not just one part of it. Not an issue if you use Autonumber keys. Part_No (PK) Supplier_Name (PK) Price Supplier Address

Copyright © 2005 Ed Lance Normal Forms 3NF – Third Normal Form –Be in 2NF –Non-key columns should not have dependencies on each other. Part_No (PK) Mfgr. Name Mfgr. Address …

Copyright © 2005 Ed Lance Questions? The End