Fall 2001Arthur Keller – CS 1802–1 Schedule Today Sep. 25 (T) u More Entity-Relationship Model. u Read Sections 2.3-2.4. Note: Sep. 27 (TH) Class cancelled.

Slides:



Advertisements
Similar presentations
Constraints in Entity-Relationship Models Zaki Malik September 18, 2008.
Advertisements

1–1 Students Entity/Relationship Model Diagrams to represent designs. Entity like object, = “thing.” Entity set like class = set of “similar” entities/objects.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
The E-R Model CS 157A Lecture 4 Prof. Sin-Min Lee
Text-Book Chapters (7 and 8) Entity-Relationship Model
Databases : Relational Model 2007, Fall Pusan National University Ki-Joune Li These slides are made from the materials that Prof. Jeffrey D. Ullman distributes.
Chapter 4 Notes. Entity-Relationship Model E/R Diagrams Weak Entity Sets Converting E/R Diagrams to Relations.
Design Principles: Faithfulness
Design Principles: Faithfulness
From ER Diagrams to the Relational Model Rose-Hulman Institute of Technology Curt Clifton.
System Concepts and Architecture Rose-Hulman Institute of Technology Curt Clifton.
Chapter 2 Database Environment. Agenda Three-Level ANSI-SPARC Architecture Database Languages Data Models Functions of DBMS Components of DBMS Teleprocessing.
A four-way Relationship
Winter 2002Arthur Keller – CS 1801–1 Computer Science 180: Database Systems Arthur M. Keller (best way to reach me) Office: Baskin.
Fall 2001Arthur Keller – CS 1803–1 Schedule Today Oct. 2 (T) Relational Model. u Read Sections Assignment 1 due. Personal Letter of Introduction.
“DOK 322 DBMS” Y.T. Database Design Hacettepe University Department of Information Management DOK 322: Database Management Systems.
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.
CENG 352 Database Management Systems Instructor: Nihan Kesim Çiçekli URL:
Modeling & Designing the Database
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes 1.
Chapter One Overview of Database Objectives: -Introduction -DBMS architecture -Definitions -Data models -DB lifecycle.
CS411 Database Systems Kazuhiro Minami
IST Databases and DBMSs Todd S. Bacastow January 2005.
CSC343H – Introduction to Databases
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.
Winter 2002 Judy Cushing, Art Keller, Jeff Ullman 1–1 Database Systems Lecture/Workshop: Mon 1-3 LIB 1316; Wed 11 – 12, LH2 Lab: Thu 10-12, ACC, additional.
Santa Clara UniversityCOEN 178 Holliday1–1 COEN 178 Database Systems JoAnne Holliday (best way to reach me) Office: Engineering.
Introduction to Database Systems Fundamental Concepts Irvanizam Zamanhuri, M.Sc Computer Science Study Program Syiah Kuala University Website:
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.
Databases : Entity-Relationship Model 2007, Fall Pusan National University Ki-Joune Li These slides are made from the materials that Prof. Jeffrey D. Ullman.
ER Data Models Ctd. CSET 3300.
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
1.1 CAS CS 460/660 Relational Model. 1.2 Review E/R Model: Entities, relationships, attributes Cardinalities: 1:1, 1:n, m:1, m:n Keys: superkeys, candidate.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
1 CS 430 Database Theory Winter 2005 Lecture 2: General Concepts.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Continued)
Tallahassee, Florida, 2015 COP4710 Database Systems E-R Model Fall 2015.
© 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
Winter 2006Cushing Keller UllmanJudy Cushing2–1 Weak Entity Sets Sometimes an E.S. E ’s key comes not (completely) from its own attributes, but from the.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
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.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
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.
ICOM 5016 – Introduction to Database Systems Lecture 5 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Home Work. Design Principles and Weak Entity Sets.
Databases 1 Fifth lecture. Entity-Relationship Model Diagrams Class hierarchies Weak entity sets From E/R diagrams to Relations 2.
advanced data modeling
Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
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.
The Entity-Relationship Model CIS 4301 Lecture Notes 1/12/2006.
Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas.
3/6: Data Management, pt. 2 Refresh your memory Relational Data Model
Entity-Relationship Model E/R Diagrams Converting E/R Diagrams to Relations.
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.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity- Relationship Model (Continued)
High-level Database Models Prof. Yin-Fu Huang CSIE, NYUST Chapter 4.
Databases and DBMSs Todd S. Bacastow January
Entity-Relationship Model
COP4710 Database Systems E-R Model.
Entity-Relationship Model
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.
Constraints in Entity-Relationship Models
CPSC-310 Database Systems
CPSC-310 Database Systems
ITEC 3220A Using and Designing Database Systems
CS 505: Intermediate Topics to Database Systems
Presentation transcript:

Fall 2001Arthur Keller – CS 1802–1 Schedule Today Sep. 25 (T) u More Entity-Relationship Model. u Read Sections Note: Sep. 27 (TH) Class cancelled. Oct. 2 (T) Relational Model. u Read Sections Assignment 1 due. Personal Letter of Introduction and Background due (2% of course grade). Oct. 4 (TH) Functional Dependencies and Normalization. u Read Sections Project Part 1 due.

Fall 2001Arthur Keller – CS 1802–2 More Design Issues 1. Subclasses. 2. Keys. 3. Weak entity sets.

Fall 2001Arthur Keller – CS 1802–3 Subclasses Subclass = special case = fewer entities = more properties. Example: Ales are a kind of beer. In addition to the properties (= attributes and relationships) of beers, there is a “color” attribute for ales.

Fall 2001Arthur Keller – CS 1802–4 E/R Subclasses isa triangles indicate the subclass relation.

Fall 2001Arthur Keller – CS 1802–5 Different Subclass Viewpoints 1. E/R viewpoint: An entity has a component in each entity set to which it logically belongs. u Its properties are the union of the properties of these E.S. 2. Contrasts with object-oriented viewpoint: An object (entity) belongs to exactly one class. u It inherits properties of its superclasses.

Fall 2001Arthur Keller – CS 1802–6 Multiple Inheritance Theoretically, an E.S. could be a subclass of several other entity sets.

Fall 2001Arthur Keller – CS 1802–7 Problems How should conflicts be resolved? Example: manf means grower for wines, bottler for beers. What does manf mean for “grape beers”? Need ad-hoc notation to resolve meanings. In practice, we shall assume a tree of entity sets connected by isa, with all “isas” pointing from child to parent.

Fall 2001Arthur Keller – CS 1802–8 Keys A key is a set of attributes whose values can belong to at most one entity. In E/R model, every E.S. must have a key. u It could have more than one key, but one set of attributes is the “designated” key. In E/R diagrams, you should underline all attributes of the designated key.

Fall 2001Arthur Keller – CS 1802–9 Example Suppose name is key for Beers. Beer name is also key for ales. u In general, key at root is key for all.

Fall 2001Arthur Keller – CS 1802–10 Example: A Multiattribute Key Possibly, hours + room also forms a key, but we have not designated it as such.

Fall 2001Arthur Keller – CS 1802–11 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-one relationship. Called a weak E.S. Represented by putting double rectangle around E and a double diamond around each supporting relationship. Many-one-ness of supporting relationship (includes 1-1) essential. u With many-many, we wouldn't know which entity provided the key value.

Fall 2001Arthur Keller – CS 1802–12 Example: Logins ( Addresses) Login name = user name + host name, e.g., A “login” entity corresponds to a user name on a particular host, but the passwd table doesn’t record the host, just the user name, e.g., ark. Key for a login = the user name at the host (which is unique for that host only) + the IP address of the host (which is unique globally). Design issue: Under what circumstances could we simply make login-name and host-name be attributes of logins, and dispense with the weak E.S.?

Fall 2001Arthur Keller – CS 1802–13 Example: Chain of “Weakness” Consider IP addresses consisting of a primary domain (e.g., edu ), subdomain (e.g., ucsc ), and host (e.g., cats ). Key for primary domain = its name. Key for secondary domain = its name + name of primary domain. Key for host = its name + key of secondary domain = its name + name of secondary domain + name of primary domain.

Fall 2001Arthur Keller – CS 1802–14 All “Connecting” Entity Sets Are Weak In this special case, where bar and beer determine a price, we can omit price from the key, and remove the double diamond from ThePrice. Better: price is attribute of BBP.

Fall 2001Arthur Keller – CS 1802–15 Design Principles Setting: client has (possibly vague) idea of what he/she wants. You must design a database that represents these thoughts and only these thoughts. Avoid redundancy. u Wastes space and encourages inconsistency. u Intuition: something is redundant if it could be hidden from view, and you could still figure out what it is from the other data. KISS = keep it simple, students. u Avoid intermediate concepts.

Fall 2001Arthur Keller – CS 1802–16 Faithfulness to requirements. u Remember the design schema should enforce as many constraints as possible. Don't rely on future data to follow assumptions. u Example: If registrar wants to associate only one instructor with a course, don't allow sets of instructors and count on departments to enter only one instructor per course.

Fall 2001Arthur Keller – CS 1802–17 Example Good: Bad (redundancy): repeats manufacturer address for each beer they manufacture.

Fall 2001Arthur Keller – CS 1802–18 Bad (needless intermediate): Question: Why is it OK to have Beers with just its key as attribute? Why not make set of beers an attribute of manufacturers?

Fall 2001Arthur Keller – CS 1802–19 Query Languages Employee NameDept Department DeptManager SQL SELECT Manager FROM Employee, Department WHERE Employee.name = "Clark Kent” AND Employee.Dept = Department.Dept Query Language Data definition language (DDL) ~ like type defs in C or Pascal Data Manipulation Language (DML) Query (SELECT) UPDATE SET = WHERE

Fall 2001Arthur Keller – CS 1802–20 Host Languages C, C++, Fortran, Lisp, COBOL Application prog. Local Vars DBMS Calls to DB Host language is completely general (Turing complete) but gives you no support Query language—less general "non procedural" and optimizable (Memory) (Storage)

Fall 2001Arthur Keller – CS 1802–21 Relational model is good for: Large amounts of data —> simple operations Navigate among small number of relations Difficult Applications for relational model: VLSI Design (CAD in general) CASE Graphical Data CPU ALU ADDER Adder A FA ALU ADDER Bill of Materials or transitive closure

Fall 2001Arthur Keller – CS 1802–22 Where number of "relations" is large, relationships are complex Object Data Model Logic Data Model OBJECT DATA MODEL 1.Complex Objects – Nested Structure (pointers or references) 2.Encapsulation, set of Methods/Access functions 3.Object Identity 4.Inheritance – Defining new classes like old classes Object model: usually find objects via explicit navigation Also query language in some systems

Fall 2001Arthur Keller – CS 1802–23 LOGIC (Horn Clause) DATA MODEL Prolog, Datalog if A1 and A2 then B prolog B:- A1 and A2 Functions s(5) = 6 (successor) Predicates with Arguments sum(X,Y,Z) X + Y = Z sum(X,0,X) means X + 0 = X (always true for all X) sum(X,s(Y),s(Z)):-sum(X,Y,Z) means X+(Y+1) = (Z+1) if X + Y = Z More power than relational Can Compute Transitive Closure edge(X,Y) path(X,Y) :- edge(X,Y) path(X,Z) :- path(X,Y) & edge(Y,Z)

Fall 2001Arthur Keller – CS 1802–24 Hierarchical 60’s 70's 80's 90’s now Relational Choice for most new applications Object BasesKnowledge Bases Network