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.

Slides:



Advertisements
Similar presentations
1–1 Students Entity/Relationship Model Diagrams to represent designs. Entity like object, = “thing.” Entity set like class = set of “similar” entities/objects.
Advertisements

Entity-Relationship Model
CSCI 305 – Fall 2013 The Entity-Relationship Model Based on Slides by Prof. Brian King.
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
1 Entity-Relationship Model Diagrams Class hierarchies Weak entity sets.
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
Entity-Relationship Model. The process of designing a database begins with: –an analysis of what information the database must hold, and –the relationships.
Design Principles: Faithfulness
1 Relational Model and Translating ER into Relational.
Entity-Relationship Model Lecture 2. Database Modeling and Implementation Process Ideas ER DesignRelational Schema Relational DBMS Implementation.
1 Announcement Recitation time  Before midterm: 6-7pm, by Earl Wagner  After midterm: 5-6pm, by Yi Qiao Newsgroup safe to subscribe  Will not cause.
System Concepts and Architecture Rose-Hulman Institute of Technology Curt Clifton.
Entity-Relationship Model
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.
1 Database Systems (Part I) Introduction to Databases I Overview  Objectives of this lecture.  History and Evolution of Databases.  Basic Terms in Database.
Introduction to Databases
Fall 2001Arthur Keller – CS 1801–1 Computer Science 180: Database Systems Arthur M. Keller (best way to reach me) Office: Baskin.
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.
1 The Relational Data Model Tables Schemas Conversion from E/R to Relations.
1 Lecture 31 Introduction to Databases I Overview  Objectives of this lecture  History and Evolution of Databases  Basic Terms in Database and definitions.
Fall 2001Arthur Keller – CS 1803–1 Schedule Today Oct. 2 (T) Relational Model. u Read Sections Assignment 1 due. Personal Letter of Introduction.
1 Entity-Relationship Model Diagrams Class hierarchies Weak entity sets.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes 1.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Chapter 3)
CS411 Database Systems Kazuhiro Minami
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
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.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Chapter 1 Databases Introduction The content 1).Database Application 2).Database concept 3).An example of database 4).Function of DBMS 5).DBMS product.
Entity-Relationship Model
LiaoNing ShiHua University
CSET 3300 Databases & ER Data Models. Databases A database is a collection of data (information). A DataBase Management System (DBMS) is a software system.
Introduction to Database Systems Fundamental Concepts Irvanizam Zamanhuri, M.Sc Computer Science Study Program Syiah Kuala University Website:
1 Entity-Relationship Model E/R Diagrams Weak Entity Sets Converting E/R Diagrams to Relations.
Databases : Entity-Relationship Model 2007, Fall Pusan National University Ki-Joune Li These slides are made from the materials that Prof. Jeffrey D. Ullman.
Database Management Systems Chapter 2 The Entity-Relationship Data Model Instructor: Li Ma Department of Computer Science Texas Southern University, Houston.
1 Entity-Relationship Model Chapter 2 Copyright : Jeff Ullman + Hank Korth.
CSE 5330/7330 Database Introduction Fall 2009 Margaret H. Dunham Department of Computer Science and Engineering Southern Methodist University POBox
Tallahassee, Florida, 2015 COP4710 Database Systems E-R Model Fall 2015.
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 2 Introduction to a First Course in Database Systems.
Dale Roberts 11/26/ Department of Computer and Information Science, School of Science, IUPUI Fall 2003 Dale Roberts, Lecturer Computer Science, IUPUI.
Databases 1 Fifth lecture. Entity-Relationship Model Diagrams Class hierarchies Weak entity sets From E/R diagrams to Relations 2.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Entity-Relationship Model E/R Diagrams Converting E/R Diagrams to Relations.
Lecture 3 A short revision of ER and EER modelling See R. Elmasri, S.B. Navathe. Fundamentals of Database Systems (third edition) Addison-wesley. Chapter.
CS422 Principles of Database Systems Entity-Relationship Model Chengyu Sun California State University, Los Angeles.
High-level Database Models Prof. Yin-Fu Huang CSIE, NYUST Chapter 4.
A short revision on entity- relationship modelling.
Modeling: Entity-Relationship Diagrams
A short review on entity- relationship modelling.
1 Database Design: DBS CB, 2 nd Edition Logical Database Model: Entity Relationship Model & Object Description Language & Unified Modeling Language Ch.
1 The Relational Data Model Tables Schemas Conversion from E/R to Relations.
CS422 Principles of Database Systems From ER to Relations Chengyu Sun California State University, Los Angeles Adapted from Jeffrey Ullman’s lecture notes.
Database Design and Programming Jan Baumbach Adopted from previous slides of Peter Schneider-Kamp.
CS422 Principles of Database Systems Entity-Relationship Model Chengyu Sun California State University, Los Angeles Adapted from Jeffrey Ullman’s lecture.
CS422 Principles of Database Systems Entity-Relationship Model
Session 2 Welcome: To the fourth learning sequence
Entity-Relationship Model
CPSC-310 Database Systems
The Entity-Relationship Model
Instructor: Zhe He Department of Computer Science
CPSC-310 Database Systems
CPSC-310 Database Systems
Chengyu Sun California State University, Los Angeles
Presentation transcript:

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 access to very large amounts of data. u Example: bank and its ATM machines. 4. Supports secure, atomic access to very large amounts of data. u Contrast two people editing the same UNIX file – last to write “wins” – with the problem if two people deduct money from the same account via ATM machines at the same time – new balance is wrong whichever writes last.

Relational Model Based on tables, as: acct #namebalance 12345Sally Sue …… … Today used in most DBMS's.

The DBMS Marketplace Relational DBMS companies – Oracle, Sybase – are among the largest software companies in the world. IBM offers its relational DB2 system. With IMS, a nonrelational system, IBM is by some accounts the largest DBMS vendor in the world. Microsoft offers SQL-Server, plus Microsoft Access for the cheap DBMS on the desktop, answered by “lite” systems from other competitors. Relational companies also challenged by “object-oriented DB” companies. But countered with “object-relational” systems, which retain the relational core while allowing type extension as in OO systems.

Three Aspects to Studying DBMS's 1. Modeling and design of databases. u Allows exploration of issues before committing to an implementation. 2. Programming: queries and DB operations like update. u SQL 3. DBMS implementation.

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

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)

Students Entity/Relationship 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. In diagrams, entity set  rectangle; attribute  oval. ID namephone height

Relationships Connect two or more entity sets. Represented by diamonds. StudentsCourses Taking

Relationship Set 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. StudentsCourses SallyCS180 SallyCS111 JoeCS180 ……

Multiway Relationships Usually binary relationships (connecting two E.S.) 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 (and graders). Possibly, this E/R diagram is OK: StudentsCourses Taking Assisting TA/Graders

Connection student-TA is only via the course. Works if there is only one course/section that each students takes. But what if students were divided into sections, each headed by a TA? u Then, a student in CS180 would be related to only one of the TA's for CS180. Which one? Need a 3-way relationship to tell.

StudentsCoursesTAs AnnCS180Jan SueCS180Pat BobCS180Jan ……… Students Courses TAs Enrolls

Beers-Bars-Drinkers Example Our running example for the course. nameaddrlicense namemanfnameaddr BeersDrinkers Bars Serves Frequents Likes

Multiplicity of Relationships Representation of Many-One E/R: arrow pointing to “one.” u Rounded arrow = “exactly one.” Many-many Many-oneOne-one

Example: Drinkers Have Favorite Beers nameaddrlicense namemanfnameaddr BeersDrinkers Bars Serves Frequents Likes Favorite

One-One Relationships Put arrows in both directions. Design Issue: Is the rounded arrow justified? Design Issue: Here, manufacturer is an E.S. In earlier diagrams it is an attribute. Which is right? ManfsBeers Best- seller

Attributes on Relationships Shorthand for 3-way relationship: BarsBeers Sells price BarsBeers Sells price Prices

A true 3-way relationship. u Price depends jointly on beer and bar. Notice arrow convention for multiway relationships: “all other E.S. determine one of these.” u However, if price, say, depended only on the beer, then we could use two 2-way relationships: price-beer and beer-bar. u Or better: just make price an attribute of beer.

Converting Multiway to 2-Way Create a new connecting E.S. to represent rows of a relationship set. u E.g., (Joe's Bar, Bud, $2.50) for the Sells relationship. Many-one relationships from the connecting E.S. to the others. BarsBeers The- Bar Price The- Beer The- Price BBP

Roles Sometimes an E.S. participates more than once in a relationship. Label edges with roles to distinguish. HusbandWife d 1 d 2 d 3 d 4… Drinkers Married husbandwife

Notice Buddies is symmetric, Married not. u No way to say “symmetric” in E/R. Design Question Should we replace husband and wife by one relationship spouse? Buddy1Buddy2 d 1 d 2 d 1 d 3 d 2 d 1 d 2 d 4… Drinkers Buddies 12

More Design Issues 1. Subclasses. 2. Keys. 3. Weak entity sets.

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.

E/R Subclasses Assume subclasses form a tree (no multiple inheritance). isa triangles indicate the subclass relation. namemanf Beers Ales color isa

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. namemanf Beers Ales color isa Pete’s Ale

Multiple Inheritance Theoretically, an E.S. could be a subclass of several other entity sets. namemanf Beers namemanf Wines Grape Beers isa

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.

Example Suppose name is key for Beers. Beer name is also key for ales. u In general, key at root is key for all. namemanf Beers Ales color isa

Example: A Multiattribute Key Possibly, the combination of hours + room also forms a key, but we have not designated it as such. deptroom Courses numberhours