CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 2 Introduction to a First Course in Database Systems.

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

the Entity-Relationship (ER) Model
1–1 Students Entity/Relationship Model Diagrams to represent designs. Entity like object, = “thing.” Entity set like class = set of “similar” entities/objects.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 6 A First Course in Database Systems.
Design Principles: Faithfulness
Weak Entity Sets. Occasionally, entities of an entity set need “help” to identify them uniquely. Example. Crews might have a number and some description,
Entity-Relationship Model. The process of designing a database begins with: –an analysis of what information the database must hold, and –the relationships.
Weak Entity Sets. Occasionally, entities of an entity set need “help” to identify them uniquely. Entity set E is weak if in order to identify entities.
Design Principles: Faithfulness
Database BA471 – Fall 2007 Dr. V.T. Raja Oregon State University.
Introduction to Database ISYS 363. File Concepts File consists of a group of records. Each record contains a group of fields. Example: Student file –SIDSnameMajorSexGPA.
Entity-Relationship Model
Introduction to Database ISYS 363. File Concepts File consists of a group of records. Each record contains a group of fields. Example: Student file –SIDSnameMajorSexGPA.
Fall 2001Arthur Keller – CS 1801–1 Computer Science 180: Database Systems Arthur M. Keller (best way to reach me) Office: Baskin.
Entity-Relationship Data Model Alex Ostrovsky. Presentation Overview ► Short historical overview ► Elements of E-R Model ► Basic organization & relationships.
The Entity-Relationship Data Model
Other Data Models. Text New edition (DBS the complete book): Chapter 4 Old edition (First course in DBS): –Section 2.1 –Section –Section 2.4.1,
1 The Entity-Relationship Data Model Chapter 2 (Database Design)
Winter 2002Arthur Keller – CS 1802–1 Schedule Today: Jan. 8 (T) u Weak Entity Sets, Entity-Relationship Design. u Read Sections Jan. 10 (TH) u.
Relational Databases What is a relational database? What would we use one for? What do they look like? How can we describe them? How can you create one?
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Chapter 3)
Entity/Relationship Modelling
What is a Database Management System? 1. Manages very large amounts of data. 2. Supports efficient access to very large amounts of data. 3. Supports concurrent.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Data Modeling Using the Entity-Relationship Model
Data Modeling Using the Entity-Relationship Model
2.3 Organising Data for Effective Retrieval
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
CS411 Database Systems Kazuhiro Minami 02: The Entity-Relationship Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Entity-Relationship Data Model N. Harika Lecturer(csc)
Concepts and Terminology Introduction to Database.
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 3 Introduction to a First Course in Database Systems.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
CS 405G: Introduction to Database Systems Lecture 2 : Database Design I.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of constraints.
Entity-Relationship Model
SAnta Clara UniversityHolliday – COEN 1782–1 Today’s Topic Today: u Constraints, Weak Entity Sets, Entity- Relationship Design. u Read Sections
Databases Illuminated Chapter 3 The Entity Relationship Model.
Home Work. Design Principles and Weak Entity Sets.
1 The Entity- Relationship Model Instructor: Mohamed Eltabakh
Lecture 03 Entity-Relationship Diagram. Chapter Outline.
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 4 Introduction to a First Course in Database Systems.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
The Entity-Relationship Model CIS 4301 Lecture Notes 1/12/2006.
Data Modeling and the Entity-Relationship Model CS 475 Lecture Notes.
Winter 2002Arthur Keller – CS 1802–1 Weak Entity Sets Sometimes an E.S. E ’s key comes not (completely) from its own attributes, but from the keys of one.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Microsoft Access 2010 Chapter 11 Database Design.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
Database -Entity-Relationship Model 2012/03/05.
High-level Database Models Prof. Yin-Fu Huang CSIE, NYUST Chapter 4.
A short revision on entity- relationship modelling.
IT 5433 LM2 ER & EER Model. Learning Objectives: Explain importance of data modeling Define and use the entity-relationship model Define E/R terms Describe.
Modeling: Entity-Relationship Diagrams
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
Outline of the ER Model By S.Saha
CSCI-100 Introduction to Computing
Database Modeling using Entity Relationship Model (E-R Model)
Presentation transcript:

CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 2 Introduction to a First Course in Database Systems

CPSC 603 Database Systems Relational Models Relational models uses a collection of tables to represent both data and relationships among those data

Controlling Redundancy Redundancy  storing the same data multiple times => leads to several problems!!! 1.Need to perform a single logical update - such as entering data on a new student - multiple times - once for each file where student data is recorded => duplication of effort 2.Storage space is wasted when same data is stored repeatedly 3.Files that represent the same data may become inconsistent

Controlling Redundancy Inconsistent => may happen because an update is applied to some of the files but not to others

Three Aspects of Studying DBMS’s Modeling and Design of Databases –Allows exploration of issues before committing to an implementation Programming:Queries and DB operations like update – SQL = “intergalactic dataspeak” DBMS implementation

Entity/Relational Model Diagrams to represent designs Entity like object,= “thing.” Entity set like class - set of “similar” entities / objects. Attribute = property of entities in an entity set, similar to fields of a struct.

Entity/Relationship Model Diagrams In Diagrams: Entity set  rectangle Attribute  oval ID Name Phone Height Students

Relationships Connect two or more entity sets (E.S.) diamondsRepresented by diamonds. Taking StudentsCourses Relationship between Students and Courses Students take Courses Relationship is taking

Relationship Sets Think of the “value” of a relationship set as a table. –One column for each of the connected entity sets –One row for each list of entities, one from each set, that are connected by the relationship

Relationship Set Students Courses SallyCPSC 310 SallyCPSC 603 JoeCPSC 420 …………………. One column for each of the connected entity sets 1) Students 2) Courses One row for each list of entities 1. (Sally,…) and 2. (CPSC 310, ….)

Multiway Relationships Binary Relationships Suffice However, there are some cases where three or more E.S. must be connected by one relationship Example: Relationship among students, courses, TA’s. Possibly, this E/R diagram shown next will be O.K.

Multiway Relationship Students, Courses, TA’s Students TakingCourses Assisting TAs

Multiway Relationships This works with CPSC 310(603), because each TA is a TA of all students. Connection student-TA is only via the course But what if students were divided into sections, each headed by a TA? –Then, a student in CPSC 310 would be related to only one of the TA’s for CPSC 310. Which one? Need a 3-way relationship to tell

Elements of the E/R Model continued (Chapter 2 of Text) Entity Types, Entity Sets,Keys, and Value Sets Entity Types and Entity Sets A database usually contains groups of entities that are similar For Example: A company employing hundreds of employees may want to store similar information concerning each of the employees.

Entity Type An Entity Type defines a collection (set) of entities that have the same attributes Each Entity Type in the database is described by its name and attributes

Key Attributes of an Entity Type An important Constraint on the entities of an entity type is the key or uniqueness constraint on attributes An entity type usually has an attribute whose vaues are distinct for each individual entity in the collection => such an attribute is called a key attribute

Key Attributes of an Entity Type For the Person Entity ==> A typical Key Attribute is SSN#

Key Attributes of an Entity Type In the ER Diagrammatic notation, each Key Attribute has its name underlined inside the Oval EMPLOYEE SSN Attribute Entity

Weak Entity Sets Sometimes an E.S. E’s key comes not (completely) from its own attributes, but from the keys of one or more E.S.’s to which E is linked by a supporting many-to-one relationship Called a weak E.S. Represented by putting a double rectangle around E and a double diamond around each supporting relationship

Weak Entity Sets Sometimes an E.S. E’s key comes not (completely) from its own attributes, but from the keys of one or more E.S.’s to which E is linked by a supporting many-to-one relationship Many-one-ness of supporting relationship (includes 1-1) essential –With many-many, we wouldn’t know which entity provided the key value. “Exactly one” also essential, or else we might not be able to extract key attributes by following the supporting relationship

Entity-Relationship Diagram A Movie Database Movies Title Year Length filmType Stars-InStars NameAddress Owns Studios Name Address

Multiway Relationships Example 2.5 Contracts In Fig. 2.4 is a relationship Contracts that involves a studio, a star, and a movie. This relationship represents that a studio has contracted with a particular star to act in a particular movie. Stars CONTRACTS Movie Studio A Three-Way relationship

Roles in Relationships-Fig. 2.5 It is possible that one entity set appears two or more times in a single relationship –If so, we draw as many lines from the relationship to the entity set as the entity appears in the relationship. Each line to the entity set represents a different role that the entity set plays in the relationship Sequel-of Movie Sequel Original

Roles in Relationships-Fig. 2.5 In Sequel-of the relationship is between the entity set Movies and itself Sequel-of Movies Original Sequel

Next Lecture Database Design Principles Modeling of Constraints Weak Entity Sets Summary of Chapter 2 Relational Data Model