IST 220 – Intro to Databases Lecture 3 Database Design Guidelines.

Slides:



Advertisements
Similar presentations
Data Modeling. What are you keeping track of? You begin to develop a database by deciding what you are going to keep track of. Each thing that you are.
Advertisements

Chapter 10: Designing Databases
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
GCSE Computing#BristolMet Session Objectives# 21 MUST describe methods of validating data as it is input. SHOULD explain the use of key fields to connect.
Computer Concepts 5th Edition Parsons/Oja Page 492 CHAPTER 10 File And Database Concepts Section A PARSONS/OJA Databases.
1 Basic DB Terms Data: Meaningful facts, text, graphics, images, sound, video segments –A collection of individual responses from a marketing research.
Concepts of Database Management Sixth Edition
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.
RELATIONSHIP  THE WAY TABLES ARE RELATED  A TABLE MUST PARTICIPATE IN AT LEAST ONE RELATIONSHIP  IN A BINARY RELATIONSHIP TWO ENTITIES PARTICIPATE 
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
C Computer-Based Systems for Management Support Kevin Brabazon D atabases : Fundamentals.
Databases and Database Management Systems
Database Design Concepts Info1408
Creating a Database in Access Creating a database involves 1.Logical design of tables and relationships 2.Physical design of tables and relationships 3.Populating.
Case study Lisa’s Bookstore IST210.
Data at the Core of the Enterprise. Objectives  Define of database systems  Introduce data modeling and SQL  Discuss emerging requirements of database.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
IST Databases and DBMSs Todd S. Bacastow January 2005.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Data at the Core of the Enterprise. Objectives  Define of database systems.  Introduce data modeling and SQL.  Discuss emerging requirements of database.
Concepts of Database Management Seventh Edition
Relational Database Concepts. Let’s start with a simple example of a database application Assume that you want to keep track of your clients’ names, addresses,
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.
Concepts of Database Management, Fifth Edition Chapter 1: Introduction to Database Management.
Database Management Concepts for Environmental Engineering.
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
Fundamentals of Relational Database Yong Choi School of Business CSUB, Bakersfield.
1 A Guide to MySQL 2 Database Design Fundamentals.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
SQL Structured Query Language Programming Course.
Relational Databases (MS Access)
Copyright © 2005 Ed Lance Fundamentals of Relational Database Design By Ed Lance.
1 A Guide to MySQL 2 Database Design Fundamentals.
Entity-Relationship Model. Entity-Relationship Mode What is it? What is it? –Technique for developing an informal organization of tables How does it work?
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Introduction to SQL. SQL What is SQL SQL Components Syntax & Conventions SQL Data Types INNER JOIN SELECT Statements.
IST 220 – Intro to Databases Analyzing Data Needs.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Entity – Relationship Model (E-R Model)
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 2 BACKNEXTEND 2-1 LINKS TO OBJECTIVES Creating Related Tables Creating Related Tables Determining.
Introduction to Database using Microsoft Access 2013 Part 7 November 19, 2014.
1 The Information School of the University of Washington Dec 1fit advdatabases © 2006 University of Washington Advanced Database Concepts INFO/CSE.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
Database Design. The process of developing database structures from user requirements for data a structured methodology Structured Methodology - a number.
Relational Database. I. Relational Database 1. Introduction 2. Database Models 3. Relational Database 4. Entity-Relationship Models 5. RDB Design Principles.
Zhangxi Lin Texas Tech University ISQS 6347, Data & Text Mining 1 ISQS 6339 Data Management and Business Intelligence Database Review.
Principles of Database Design, Conclusions MBAA 609 R. Nakatsu.
INTRODUCTION lecture1 1. Data base concept Data is a meaningless static value. What does 3421 means? Information is the data you process in a manner that.
Concepts of Database Management Seventh Edition Chapter 1 Introduction to Database Management.
Information Systems Today: Managing in the Digital World TB3-1 3 Technology Briefing Database Management “Modern organizations are said to be drowning.
Access Lessons 1, 2 and 3 ©2009 M and K Solutions, LLC – All Rights Reserved.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
Normalisation RELATIONAL DATABASES.  Last week we looked at elements of designing a database and the generation of an ERD  As part of the design and.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
Howard Paul. Sequential Access Index Files and Data File Random Access.
IST 220 – Intro to DB Lecture 4 Database Design thru ER Modeling.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
Copyright © it’sLearning 365. All rights reserved. DATABASE CONCEPTS Understanding Databases Start …
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Lesson 10 Databases.
A Guide to SQL, Eighth Edition
Introduction to MS Access: creating tables, keys, and relationships
INFO/CSE 100, Spring 2005 Fluency in Information Technology
ITM 520 Database Management Sanjay Goel
Advanced Database Concepts: Reports & Views
Presentation transcript:

IST 220 – Intro to Databases Lecture 3 Database Design Guidelines

Recap – Database & DBMS A database is a collection of related data A DBMS is a system that is designed for two main purposes To add, delete, and update the data in the database To provide various ways to view (on the screen or in print) the data in the database In a relational database, data is stored in a number of tables

A Sample Application – A Library

DB In A Flat File Problems for DB’s with one BIG table Unnecessary repetition (or redundancy) Name and phone number of the Big House publishers repeated six times Data about different real-world entities is messed up all together Hard to maintain and manipulate The library table contains information about Books Authors Publishers Book-author (relationship)

DB In Related Tables A solution is to break the big table down to a number of tables (decomposition) BOOKS – 1 record for each of the 14 books AUTHORS – 1 record for each of the 13 authors PUBLISHERS – only three publishers! BOOK_AUTHOR Some authors have published more than one book Some books are co-authored by more than one person

Tables For The Three Entities PubIDPubNamePubNumber 1Big House Alpha Press Small House AuIDAuNameAuPhone 1Austen Grumpy Homer Jones Joyce Melville Mill Roman Shakespeare Sleepy Smith Snoopy Spenser ISBNTitlePubIDPrice Macbeth2$ Faerie Queene1$ Emma1$ Hamlet2$ Main Street3$ Visual Basic1$ On Liberty1$ Iliad1$ C++1$ Balloon3$ Ulysses2$ King Lear2$ Jane Eyre3$ Moby-Dick3$49.00

The Table For The Relationship ISBNAuID One book with three co-authors One author with three books

Complications Of RDB Design Avoiding data loss during decomposition Each attribute should be included in at least one table Maintaining relational integrity Defining and implementing relationship between tables correctly Some attributes will show up in more than one tables

Complications Of RDB Design Creating views Gathering data from more than one table when needed Example Display a list of all publishers that publish books priced under $20.00 – need to access BOOKS and PUBLISHERS tables

Entity & Entity Set Entities: real-world objects or concepts Entity set: a set of entities sharing the same properties (or attributes) Examples Entity sets: books, authors, publishers Attributes: author id ( AuID ), author name ( AuName ), and author phone ( AuPhone ) Entities: Austen, Grumpy, Homer, etc

Relationship & Relationship Set Relationship – an association among entities Relationship set – a set of relationships of the same type Example Relationship set: book-author Relationship: Macbeth-Shakespeare, Iliad- Homer

Relationship Among Tables PubIDPubNamePubNumber AuIDAuNameAuPhone ISBNTitlePubIDPrice ISBNAuID BOOKS PUBLISHERS AUTHORS BOOK-AUTHOR

An Example Macbeth2$ Shakespeare Alpha Press AUTHORS BOOK-AUTHOR BOOKS PUBLISHERS

DB Design Rules – I Compound attributes An attribute which is made up by a few parts Examples Name = first-name + last-name Address = st number, st name, city, state, zip Rule 1: Field Uniqueness Avoid using compound attributes Instead, use a number of attributes, each for one of those parts

DB Design Rules – II Primary key A primary key is one or more attributes which can uniquely identify records in a table Examples ISBN in the BOOKS table ISBN and AuID in the BOOK-AUTHOR table Rule 2: Primary Keys Each table should have a primary key (PK)

Foreign Keys An attribute is referred as a foreign key (FK) if it is used as a primary key in another table Example: PubID in the BOOKS table – FK PubID in the PUBLISHERS table – PK FK’s are critical in linking the tables together An attribute can be a foreign key and a part of the primary key at the same time

PK & FK

Cardinality Constraints PubIDPubNamePubNumber AuIDAuNameAuPhone ISBNTitlePubIDPrice ISBNAuID BOOKS PUBLISHERS AUTHORS BOOK-AUTHOR 1 n 1 1 n n

DB Design Rules – III Functional dependence A property that each attribute in a table is determined by the PK Satisfy: a book name is known for a given ISBN Violate: in the flat table, a publisher’s phone may change regardless what the ISBN is Rule 3: Functional Dependence For each unique PK value, other attributes must be relevant to, and must completely describe the subject of the table

DB Design Rules – IV Rule 4: Field Independence You must be able to make a change to the data in any field (other than a field in the PK) without affecting the data in any other field Example In the flat table, if you’ve mistaken the publisher for the book ( Iliad ). When you want to change the publisher id, you have to change the associated name and phone attributes as well.