Class 9: Database Management Systems July 21 st, 2011.

Slides:



Advertisements
Similar presentations
ER Model For a college DB
Advertisements

Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
L ECTURE 11 – D ATA M ODELLING Data Dictionaries Entity Relationship Diagram for Data Modelling Steps to Construct Entity Relationship Diagrams Validation.
Database Design & Mapping
1 Class Agenda – 09/20/2011  Answer questions about exam  Evaluate database design homework  Review database design homework for syntax and logic 
Entity-Relationship Model and Diagrams (continued)
Class 8: Data Management July 20 th,  Grades are posted: _summer2011/grades/grades.htm
CSCI 242 Relational Data Modeling Copyright 2011, David C. Roberts, all rights reserved.
CSCI 6442 Entity-Relation Data Modeling Copyright 2012, David C. Roberts, all rights reserved.
WJEC Applied ICT Databases – Attributes & Entities Entities A database contains one or more related tables. Each table holds all of the information.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
Entity-Relationship Design
Database Design.  Define a table for each entity  Give the table the same name as the entity  Make the primary key the same as the identifier of the.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
Ch5: ER Diagrams - Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
Chapter 3: Modeling Data in the Organization
1. 2 Data Modeling 3 Process of creating a logical representation of the structure of the database The most important task in database development E-R.
Database Design Concepts
Module Title? DBMS E-R Model to Relational Model.
1 Class Agenda (04/09 through 04/16)  Review HW #8  Present normalization process Enhance conceptual knowledge of database design. Improve practical.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
Concepts and Terminology Introduction to Database.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
PLUG IT IN 3 Fundamentals of Relational Database Operations.
Data Models and Relational Databases Chapter 2. Learning Objectives Identify primary and foreign keys for each entity and relevant relationships in the.
Implementing an REA Model in a Relational Database
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
1 A Guide to MySQL 2 Database Design Fundamentals.
Customer Order Order Number Date Cust ID Last Name First Name State Amount Tax Rate Product 1 ID Product 1 Description Product 1 Quantity Product 2 ID.
IE 423 – Design of Decision Support Systems Data modeling and database development.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
Description and exemplification of entity-relationship modelling.
ERD ( Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes.
COMP231 Tutorial 1 ER Model and ER to Relational Schema.
In this session, you will learn to: Map an ER diagram to a table Objectives.
ENTITY RELATIONSHIP DIAGRAM ENTITY RELATIONSHIP DIAGRAM IS A SPECIALIZED GRAPHIC THAT ILLUSTRATES THE INTERRELATIONSHIPS BETWEEN ENTITIES IN A DATABASE.
Relational Theory and Design
Weak Entity Sets A weak entity is an entity that cannot exist in a database unless another type of entity also exists in that database. Weak entity meets.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
Lesson 2: Designing a Database and Creating Tables.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Entity-Relationship Diagram Presentation Gianna-lee Williams 6AQ Ms. Anderson.
1 Class Agenda (04/06/2006 and 04/11/2006)  Discuss use of Visio for ERDs  Learn concepts and ERD notation for data generalization  Introduce concepts.
Data modeling Process. Copyright © CIST 2 Definition What is data modeling? –Identify the real world data that must be stored on the database –Design.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
Logical Database Design and the Relational Model.
Database Design Slide 1 Database Design Lecture 7 part 2 Mapping ERD to Tables.
Database Design. Database Design Process Data Model Requirements Application 1 Database Requirements Application 2 Requirements Application 4 Requirements.
IE 423 – Design of Decision Support Systems Data modeling and database development.
Chapter 2: Entity-Relationship Model. 3.2 Chapter 2: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Microsoft Access 2010 Chapter 11 Database Design.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 2: MODELING DATA.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
Data Modeling and Entity-Relationship Model I
Data Resource Management Application Layer TPS A RCHITECTURE Data Layer Sales/MarketingHR Finance/Accounting Operations Spreadsheet Data MS Access Accounts.
Database Design I IST 210: Organization of Data IST2101.
Database Planning Database Design Normalization.
DATA MODELING AND ENTITY-RELATIONSHIP MODEL II IST 210: Organization of Data IST210 1.
Decision Analysis Fall Term 2015 Marymount University School of Business Administration Professor Suydam Week 10 Access Basics – Tutorial B; Introduction.
Database Design Chapters 17 and 18.
Conceptual modeling of databases
Presentation transcript:

Class 9: Database Management Systems July 21 st, 2011

 Looks great!  Google analytics… now what?  I want you to check Google analytics and see who is visiting your Web site.  At the end of the semester, we’ll see who has the most visitors!  How do I get people to my site: see SEO slides; submit to Google, yahoo.

 Visio stencil on my Web site for ER diagrams

 List a few current events in information systems news  Construct and ER diagram (Recap)  Use vLookup in excel to mimic a relational database  Convert an ER diagram to a relational database scheme

 Twinkle Tones School of Music provides private lessons only by musician request. When a musician requests a private lesson, the School finds an available instructor and arranges a lesson schedule.  The School would like to track these lessons – the day of the week when they are scheduled, as well as the time they begin.  The School would also like to track musician names and addresses, as well as instructor names and addresses.

INSTRUCTORSMusicians teach LESSONS MusID MusName Mus InsID Ins InsName TimeDay [0:M] [1:1]

TEAMS Aggregate STUDENTSTEACHERS [2:5][1:1] [0:M][1:3] TeamId TeamName StudentId Name TeacherId

 We can use the entity relationship diagrams we design to create relational tables that can be stored in a database.  NOTE: A relational database is not just a table of information. It consists of multiple tables that reference one another.

 Let’s mimic one together in Excel and vLookup  Download excel sheet from: _summer2011/example%20data.xlsx

Desktop My Documents My Network Places MIS 111CMIMy Pictures July 13.ppt Class Roster. doc

 In the 1960s, a man working for IBM decided that he could improve upon hierarchical data storage.  He knew that the hierarchical model led to data redundancy and confusion.  We always have to start at the top node. That makes looking for the data I need take forever!  Sometimes I end up with the same data saved in different places! If I need to update that data, I need to do it in multiple places!

 1 st normal form (Rule 1)  No repeating elements or groups of elements Take from

 2 nd normal form (Rule 2)  No partial dependencies on a concatenated key Take from

 3 rd normal form (Rule 3)  No dependencies on non-key attributes Take from

 ER diagrams were developed a few years after Codd  If the ER diagram was developed correctly, we are automatically in 3 rd Normal Form!!!

 We call this in general a “many-to-many” relationship because each entity class may have more than one instance.  Many-to-many = [M:N] [0:30] STUDENTSCOURSES enroll in [4:6]

 We call this in general a “one-to-many” relationship because one side may only have up to one instance and the other may have many.  One-to-Many = [1:M] COURSES TEACHERS teach [0:1] [1:3]

 We call this in general a “one-to-one” relationship because both entity classes may only have a maximum of one instance.  One-to-one = [1:1] DOCTORSPATIENTS treat [1:1]

 Remember this? STUDENTS COURSES enroll in CourseNo CourseName StudentName Student TEACHERS teach TeacherID TeacherName Teacher TeacherSalary StudentID [0:1] [1:3] [0:30] [4:6]

 1. For every strong entity class, create a table or relation.  The identifier becomes what is called a primary key.  The other attributes become what are called non-key elements.  We can represent the STUDENTS table as such: STUDENTS (StudentID, StudentName, Student )

 1. For every strong entity class, create a table or relation.  The identifier becomes what is called a primary key.  The other attributes become what are called non-key elements. COURSES (CourseNo, CourseName)

 1. For every strong entity class, create a table or relation.  The identifier becomes what is called a primary key.  The other attributes become what are called non-key elements. TEACHERS (TeacherID, TeacherName, Teacher , TeacherSalary)

 TEACHERS (TeacherID, TeacherName, Teacher , TeacherSalary)  STUDENTS (StudentID, StudentName, Student )  COURSES (CourseNo, CourseName)

StudentIDStudentNameStudent CourseNoCourseName MIS111CMP_INTRNTWKD MIS373SYSTM_ANL_DSGN MIS696ARDNGS_IN_MIS TeacherIDTeacherNameTeacher TeacherSalary

 2. Locate any [1:M] relationships between strong entity classes. STUDENTS COURSES enroll in CourseNo CourseName StudentName Student TEACHERS teach TeacherID TeacherName Teacher TeacherSalary StudentID [0:1] [1:3] [0:30] [4:6]

 2. Locate any one-to-many relationships between strong entity classes. Put the primary key on the “1” side of the relationship into the table of the “M” side. TEACHERS (TeacherID, TeacherName, Teacher , TeacherSalary) COURSES (CourseNo, CourseName, TeacherID)

 “TeacherID” is now a foreign key in the COURSES table. CourseNoCourseNameTeacherID MIS111CMP_INTRNTWKD23489 MIS373SYSTM_ANL_DSGN13445 MIS696ARDNGS_IN_MISNULL TeacherIDTeacherNameTeacher TeacherSalary

 3. Locate any many-to-many relationships. Create a completely new table to represent this relationship. Use the primary keys of the participating entity classes as a new combined primary key. We now have THREE tables instead of two. COURSES (CourseNo, CourseName, TeacherID) STUDENTS (StudentID, StudentName, Student ) STUDENTS_COURSES (StudentID, CourseID)

CourseNoCourseNameTeacherID MIS111CMP_INTRNTWKD23489 MIS373SYSTM_ANL_DSGN13445 MIS696ARDNGS_IN_MISNULL TeacherIDTeacherNameTeacher TeacherSalary StudentIDStudentNameStudent StudentIDCourseNo MIS MIS MIS111

 STUDENTS (StudentID, StudentName, Student )  TEACHERS (TeacherID, TeacherName, Teacher )  COURSES (CourseNo, CourseName, TeacherID)  STUDENTS_COURSES (StudentID, CourseNo)

PUPPIESSTORES CUSTOMERS buy sell StoreID StoreName StoreLoc PupAgeWhenSold PupBreed PupTemp PupID CustZip CustName CustGender CustID [1:1][1:M] [0:1] [1:M]

 1. For every strong entity class, create a table or relation.  2. Locate any [1:M] relationships between strong entity classes. Put the primary key on the “1” side of the relationship into the table of the “M” side.  3. Locate any [M:N] relationships. Create a completely new table to represent this relationship. Use the primary keys of the participating entity classes as a new combined primary key.

 PUPPIES (PupID, PupBreed, PupTemp, PupAgeWhenSold, StoreID, CustID)  STORES (StoreID, StoreName, StoreLoc)  CUSTOMERS (CustID, CustName, CustGender, CustZip)

StoreIDStoreNameStoreLoc 1Puppies ‘R’ USTucson 4Pup PlacePhoenix CustIDCustNameCustGenderCustZip 2XavierM MarthaF BillM85719 PupIDPupBreedPupTempPupAgeWhenSoldStoreIDCustID 3dalmatianactive8412 4beaglesweet1012 7laboradorsweet7412 8shih-tzuactive8410

INSTRUCTORSMUSICIANS teach LESSONS MusID MusName Mus InsID Ins InsName TimeDay [0:M] [1:1] MusInst

 4. Locate any one-to-one relationships between entity classes. Take the primary key from one side of the relationship and place it in the table of the other entity class. INSTRUCTORS (InsID, InsName, Ins , MusID) MUSICIANS (MusID, MusName, Mus , MusInst) INSTRUCTORS (InsID, InsName, Ins ) MUSICIANS (MusID, MusName, Mus , MusInst, InsID) OR

 5.For weak entity classes, create a new table or relation and add its attributes. Then, add the primary key from its corresponding strong entity class. Combine all attributes to create a new primary key. LESSONS (Day, Time, MusID, InsID)

 Convert this ERD into a set of relational tables. DOCTORSPATIENTS TREATMENTS treat [1:1] [0:M] DocID DocName PatName PatID Prscrpt Date

 5.For weak entity classes, create a new table or relation and add its attributes. Then, add the primary key from its corresponding strong entity class. Combine all attributes to create a new primary key. DOCTORS (DocID, DocName) PATIENTS (PatID, PatName, DocID) TREATMENTS (Date, Prscrpt, PatID, DocID)

 6. Treat aggregates just like strong entity classes. Create a table or relation.  The identifier becomes what is called a primary key.  The other attributes become what are called non-key elements.  7. Treat the aggregation as its own relationship and add foreign keys accordingly.

TEAMS Aggregate STUDENTS TEACHERS [2:5] [1:1] [0:M][1:3] TEAMS (TeamID, TeamCaptain, FormationDate, TeacherID) TEAMS_STUDENTS (StudentID, TeamID)

 Quiz  Tomorrow:  I will give you / post your assignment Paper or Visio (preferred). Stencils are on the Web site  You’ll have the rest of the class time to work on it (individual assignment). This will be due beginning of class next Wednesday.  I will be able to answer “general” questions.