Database Management Systems CSE 594 Lecture #1 April 4 th, 2002.

Slides:



Advertisements
Similar presentations
Information Systems Chapter 4 Relational Databases Modelling.
Advertisements

Introduction to Database Systems Ch. 1, Ch. 2 Mr. John Ortiz Dept. of Computer Science University of Texas at San Antonio.
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.
Introduction to Database Systems CSE 444 Lecture #1 January 5th, 1998.
1 CENG 302 Introduction to Database Management Systems Nihan Kesim Çiçekli URL:
1 Lecture 3: Database Modeling (continued) April 5, 2002.
CSE 636 Data Integration Introduction. 2 Staff Instructor: Dr. Michalis Petropoulos Location: 210 Bell Hall Office Hours:
Databases and Database Management System. 2 Goals comprehensive introduction to –the design of databases –database transaction processing –the use of.
1 Conceptual Design with ER Model Lecture #2. 2 Lecture Outline Logistics Steps in building a database application Conceptual design with ER model.
...Looking back Why use a DBMS? How to design a database? How to query a database? How does a DBMS work?
1 Introduction to Database Systems CSE 444 Lecture #1 January 5, 2004 Alon Halevy.
1 Database Systems Lecture #1. 2 Staff Lecturer: Yael Amsterdamer – –Schreiber, Databases lab, M-20, –Office.
Lecture 9: Conceptual Database Design January 27 th, 2003.
1 Introduction to Database Systems CSE 444 Lecture #1 January 3, 2005.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
1 Database Systems Lecture #1. 2 Staff Instructor: Tova Milo – –Schreiber, Room 314, –Office hours: See.
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.
CS462: Introduction to Database Systems. ©Silberschatz, Korth and Sudarshan1.2Database System Concepts Course Information Instructor  Kyoung-Don (KD)
Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with.
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
CSC2012 Database Technology & CSC2513 Database Systems.
© D. Wong 2002 © D. Wong CS610 / CS710 Database Systems I Daisy Wong.
The Worlds of Database Systems Chapter 1. Database Management Systems (DBMS) DBMS: Powerful tool for creating and managing large amounts of data efficiently.
Web-Enabled Decision Support Systems
CS411 Database Systems Kazuhiro Minami 02: The Entity-Relationship Model.
Lecture 2: E/R Diagrams and the Relational Model Thursday, January 4, 2001.
Introduction to Database Systems Fundamental Concepts Irvanizam Zamanhuri, M.Sc Computer Science Study Program Syiah Kuala University Website:
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
Introduction to Database Management Systems. Information Instructor: Csilla Farkas Office: Swearingen 3A43 Office Hours: Monday, Wednesday 4:15 pm – 5:30.
Christoph F. Eick Introduction Data Management Today 1. Introduction to Databases 2. Questionnaire 3. Course Information 4. Grading and Other Things.
CSE544 Introduction Monday, March 29, Staff Instructor: Dan Suciu –CSE 662, –Office hours: Tuesday, 1-2pm. TA: Nilesh Dalvi.
Introduction to Database Management Systems. Information Instructor: Csilla Farkas Office: Swearingen 3A43 Office Hours: M,T,W,Th,F 2:30 pm – 3:30 pm,
INFS614, Dr. Brodsky, GMU1 Database Management Systems INFS 614 Instructor: Professor Alex Brodsky
Introduction to Database Management Systems. Information Instructor: Csilla Farkas Office: Swearingen 3A43 Office Hours: Monday, Wednesday 2:30 pm – 3:30.
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.
Database Design Why do we need it? – Agree on structure of the database before deciding on a particular implementation. Consider issues such as: –What.
Introduction to Database Systems CSE 444 Lecture #1 September,
Fall CSE330/CIS550: Introduction to Database Management Systems Prof. Susan Davidson Office: 278 Moore Office hours: TTh
COMP 430 Intro. to Database Systems Entity-Relationship Diagram Basics Slides use ideas from Chris Ré.
Database System Concepts Introduction Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Transaction.
Advanced Databases COMP3017 Dr Nicholas Gibbins
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
Introduction to Database Systems CSE 444 Lecture #1 September,
Database Systems Lecture #1.
Database Systems Lecture #1.
Introduction to Database Systems CSE 444
Lecture 5: Conceptual Database Design
Chapter 1: Introduction
Database Design Oct. 3, 2001.
Database Design Why do we need it? Consider issues such as:
Database Systems Lecture #1.
Conceptual Database Design
Translation of ER-diagram into Relational Schema
Cse 344 May 11th – Entities.
Principles of Database Management Systems CSE 544
CSE544 Lecture 1: Introduction
name category name price makes Company Product stockprice buys employs
Introduction to Database Systems CSE 444
Introduction to Database Management Systems
Introduction to Database Systems CSE 444
Introduction to Database Systems CSE 444
Introduction to Database Systems CSE 444
Lecture 06: SQL Monday, October 11, 2004.
Syllabus Introduction Website Management Systems
Introduction to Database Systems CSE 444
Introduction to Database Systems CSE 444
Presentation transcript:

Database Management Systems CSE 594 Lecture #1 April 4 th, 2002

Staff Instructor: Alon Halevy –Sieg, Room 310, –Office hours: Thursday before class – or by appointment, . TA: Maya Rodrig –Sieg 226a, –Office hours: TBA

Communications Web page: Mailing list: send to saying (in body of ): subscribe cse594

Goals of the Course Purpose: –Principles of building database applications –Foundations of database management systems. –Issues in building database systems. –Have fun: databases are not just bunches of tuples. –Not an introduction to the nitty gritty of any specific commerical system.

Grading Paper homeworks: 30% –Very little regurgitation. –Meant to be challenging (I.e., fun). Programming project: 30% –Work in pairs. –Build a database application Final Exam: 30% (June 14 th ). Intangibles (e.g., participation): 10%

Textbook Database Systems: The Complete Book, by Garcia-Molina, Ullman and Widom, 2002 Comments on the textbook.

Other Texts Database Management Systems, Ramakrishnan –very comprehensive Fundamentals of Database Systems, Elmasri and Navathe –very widely used

Foundations of Databases, Abiteboul, Hull and Vianu –Mostly theory of databases Data on the Web, Abiteboul,Buneman,Suciu –XML and other new/advanced stuff Available on reserve, at the library

Prerequisites

Real Prerequisites Operating systems Data structures and algorithms Distributed systems Complexity theory Mathematical Logic Knowledge Representation User interface design Programming languages Artificial Intelligence (Search) Greek, Hebrew, French

Why use a DBMS? Suppose we are building a system to store the information pertaining to the university. Several questions arise: how do we store the data? (file organization, etc.) how do we query the data? (write programs…) make sure that updates don’t mess things up? Provide different views on the data? (registrar versus students) how do we deal with crashes? Way too complicated! Go buy a database system!

Functionality of a DBMS Persistent storage management Transaction management Resiliency: recovery from crashes. Separation between logical and physical views of the data. –High level query and data manipulation language. –Efficient query processing Interface with programming languages

Bird’s Eye View of How to build a database application The different components of a database system.

Building an Application with a Database System Requirements modeling (conceptual, pictures) –Decide what entities should be part of the application and how they should be linked. Schema design and implementation –Decide on a set of tables, attributes. –Define the tables in the database system. –Populate database (insert tuples). Write application programs using the DBMS –way easier now that the data management is taken care of.

address namefield Professor Advises Takes Teaches Course Student namecategory quarter name ssn Conceptual Modeling cid

Schema Design and Implementation Tables: Separates the logical view from the physical view of the data. Students:Takes: Courses:

Querying a Database Find all courses that “Mary” takes S(tructured) Q(uery) L(anguage) Query processor figures out how to answer the query efficiently. select C.name from Students S, Takes T, Courses C where S.name=“Mary” and S.ssn = T.ssn and T.cid = C.cid

Query optimizer Execution engine Index/record mgr. Buffer manager Storage manager storage User/ Application Query update Query execution plan Record, index requests Page commands Read/write pages

Storage Management Becomes a hard problem because of the interaction with the other levels of the DBMS: –What are we storing? –Efficient indexing, single and multi-dimensional –Exploit “semantic” knowledge Issue: interaction with the operating system. Should we rely on the OS?

Query Optimization Imperative query execution plan: select C.name from Students S, Takes T, Courses C where S.name=“Mary” and S.ssn = T.ssn and T.cid = C.cid select C.name from Students S, Takes T, Courses C where S.name=“Mary” and S.ssn = T.ssn and T.cid = C.cid Declarative SQL query Plan: tree of Relational Algebra operators, choice of algorithms at each operator Ideally: Want to find best plan. Practically: Avoid worst plans! Goal: Students Takes sid=sid sname name=“Mary” cid=cid Courses

TP and Recovery For efficient use of resources, we want concurrent access to data. Systems sometimes crash. ACIDA “real” database guarantees ACID: –Atomicity: all or nothing of a transaction. –Consistency: always leave the DB consistent. –Isolation: every transaction runs as if it’s the only one in the system. –Durability: if committed, we really mean it. Do we really want ACID?

Data Integration Uniform query capability across autonomous, heterogeneous data sources on LAN, WAN, or Internet

XML: Semi-structured Data –Emerging format for data exchange on the web and between applications. eXtensible Markup Language:

Traditional and Novel Data Management Traditional Data Management: –relational data for enterprise applications –storage –query processing/optimization –transaction processing Novel Data Management: –Integration of data from multiple databases, warehousing. –Data management for decision support, data mining. –Exchange of data on the web: XML.

The Study of DBMS Several aspects: –Modeling and design of databases –Database programming: querying and update operations –Database implementation DBMS study cuts across many fields of Computer Science: OS, languages, AI, Logic, multimedia, theory...

Database Industry Relational databases are a great success of theoretical ideas. $20B industry. Main players: Oracle, IBM, MS, Sybase, Informix Trends: –warehousing and decision support –data integration –XML, XML, XML.

Course (Rough) Outline The basics: (quickly) –Conceptual design –The relational model –SQL –Views, integrity constraints XML Physical representation: –Index structures.

Course Outline (cont) Query execution: –Algorithms for joins, selections, projections. Query Optimization Data Integration semi-structured data Transaction processing and recovery (not much, really)

Projects Goal: identify and solve a problem in database systems. (almost) anything goes. Groups of 2-3 Groups assembled end of week 2; Proposals, end of week 3. Specs – end of week 5 End-to-end skeleton – end of week 7. Start Early. Be creative Demos on last week

Database Design

Building an Application with a DBMS Requirements modeling (conceptual, pictures) –Decide what entities should be part of the application and how they should be linked. Schema design and implementation –Decide on a set of tables, attributes. –Define the tables in the database system. –Populate database (insert tuples). Write application programs using the DBMS –way easier now that the data management is taken care of.

Outline ODL - Object Definition Language (2.1) E/R - Entity relationship diagrams (2.2) Design Principles (2.3)

Database Design Why do we need it? – 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 1. Object Definition Language (ODL): – Closer in spirit to object-oriented models 2. Entity/Relationship model (E/R): –More relational in nature. Both can be translated (semi-automatically) to relational schemas ODL to OO-schema: direct transformation (C++ or Smalltalk based system).

1. Object Definition Language ODL is part of ODMG superset of Corba’s IDL Resembles C++ (and Smalltalk).

ODL Principles 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 Class declaration: Methods: arbitrary function, of little concern for us here Interface { attributes: ; relationships ; methods (param) }

ODL Example Product Person Company category name price name stockprice name addressssn

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; } 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; } So far just simplified C++ with slightly different syntax

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

ODL Declarations, Extended Interface Product { attribute string name; attribute float price; attribute enum Categories {electronics, communications, sports …} category; relationship madeBy; } Interface Person { attribute integer ssn; attribute string name; attribute Struct Address {string street, string city} address; relationship set buys; relationship set worksFor;} Interface Product { attribute string name; attribute float price; attribute enum Categories {electronics, communications, sports …} category; relationship madeBy; } Interface Person { attribute integer ssn; attribute string name; attribute Struct Address {string street, string city} address; relationship set buys; relationship set worksFor;} relationship corresponds somewhat to pointers in C++

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

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

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

Collection Types Sets: –order, number of occurrences don’t matter –{4,7,9} = {7,9,7,4} = {9,4,7} Bags: –number of occurrences matter, order not: –{7,9,7,4}={7,7,9,4}, is different from {4,7,9} Lists: –order, number of occurrences matter: –[4,7,9] different from [9,4,7]

Allowable Types in ODL For attributes: atomic/struct, or collection of atomic/struct OK: string, set Not OK: Product, set > For relationships: interface, or collection of interface. OK: Product, set, list Not OK: struct {pname Product, cname Company} set > integer

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

address namessn Person buys makes employs Company Product namecategory stockprice name price

What is a Relation ? A mathematical definition: –if A, B are sets, then a relation R is a subset of A x B A={1,2,3}, B={a,b,c,d}, R = {(1,a), (1,c), (3,b)} - makes is a subset of Product x Company: a b c d A= B= makes Company Product

Multiplicity of E/R Relations one-one: many-one many-many abcdabcd abcdabcd abcdabcd

Multi-way Relationships How do we model a purchase relationship between buyers, products and stores? Purchase Product Person Store Can still model as a mathematical set (how ?)

Q: what do these arrow mean ? A: store, person, invoice determines movie and store, invoice, movie determines person Rental VideoStore Person Movie Invoice Arrows in Multiway Relationships

Q: what do these arrow mean ? A: store, invoice determines movie and store, invoice determines person Rental VideoStore Person Movie Invoice Arrows in Multiway Relationships

Q: how do I say: “invoice determines store” ? A: no good way; best approximation: Q: Why is this incomplete ? Rental VideoStore Person Movie Invoice Arrows in Multiway Relationships

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

Attributes on Relationships Purchase Product Person Store date

Converting Multi-way Relationships to Binary Purchase Person Store Product StoreOf ProductOf BuyerOf date

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

Design Principles: What’s Wrong? Purchase Product Store date personName personAddr Moral: pick the right kind of entities.

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