Jose M. Peña jose.m.pena@liu.se Database technology Lecture 1: Introduction Lecture 3: Enhanced entity-relationship (EER) modelling Jose M. Peña jose.m.pena@liu.se.

Slides:



Advertisements
Similar presentations
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Advertisements

Systems Development Life Cycle
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2004 Pearson Education, Inc.. Chapter 1 Introduction and Conceptual Modeling.
Copyright © 2004 Pearson Education, Inc.. Chapter 1 Database Concepts.
Databases and Database Users
Modeling & Designing the Database
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1.
CSC 351 FUNDAMENTALS OF DATABASE SYSTEMS
Introduction and Conceptual Modeling
Chapter 1 Database and Database Users Dr. Bernard Chen Ph.D. University of Central Arkansas.
Lecture1: Principles of Databases Prepared by L. Nouf Almujally 1 Ref. Chapter1.
Chapter 1 Database and Database Users Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1 Outline Types of Databases and Database Applications Basic Definitions Typical DBMS Functionality.
Introduction to Data bases concepts
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Jose M. Peña TDDD12 Databasteknik TDDD46 Databasteknik TDDB77 Databaser och bioinformatik Fö 1: Enhanced Entity-Relationship (EER)
Copyright © 2004 Pearson Education, Inc. Chapter 1 Introduction.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1 Chapter 1 - Introduction: Databases and Database Users - Outline Types of Databases and.
Data Modeling Using the Entity-Relationship Model
Data Modeling Using the Entity-Relationship Model
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Database and Database Users. Outline Database Introduction An Example Characteristics of the Database Actors on the Scene Advantages of using the DBMS.
1 CSBP430 – Database Systems Chapter 1: Databases and Database Users Mamoun Awad College of Information Technology United Arab Emirates University
Introduction: Databases and Database Users
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 1 Introduction: Databases and Database Users.
Slide Chapter 1 Introduction: Databases and Database Users.
1Mr.Mohammed Abu Roqyah. Introduction and Conceptual Modeling 2Mr.Mohammed Abu Roqyah.
Copyright © 2004 Pearson Education, Inc. Chapter 1 Introduction and Conceptual Modeling.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1.
SQL Structured Query Language Programming Course.
Chapter(1) Introduction and conceptual modeling. Basic definitions Data : know facts that can be recorded and have an implicit. Database: a collection.
CS370 Spring 2007 CS 370 Database Systems Lecture 4 Introduction to Database Design.
FEN Introduction to the database field:  Applications, concepts and terminology Seminar: Introduction to relational databases.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Databases and Database Users.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Copyright © 2004 Pearson Education, Inc. METU Department of Computer Eng Ceng 302 Introduction to DBMS Introduction and Conceptual Modeling by Pinar Senkul.
1-1 Chapter 1 Databases and Database Users 1.1 Introduction 1.2 An Example 1.3 Characteristics of the Database Approach 1.4 Actors on the Scene 1.5 Workers.
DatabaseCSIE NUK1 Fundamentals of Database Systems Chapter 1 Database and Database Users.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Databases and Database Users.
Data Modelling Using Entity-Relationship (ER) Model
Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1 Copyright © 2011 Pearson Education, Inc. Publishing as Pearson.
An Introduction to Database Systems دانشگاه علم و فناوری مازندران - طراحی و ایجاد بانک های اطلاعاتی 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1.
ISC321 Database Systems I Chapter 1: Introduction to Databases Fall 2015 Dr. Abdullah Almutairi.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 1 Introduction: Databases and Database Users.
Copyright © 2004 Pearson Education, Inc. Chapter 1 Introduction and Conceptual Modeling.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1.
Slide Chapter 1 Introduction: Databases and Database Users.
Introduction: Databases and Database Systems Lecture # 1 June 19,2012 National University of Computer and Emerging Sciences.
10/3/2017.
Chapter 1 Database and Database Users
CS4222 Principles of Database System
DBMS Lec-1: Advanced relational data modeling
Outline Types of Databases and Database Applications Basic Definitions
Introduction: Databases and Database Users
7/4/2018.
بسم الله الرحمن الرحيم.
9/22/2018.
11/14/2018.
1/2/2019.
Presentation transcript:

Jose M. Peña jose.m.pena@liu.se Database technology Lecture 1: Introduction Lecture 3: Enhanced entity-relationship (EER) modelling Jose M. Peña jose.m.pena@liu.se JMP

Database applications Traditional applications: Numeric and textual databases More recent applications: Bioinformatics Multimedia databases Geographic information systems (GIS) Data warehouses Real-time and active databases Many other applications

What is a database? A database represents some aspect of the real world, i.e. a mini world. A database consists of a logical coherent collection of data with an underlying meaning. A database is designed, built and filled with data with respect to an underlying purpose.

Example of a database Mini-world for the example: Part of a UNIVERSITY environment. Some mini-world entities: STUDENTs COURSEs SECTIONs (of COURSEs) (academic) DEPARTMENTs INSTRUCTORs Some mini-world relationships: SECTIONs are of specific COURSEs. STUDENTs take SECTIONs. COURSEs have prerequisite COURSEs. INSTRUCTORs teach SECTIONs. COURSEs are offered by DEPARTMENTs. STUDENTs major in DEPARTMENTs.

Example of a database

Basic definitions Database: Data: Mini-world: A collection of related data. Data: Known facts that can be recorded and have an implicit meaning. Mini-world: Some part of the real world about which data is stored in a database. For example, student grades and transcripts at a university. Database management system (DBMS): A software package/ system to facilitate the creation and maintenance of a computerized database. Database system: The DBMS software together with the data itself. Sometimes, the applications are also included.

Database system environment

Typical DBMS functionality Define a particular database in terms of its data types, structures, and constraints. Construct or load the initial database contents on a secondary storage medium. Manipulate the database: Retrieval: Querying, generating reports. Modification: Insertions, deletions and updates to its content. Accessing the database through web applications. Process and share by a set of concurrent users and application programs – yet, keeping all data valid and consistent.

Main characteristics of the database approach Self-describing nature of a database system: A DBMS catalog stores the description of a particular database (e.g. data structures, types, and constraints). The description is called meta-data. This allows the DBMS software to work with different database applications. Insulation between programs and data: Called program-data independence. Allows changing data structures and storage organization without having to change the DBMS access programs. Data abstraction: A data model is used to hide storage details and present the users with a conceptual view of the database. Programs refer to the data model constructs rather than data storage details. Support of multiple views of the data: Each user may see a different view of the database, which describes only the data of interest to that user.

Database design process Two main activities: Database design. Applications design. Focus in this course on database design. To design the conceptual, logical and physical model for a database application. Applications design focuses on the programs and interfaces that access the database. Generally considered part of software engineering.

Database design process

Course goals Understand the important concepts within databases and database terminology. Design a database for a given application. EER-modelling. Design and use a relational database. Concept of relations. Use MySQL. Decipher a new relational database system. Theoretical foundations behind relational databases. Normalization. Understand how the database is stored on the computer. Basic technology, file structures, indexing, etc. Impact on database performance. B-trees, hashing, etc. Understand how databases can support multiple users. What problems occur. Views. Transactions. Serialisation. Understand how persistency can be guaranteed. Recovery.

Overview Real world Model Query Answer Database Physical database DBMS Processing of queries and updates Access to stored data 13 JMP

Entity-relationship (ER) model High-level conceptual data model. An overview of the database. Easy to discuss with non-database experts. Easy to translate to data model of DBMS. ER diagram. 14 JMP

Entity and entity type Entity: A ”thing” in the real world with an independent existence. Attributes: Properties that describes an entity. Entity type: A collection of entities that have the same set of attributes. Car RegNumber Model Year Owner PersonalNumber Name 15 JMP

Attributes Simple vs. composite. Single-valued vs. multivalued. Stored vs. derived. Owner PersonalNumber Name Age Address City Street PhoneNumber 16 JMP

Constraints on attributes Value sets (domains) of attributes. Key attributes. Owner PersonalNumber Name Age Address City Street PhoneNumber 17 JMP

Relationship type Relationship type: Association among entity types. Car RegNumber Model Year N Owner PersonalNumber Name 1 owns 18 JMP

Constraints on relationship types Cardinality ratio: Maximum number of relationships an entity can participate in. Possible cardinality ratio: 1:1, 1: N, N:1, and N:M Owner Car owns 1 N M 19 JMP

Constraints on relationship types Participant constraint. Total participation: Every entity participates in at least one relationship with another entity. Owner Car owns N M ”Every car must be owned by at least one owner.” PersonalNumber RegNumber 20 JMP

Constraints on relationship types Weak entity types: They do not have key attibutes of their own. A weak entity can be identified uniquely by being related to another entity (together with its own attributes). name Name players N number 1 Plays_on team 21 JMP

Attributes of relationship types ”Store information on who owned which car and during which period of time” SellDate BuyDate Model Name RegNumber Year PersonalNumber N M owns Owner Car 22 JMP

N-ary relationships Example. A person works as an engineer at one company and as a gym instructor at another company. Company Employee JobType Company works as N M K Ternary N works at M Employee N works as M JobType 23 JMP

ER Notation R E1 E2 R E1 E2 JMP Symbol Meaning ENTITY TYPE WEAK ENTITY TYPE RELATIONSHIP TYPE IDENTIFYING RELATIONSHIP TYPE ATTRIBUTE KEY ATTRIBUTE MULTIVALUED ATTRIBUTE COMPOSITE ATTRIBUTE DERIVED ATTRIBUTE TOTAL PARTICIPATION OF E2 IN R CARDINALITY RATIO 1:N FOR E1:E2 IN R R E1 E2 1 R N E1 E2 24 JMP

Enhanced ER (EER) model Why more? To comply with more complex data requirements. Example. Only some employees can use a company car, only managers have to write a monthly report, but all employees have assigned personal number, salary account and a place in the office. Subclass/superclass, specialization/generalization, union/category, and attribute and relationship inheritance. 25 JMP

Subclass/superclass specialization generalization process of defining classes Surname FirstName PN Name Employee d o U U U U Commission Salesman Engineer Manager ProjectLeader 1 1 uses writes 1 N Car MonthlyReport RegNumber 26 ReportID JMP

Single vs. multiple inheritance Surname FirstName PN Name Employee d o Dedication U U U U Salesman Engineer Manager ProjectLeader Commission SoftwareProject PID Software ProjectLeader U manages N 1 Category 27 JMP

Union/category A UNION subclass represents a collection of entities that is a subset of the UNION of the entities of the superclasses. CNumber Address PersonalNumber Person Company “An owner of a car is either a person or a company.” BirthDate u U 1 N Owner owns Car 28 JMP

Example A taxi company needs to model their activities. There are two types of employees in the company: drivers and operators. For drivers it is interesting to know the date of issue and type of the driving license, and the date of issue of the taxi driver’s certificate. For all employees it is interesting to know their personal number, address and the available phone numbers. The company owns a number of cars. For each car there is a need to know its type, year of manufacturing, number of places in the car and date of the last service. The company wants to have a record of car trips (körningar). A taxi may be picked on a street or ordered through an operator who assigns the order to a certain driver and a car. Departure and destination addresses together with times should also be recorded. 29 JMP

Employee U U Driver Operator 1 1 N N Trip N 1 Car drives assign Street PN Address Phone PostNumber Town Employee o TaxiCertifDate U U DrivingLicenseDate DrivingLicenseDate Driver Operator 1 1 DrivingLicenseType DrivingLicenseType drives assign N Type DepTime N Trip YearOfManuf DeparturePlace RegNumber ServiceDate Destination DestTime N Places made_by 1 Car ID 30 JMP

Driver N 1 Körkort Driver N M Driver belongsTo belongsTo TaxiCertifDate A driver may have many driving licenses (types) DrivingLicenseDate Driver DrivingLicenseType Date Type Id TaxiCertifDate N belongsTo 1 Körkort belongsTo DrivingLicense Driver TaxiCertifDate Type DrivingLicense N belongsTo M Driver Date 31 JMP

Summary Entity-relationship (ER) model: A graphical way to model the world. Main concepts: Entity type, relationship type, and attributes. Different types of constraints. Enhanced ER model. 32 JMP