H.Lu/HKUST L1: Course Overview & Review. L01: RDBMS REVIEW -- 2 H.Lu/HKUST The Teaching Staff  Instructor: Lu Hongjun  Office: 3543 (Lift 25-26), HKUST.

Slides:



Advertisements
Similar presentations
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Advertisements

1 Introduction to Database Systems CSE444 Instructor: Scott Vandenberg University of Washington Winter 2000.
Database Management Systems 1 Ramakrishnan & Gehrke Introduction to Database Systems Chapter 1 Instructor: Mirsad Hadzikadic.
Chapter 1 Instructor: Murali Mani Database Management Systems.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Introduction to Database Systems Chapter 1 Instructor: Wang-Chien Lee
Database: A collection of related data [Elmasri]. A database represents some aspect of real world called “miniworld” [Elmasri] or “enterprise” [Ramakrishnan].
The Relational Model Class 2 Book Chapter 3 Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC) (From ER to Relational)
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 28 Database Systems I The Relational Data Model.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Introduction to Database Systems Ch. 1, Ch. 2 Mr. John Ortiz Dept. of Computer Science University of Texas at San Antonio.
The Relational Model Ramakrishnan & Gehrke Chapter 3.
The Relational Model CS 186, Spring 2006, Lecture 2 R & G, Chap. 1 & 3.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Database Management Systems Chapter 1 Instructor: Deborah Strahman
The Relational Model Ramakrishnan & Gehrke, Chap. 3.
1 Relational Model. 2 Relational Database: Definitions  Relational database: a set of relations  Relation: made up of 2 parts: – Instance : a table,
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 1 Database Systems I Introduction.
The Relational Model Lecture 3 Book Chapter 3 Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC) From ER to Relational.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
1 Introduction to Database Systems Ref. Ramakrishnan & Gehrke Chapter 1.
1 CENG 302 Introduction to Database Management Systems Nihan Kesim Çiçekli URL:
Dr. Kalpakis CMSC 461, Database Management Systems Introduction.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Database Management Systems Chapter 1 Instructor: Ethan Jackson
CSCD34 - Data Management Systems,- A. Vaisman1 CSC D34 - Data Management Systems Instructor: Alejandro Vaisman University of Toronto.
Introduction to DBMS Purpose of Database Systems View of Data
CSC343H – Introduction to Databases
CS462: Introduction to Database Systems. ©Silberschatz, Korth and Sudarshan1.2Database System Concepts Course Information Instructor  Kyoung-Don (KD)
The Relational Model These slides are based on the slides of your text book.
CSC2012 Database Technology & CSC2513 Database Systems.
Data Models Amandeep Kaur Lecturer GPC Khunimajra Call at
Relational Data Model, R. Ramakrishnan and J. Gehrke with Dr. Eick’s additions 1 The Relational Model Chapter 3.
Introduction. 
Database Management Systems 1 Introduction to Database Systems Instructor: Xintao Wu Ramakrishnan & Gehrke.
The Relational Model. Review Why use a DBMS? OS provides RAM and disk.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3 Modified by Donghui Zhang.
Database Management Systems 1 Ramakrishnan & Gehrke Introduction to Database Systems Chpt 1 Instructor: Xintao Wu.
Database Management Systems 1 Ramakrishnan & Gehrke Introduction to Database Systems Chpt 1 Instructor: Weichao Wang.
Chapter 1 : Introduction §Purpose of Database Systems §View of Data §Data Models §Data Definition Language §Data Manipulation Language §Transaction Management.
INFS614, Dr. Brodsky, GMU1 Database Management Systems INFS 614 Instructor: Professor Alex Brodsky
©Silberschatz, Korth and Sudarshan1.1Database System Concepts COMP319: Introduction Course Structure Course Assessment Review: DBMS Structure Review: Terminology.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
1 The Relational Model. 2 Why Study the Relational Model? v Most widely used model. – Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. v “Legacy.
FALL 2004CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
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.
The Relational Model Content based on Chapter 3 Database Management Systems, (Third Edition), by Raghu Ramakrishnan and Johannes Gehrke. McGraw Hill, 2003.
The Relational Model Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY.
CS34311 The Relational Model. cs34312 Why Relational Model? Currently the most widely used Vendors: Oracle, Microsoft, IBM Older models still used IBM’s.
1 CS462- Database Systems Sang H. Son
Chapter 1: Introduction. 1.2 Database Management System (DBMS) DBMS contains information about a particular enterprise Collection of interrelated data.
Database System Concepts Introduction Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Transaction.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Database Management Systems Chapter 1.
1 CENG 351 CENG 351 Introduction to Data Management and File Structures Department of Computer Engineering METU.
Chapter 3 The Relational Model. Why Study the Relational Model? Most widely used model. Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. “Legacy.
Database Management Systems 1 Ramakrishnan & Gehrke Introduction to Database Systems Chpt 1 Instructor: Xin Zhang.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
Introduction to DBMS Purpose of Database Systems View of Data
Introduction to Database Systems
Instructor: Elke Rundensteiner
Introduction to Database Systems
Instructor: Murali Mani
Introduction to Database Systems
The Relational Model Content based on Chapter 3
The Relational Model Relational Data Model
The Relational Model The slides for this text are organized into chapters. This lecture covers Chapter 3. Chapter 1: Introduction to Database Systems Chapter.
Database Management Systems CSE594
Introduction to DBMS Purpose of Database Systems View of Data
Introduction to Database Systems
The Relational Model Content based on Chapter 3
The Relational Model Content based on Chapter 3
Presentation transcript:

H.Lu/HKUST L1: Course Overview & Review

L01: RDBMS REVIEW -- 2 H.Lu/HKUST The Teaching Staff  Instructor: Lu Hongjun  Office: 3543 (Lift 25-26), HKUST   URL:  Research Interests: Data/Knowledge base management with emphasis on query processing and optimization Data warehousing and data mining Applied performance evaluation Database application development Parallel and distributed database systems  TA:  NameJiang Haifeng Liu Guimei  Office: 4212 (DB Lab) HKUST   URL:

L01: RDBMS REVIEW -- 3 H.Lu/HKUST References  R.Ramakrishnan & J. Gehrke. Database Management Systems, 3rd Ed. McGraw Hill, 2000  D. Shasha & P. Bonnet. Database Tuning: Principles, Experiments, and Troubleshooting Techniques, Revised edition, Morgan Kaufmann, 2002  Related papers

L01: RDBMS REVIEW -- 4 H.Lu/HKUST Course Contents  Part I: Issues in database administration  Database design  Principles of database performance tuning  Database security  Part II: Emerging DB-related technology  OLAP and data warehouse  XML data management  Data stream processing  Course Web Page:

L01: RDBMS REVIEW -- 5 H.Lu/HKUST Grading  Written assignment (20%)  Exams (25%)  Course project (50 %)  Class participation (5%)

L01: RDBMS REVIEW -- 6 H.Lu/HKUST Course Project Requirements  Carried in teams of two or four  Database related projects  You propose your own project, and get approve from the instructor  Topic: database related  The amount of work : it accounts for 50% of your final grade  Required documents (double-spaced)  Project proposal (1-2 pages) due date: 23-24/02  Status report (4-6 pages) due date: 28-29/03  Final report (8-10 pages) due date: 10-11/05

L01: RDBMS REVIEW -- 7 H.Lu/HKUST Summary  It is a graduate level course  Not a DBA course  Not an introductory database course  Not a programming course, but you need to know how to write programs  Hopefully, you will leave with  A good grade  A good understanding of studied topics

L01: RDBMS REVIEW -- 8 H.Lu/HKUST Review -- RDBMS  Relational database systems  The basic concepts in database systems  Relational data model  Relational languages  Database design  Previous course: conceptual and logic design  This course: physical database design  Database management systems  The basic components of DBMS  Storage management  Transaction management  Query processing & optimization

L01: RDBMS REVIEW -- 9 H.Lu/HKUST What Is Database & DBMS?  Database: a very large, integrated, persistent collection of data.  Models real-world enterprise. Entities (e.g., students, courses) Relationships (e.g., James is taking CSIT530)  A Database Management System (DBMS) is a software package designed to store and manage databases.

L01: RDBMS REVIEW H.Lu/HKUST Data Models  A data model is a collection of concepts for describing  data and related operations,  semantics of data,  relationship among data, and  constraints on data  Two types of data models  Conceptual models: emphasize semantics of data Entity-Relationship model, Object-Oriented model  Logical models: ways how the data is organized in the logical level Hierarchical model, Network model, Relational model

L01: RDBMS REVIEW H.Lu/HKUST Instances and Schemas  A schema is a description of a particular collection of data, using a given data model - the logical structure of the database (e.g., set of customers and accounts and the relationship between them)  Schema Instance - the actual content of the database at a particular point in time  Similar to types and variables in programming languages

L01: RDBMS REVIEW H.Lu/HKUST Levels of Abstraction  ANSI-SPARC three-level architecture  Many views, single conceptual (logical) schema and physical schema.  Views describe how users see the data.  Conceptual schema defines logical structure  Physical schema describes the files and indexes used. View Conceptual Schema Physical Schema View

L01: RDBMS REVIEW H.Lu/HKUST Data Independence  Applications insulated from how data is structured and stored.  Ability to modify a schema definition in one level without affecting a schema definition in the next higher level.  The interfaces between the various levels and components should be well defined so that changes in some parts do not seriously influence others.  Logical data independence: Protection from changes in logical structure of data.  Physical data independence: Protection from changes in physical structure of data.

L01: RDBMS REVIEW H.Lu/HKUST Database Environment Procedures And standards Data DBMS Hardware Application Programs System administrator Database Administrator Analysts & Programmers Database Designer designs manages designs write use Specifies & enforces End Users

L01: RDBMS REVIEW H.Lu/HKUST DBMS Related Languages  Data Definition Language (DDL)  Specification notation for defining the database schema  Data storage and definition language - special type of DDL in which the storage structure and access methods used by the database system are specified  Data Manipulation Language (DML)  Language for accessing and manipulation the data organized by the appropriate data model  Two classes of languages Procedural - user specifies what data is required and how to get those data. Nonprocedural - user specifies what data is required without specifying how to get those data

L01: RDBMS REVIEW H.Lu/HKUST DBMS Related Languages Programming Language for DBMS Applications Host Language Data Sublanguage DDL DML Query Language Procedural Non-Procedural

L01: RDBMS REVIEW H.Lu/HKUST Evolution of Database Technology  1960s: Hierarchical (IMS) & network (CODASYL) DBMS.  1970s: Relational data model, relational DBMS implementation.  1980: RDBMS rules the earth  1985-: Advanced data models (extended-relational, OO, deductive, etc.) Application-oriented DBMS (spatial, scientific, engineering, etc.).  1990s: ORDB, OLAP, Data mining, data warehousing, multimedia databases, and network databases.

L01: RDBMS REVIEW H.Lu/HKUST What is an RDBMS  A piece of software that manages data based on the relational model  Relational data, SQL queries  Commercial products  Oracle, IBM DB2, IBM Informix, Sybase, Microsoft SQL Server  Each has ~10 million lines of C/C++ code  Smaller packages – MySQL, PostgresSQL

L01: RDBMS REVIEW H.Lu/HKUST Relational Data Model  Main concept: relation  A table with rows and columns  Every relation has a schema  Description of the columns, or fields  Relational data – rows in a table  No order among the rows in a table  The most widely used data model!

L01: RDBMS REVIEW H.Lu/HKUST University Database  Conceptual schema:  Students (sid: string, name: string, login: string, age: integer, gpa:real) Cardinality = 3, degree = 5, all rows distinct  Courses (cid: string, cname:string, credits:integer)  Enrolled (sid:string, cid:string, grade:string)

L01: RDBMS REVIEW H.Lu/HKUST Relational Languages  Formal languages  Relational algebra  Relational calculus  Commercial language: SQL  DDL (Data Definition Language) Create Table, Create Index, Create View …  DML (Data Manipulation Language) Queries –Select Updates –Insert, Delete, Update

L01: RDBMS REVIEW H.Lu/HKUST Creating Tables CREATE TABLE Students (sid: CHAR(20), name: CHAR(20), login: CHAR(10), age: INTEGER, gpa: REAL) CREATE TABLE Enrolled (sid: CHAR(20), cid: CHAR(20), grade: CHAR(2))

L01: RDBMS REVIEW H.Lu/HKUST Primary Key Constraints  A set of fields is a key for a relation if :  1. Any two distinct tuples differ in some fields of the set, and  2. This is not true for any subset of the set.  A superkey: Condition 1 true and 2 false.  E.g., sid is a key for Students. {sid, gpa} is a superkey.  One primary key can be set per relation.

L01: RDBMS REVIEW H.Lu/HKUST Primary and Candidate Keys CREATE TABLE Students (sid: CHAR(20), name: CHAR(20), login: CHAR(10), age: INTEGER, gpa: REAL, PRIMARY KEY (sid), UNIQUE (login)) CREATE TABLE Enrolled (sid CHAR(20) cid CHAR(20), grade CHAR(2), PRIMARY KEY (sid,cid))

L01: RDBMS REVIEW H.Lu/HKUST Foreign Key Constraints  Foreign key : a set of fields in a relation  Refers to the primary key of another relation  Referential integrity  No dangling references CREATE TABLE Enrolled (sid CHAR(20), cid CHAR(20), grade CHAR(2), PRIMARY KEY (sid,cid), FOREIGN KEY (sid) REFERENCES Students ) Enrolled Students

L01: RDBMS REVIEW H.Lu/HKUST Integrity Constraints (ICs)  IC: condition that must be true for any db instance  Domain constraints  Primary constraints  Foreign key constraints  ICs are specified when a schema is defined.  ICs are checked when relations are modified.  A legal instance of a relation  Satisfies all specified ICs

L01: RDBMS REVIEW H.Lu/HKUST Adding and Deleting Tuples INSERT INTO Students (sid, name, login, age, gpa) VALUES (53688, ‘Smith’, 18, 3.2) DELETE FROM Students S WHERE S.name = ‘Smith’

L01: RDBMS REVIEW H.Lu/HKUST Queries SELECT * FROM Students S WHERE S.sid = 53688

L01: RDBMS REVIEW H.Lu/HKUST Querying Multiple Tables SELECT S.name, E.cid FROM Students S, Enrolled E WHERE S.sid=E.sid AND E.grade=“A” Enrolled Students

L01: RDBMS REVIEW H.Lu/HKUST Functional Components of DBMS Statistics Metadata Indexes User data Storage Manager Buffer Management Index/file/record Management Execution Engine Query Processing & Optimization Buffer DDL Compiler Transaction Management Recovery Log Concurrency Control Lock Table Query Plan DDL Command User/ApplicationDatabase Administrator Security Control Storage Management DML Stmt. Query Processing Transaction Manager

L01: RDBMS REVIEW H.Lu/HKUST Query Optimization  A major strength of RDBMS  SQL queries are declarative  Optimizer figures out how to answer them  Re-order operations  Pick among alternatives of one operation  Ensure that the answer is correct!

L01: RDBMS REVIEW H.Lu/HKUST Transaction  A key concept in databases  An atomic sequence of actions (read/write)  Brings DB from a consistent state to another  ACID  Atomicity  Consistency  Isolation  Durability

L01: RDBMS REVIEW H.Lu/HKUST Concurrency Control & Recovery  Concurrency Control  Essential for good DBMS performance  Run several user programs concurrently  Interleave actions of different users  Ensure the correctness Users may think it is a single-user system.  Recovery  Essential for durability of transactions

L01: RDBMS REVIEW H.Lu/HKUST RDBMS Features  Effective and efficient access  Easier application development  Data independence  Data integrity and security  Concurrent access  Recovery from crashes  Uniform data administration

L01: RDBMS REVIEW H.Lu/HKUST Summary  DBMS used to maintain, query large datasets.  Benefits include recovery from system crashes, concurrent access, quick application development, data integrity and security.  Levels of abstraction give data independence.  A DBMS typically has a layered architecture.  DBAs hold responsible jobs and are well-paid!  DBMS R&D is one of the broadest, most exciting areas in CS.