Database Design Why do we need it? Consider issues such as:

Slides:



Advertisements
Similar presentations
Why Object-Oriented DBMS? Abstract data types Interface with host programming language (the impedance mismatch). Object identity: (peter, 40, {(john, 15,
Advertisements

Information Systems Chapter 4 Relational Databases Modelling.
ODMG Standard: Object Model1 OBJECT-ORIENTED DATABASE SYSTEMS ODMG Standard: Object Model Susan D. Urban and Suzanne W. Dietrich Department of Computer.
1 Lecture 04 Entity/Relationship Modelling. 2 Outline E/R model (Chapter 5) From E/R diagrams to relational schemas (Chapter 5) Constraints in SQL (Chapter.
Lecture #2 October 5 th, 2000 Conceptual Modeling Administration: –HW1 available –Details on projects –Exam date –XML comment.
Programs with SQL Host language + Embedded SQL Preprocessor Host Language + function calls Host language compiler Host language program Preprocessor Host.
1 Lecture 3: Database Modeling (continued) April 5, 2002.
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,
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Database Management Systems CSE 594 Lecture #1 April 4 th, 2002.
1 Announcements Research Paper due Monday November 22.
Databases Illuminated Chapter 7 The Object-Oriented Model.
Lecture 9: Conceptual Database Design January 27 th, 2003.
Multiplicity in E/R Diagrams
The Relational Data Model Database Model (ODL, E/R) Relational Schema Physical storage ODL definitions Diagrams (E/R) Tables: row names: attributes rows:
Database Design April 3, Projects, More Details Goal: build a DB application. (almost) anything goes. Groups of 3-4. End of week 2: groups formed.
Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with.
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
Why Object-Oriented DBMS? Abstract data types (relational data model is too simple). Interface with host programming language Managing large number of.
Chapter 21 A Object Data Model - Intro Copyright © 2004 Pearson Education, Inc.
CS411 Database Systems Kazuhiro Minami 02: The Entity-Relationship Model.
Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 2: Representing Information with Data Models The lecture notes.
Lecture 2: E/R Diagrams and the Relational Model Thursday, January 4, 2001.
Database Management COP4540, SCS, FIU Database Modeling A Introduction to object definition language (ODL)
Object Definition Language
Conceptual Database Design. Building an Application with a DBMS Requirements modeling (conceptual, pictures) –Decide what entities should be part of the.
Object Definition Language
1 Introduction to Database Systems CSE 444 Lecture 07 E/R Diagrams October 10, 2007.
Tallahassee, Florida, 2015 COP4710 Database Systems E-R Model Fall 2015.
CSE 6331 © Leonidas Fegaras OODB1 Object-Oriented Databases and the ODMG Standard.
Database Design Why do we need it? – Agree on structure of the database before deciding on a particular implementation. Consider issues such as: –What.
Data Modelling Using Entity-Relationship (ER) Model
1 The Entity- Relationship Model Instructor: Mohamed Eltabakh
COMP 430 Intro. to Database Systems Entity-Relationship Diagram Basics Slides use ideas from Chris Ré.
Modeling Constraints Extracting constraints is what modeling is all about. But how do we express them? Examples: Keys: social security number uniquely.
Conceptual Modelling The Entity-Relationship (ER) Model The ER diagram Data Modelling.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 16 July 26,2012 Data Modeling using the Entity Relationship.
The Relational Data Model Database Model (ODL, E/R) Relational Schema Physical storage ODL definitions Diagrams (E/R) Tables: row names: attributes rows:
Why Object-Oriented DBMS?
Object-Oriented Databases and the ODMG Standard
Lecture 5: Conceptual Database Design
Modeling Constraints Extracting constraints is what modeling is all about. But how do we express them? Examples: Keys: social security number uniquely.
COP4710 Database Systems E-R Model.
(Ref: ODMG2.0, R Cattell et al, Morgan Kaufmann, 1997)
Database Design Oct. 3, 2001.
OBJECTS & DATABASES Arnaud Sahuguet – CIS-550.
Lecture 4 Lecture 4: The E/R Model.
02: ER Model Ch 4.1 – 4.4 Optionally, begin with Ch 2.1.
Conceptual Database Design
Chapter 12 Outline Overview of Object Database Concepts
The Entity-Relationship Model
Lecture 4: Database Modeling (continued)
Cse 344 May 11th – Entities.
ISC321 Database Systems I Chapter 10: Object and Object-Relational Databases: Concepts, Models, Languages, and Standards Spring 2015 Dr. Abdullah Almutairi.
Lecture 06 Data Modeling: E/R Diagrams
CSE544 Lecture 1: Introduction
name category name price makes Company Product stockprice buys employs
Object Definition Language
Functional Dependencies
CMPT 354: Database System I
Lecture 8: The E/R Model I
Lecture 9: The E/R Model II
Functional Dependencies
Lecture 5: The Relational Data Model
Functional Dependencies
Lecture 06: SQL Monday, October 11, 2004.
CS4433 Database Systems E-R Model.
Chapter 15: Object-Oriented Database Development
Syllabus Introduction Website Management Systems
CSC Database Management Systems
Presentation transcript:

Database Design Why do we need it? Consider issues such as: Agree on structure of the database before deciding on a particular implementation. Consider issues such as: What entities to model How entities are related What constraints exist in the domain How to achieve good designs

Database Design Formalisms Object Definition Language (ODL): Closer in spirit to object-oriented models Entity/Relationship model (E/R): More relational in nature. Both can be translated (semi-automatically) to relational schemas (with varying amount of pain). ODL to OO-schema: direct transformation (C++ or Smalltalk based system).

Object Definition Language Is part of ODMG, which also gave us OQL. Resembles C++ (and Smalltalk). Basic design paradigm in ODL: Model objects and their properties. For abstraction purposes: Group objects into classes. What qualifies as a good class? Objects should have common properties.

ODL Class Declarations Interface <name> { attributes: <type> <name>; relationships <range type> <name>; methods } Method example: float gpa(in: Student) raises (noGrades) Arbitrary function can compute the value of gpa, based on a student object given as input.

ODL Example category price Product name Company Person name stockprice address ssn

ODL Declarations Interface Product { attribute string name; attribute float price; attribute enum Categories {electronics, communications, sports …} category } Interface Company { attribute string name; attribute float stockprice; Interface Person { attribute integer ssn; attribute string name; attribute Struct Address {string street, string city} address; }

ODL Example Extended category price Product name madeBy buys Company Person name worksFor stockprice name address ssn

ODL Declarations, Extended Interface Product { attribute string name; attribute float price; attribute enum Categories {electronics, communications, sports …} category; relationship <Company> madeBy; } Interface Person { attribute integer ssn; attribute string name; attribute Struct Address {string street, string city} address; relationship set <Product> buys; relationship set <Company> worksFor;}

ODL Example, Extended Again category price Product name madeBy makes buys Company employs Person name worksFor stockprice name address ssn

ODL Declarations, Extended Again Interface Company { attribute string name; attribute float stockprice; relationship set <Product> makes inverse Product::madeBy; relationship set <Person> employs inverse Person::worksFor; }

Types in ODL Basic types: Atomic types (e.g., string, integer, …) Interface types (e.g., Person, Product, Company) Constructors: Set: (1, 5, 6) Bag: (1, 1, 5, 6, 6 ) List: (1, 5, 6, 1, 6 ) Array: Integer[17] Struct: {string street, string city, integer zipcode}

Allowable Types in ODL For attributes: start with atomic or struct, and apply a collection type. OK: string, set of integer, bag of Address. Not OK: Product, set of set of integer. For relationships: start with interface type and apply a collection type. OK: Product, set of Product, list of Person. Not OK: struct {pname Product, cname Company} set of bag of Product integer

Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with classes (I.e., first class citizens) - not necessarily binary Product address buys

name category name price makes Company Product stockprice buys employs Person name ssn address

Multi-way Relationships How do we model a purchase relationship between buyers, products and stores? Product Purchase Store Person

Roles in Relationships What if we need an entity set twice in one relationship? Product Purchase Store buyer salesperson Person

Roles in Relationships Note the multiplicity of the relationships: we cannot express all possibilities Product Purchase Store buyer salesperson Person

Attributes on Relationships date Product Purchase Store Person

Design Principles What’s wrong? Purchase Product Person President Country Person Moral: be faithful!

What’s Wrong? date Product Purchase Store Moral: don’t talk too much. personAddr person

What’s Wrong? date Dates Product Purchase Store Moral: don’t complicate life more than it already is. Person

Do we really need 3-way relationships? ProductOf Product Purchase StoreOf Store Moral: Find a nice way to say things. BuyerOf Person