CMU SCS Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB Applications C. Faloutsos – A. Pavlo Lecture#1: Introduction.

Slides:



Advertisements
Similar presentations
CMU SCS : Multimedia Databases and Data Mining Lecture#1: Introduction Christos Faloutsos CMU
Advertisements

CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications C. Faloutsos & A. Pavlo Lecture#6: Rel. model - SQL part1 (R&G, chapter.
Lecture-7/ T. Nouf Almujally
CMU SCS : Multimedia Databases and Data Mining Lecture#1: Introduction Christos Faloutsos CMU
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science Database Applications C. Faloutsos Lecture#7 (cont’d): Rel. model - SQL part3.
--What is a Database--1 What is a database What is a Database.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction n Why Database Systems? n Data Models n Data Definition Language.
1 Chapter 2 Database Environment. 2 Objectives of Three-Level Architecture u All users should be able to access same data u User’s view immune to changes.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Dr. Kalpakis CMSC 461, Database Management Systems Introduction.
CMU SCS : Multimedia Databases and Data Mining Lecture#1: Introduction Christos Faloutsos CMU
Database Management Systems (DBMS)
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Database Management COP4540, SCS, FIU An Introduction to database system.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications C. Faloutsos & A. Pavlo Lecture#7 : Rel. model - SQL part2 (R&G, chapters.
Introduction to DBMS Purpose of Database Systems View of Data
Temple University – CIS Dept. CIS331– Principles of Database Systems V. Megalooikonomou Relational Model – SQL Part I (based on notes by Silberchatz,Korth,
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
CS462: Introduction to Database Systems. ©Silberschatz, Korth and Sudarshan1.2Database System Concepts Course Information Instructor  Kyoung-Don (KD)
Temple University – CIS Dept. CIS616– Principles of Database Systems V. Megalooikonomou Introduction (based on notes by Silberchatz,Korth, and Sudarshan)
 Introduction Introduction  Purpose of Database SystemsPurpose of Database Systems  Levels of Abstraction Levels of Abstraction  Instances and Schemas.
Relational Database Management System(17332) Prepared By Ms. Harsha C. Kunwar G.H. Raisoni Polytechnic, Nagpur CHAPTER -01 DATABASE SYSTEM CONCEPT.
Introduction. 
Module Title? DBMS Introduction to Database Management System.
Chapter 2 CIS Sungchul Hong
Chapter 1 Introduction to Databases Pearson Education ©
Database Architecture Introduction to Databases. The Nature of Data Un-structured Semi-structured Structured.
CSC271 Database Systems Lecture # 4.
 DATABASE DATABASE  DATABASE ENVIRONMENT DATABASE ENVIRONMENT  WHY STUDY DATABASE WHY STUDY DATABASE  DBMS & ITS FUNCTIONS DBMS & ITS FUNCTIONS 
Database System Concepts and Architecture
Chapter 1 : Introduction §Purpose of Database Systems §View of Data §Data Models §Data Definition Language §Data Manipulation Language §Transaction Management.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts COMP319: Introduction Course Structure Course Assessment Review: DBMS Structure Review: Terminology.
Carnegie Mellon Carnegie Mellon Univ. Dept. of Computer Science Database Applications C. Faloutsos Introduction.
Ch. 1 데이터베이스시스템 (2). Ch.1 Database System 데이터베이스시스템 2 What to Learn Database System Overview Entity-Relationship diagram Relational Data Model  Structure.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
5-1 McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Database Environment Chapter 2. Data Independence Sometimes the way data are physically organized depends on the requirements of the application. Result:
Carnegie Mellon Carnegie Mellon Univ. Dept. of Computer Science Database Applications C. Faloutsos Rel. model - SQL part3.
1 Database Management Systems (DBMS). 2 Database Management Systems (DBMS) n Overview of: ä Database Management Components ä Database Systems Architecture.
Database Environment Session 2 Course Name: Database System Year : 2013.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
1 Chapter 1 Introduction to Databases Transparencies.
DATABASE MANAGEMENT SYSTEM By: YAMINI TRIPATHI. INTRODUCTION Consists - Collection of interrelated data - Set of programs to access those data Definition.
Database Systems Lecture 1. In this Lecture Course Information Databases and Database Systems Some History The Relational Model.
Carnegie Mellon Carnegie Mellon Univ. Dept. of Computer Science Database Applications C. Faloutsos Rel. model - SQL part2.
DataBase System Concepts and Architecture
Mr.Prasad Sawant, MIT Pune India Introduction to DBMS.
INFO 340 Lecture 2 Intro to Databases. Book –Need it –Order individually through UW Bookstore –Or Amazon.
1 Database Environment. 2 Objectives of Three-Level Architecture u All users should be able to access same data. u A user’s view is immune to changes.
ASET 1 Amity School of Engineering & Technology B. Tech. (CSE/IT), III Semester Database Management Systems Jitendra Rajpurohit.
Database Environment Chapter 2. The Three-Level ANSI-SPARC Architecture External Level Conceptual Level Internal Level Physical Data.
Database System Concepts Introduction Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Transaction.
Databases Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
Database Management Systems By Dinesha L Lecturer, Dept. Of CSE SSIT, Tumkur Chapter-1.
©Silberschatz, Korth and Sudarshan 1.1 Database System Concepts قواعد البيانات Data Base قواعد البيانات CCS 402 Mr. Nedal hayajneh E- mail
CHAPTER 1: INTRODUCTION Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Storage Management Database.
CS 325 Spring ‘09 Chapter 1 Goals:
Introduction to DBMS Purpose of Database Systems View of Data
Faloutsos - Pavlo C. Faloutsos - A. Pavlo Lecture#2: E-R diagrams
15-826: Multimedia Databases and Data Mining
Database Management System
Introduction What is a Database?.
Database System Concepts and Architecture
Introduction to Database Systems
Database System Architecture
Introduction to DBMS Purpose of Database Systems View of Data
Presentation transcript:

CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications C. Faloutsos – A. Pavlo Lecture#1: Introduction

CMU SCS Faloutsos/PavloCMU SCS /6152 Outline Introduction to DBMSs The Entity Relationship model The Relational Model SQL: the commercial query language DB design: FD, 3NF, BCNF indexing, q-opt concurrency control & recovery advanced topics (data mining, multimedia)

CMU SCS Faloutsos/PavloCMU SCS /6153 We’ll learn: What are RDBMS –when to use them –how to model data with them –how to store and retrieve information –how to search quickly for information Internals of an RDBMS: indexing, transactions

CMU SCS Faloutsos/PavloCMU SCS /6154 We’ll learn (cnt’d) Advanced topics –multimedia indexing (how to find similar, eg., images) –data mining (how to find patterns in data)

CMU SCS Administrivia Weights: as announced Faloutsos/PavloCMU SCS /6155 Course grade MTASGNFinal exam 30% 40% ASGN1ASGN8 … 5% Sum= 100%

CMU SCS Administrivia - II FYI: ASGN3 and ASGN7 are heavy Late policy: 4 ‘slip days’ Exams: no aids allowed, except –1 page with your notes (both sides) for MT –2 such pages for Final Faloutsos/PavloCMU SCS /6156

CMU SCS Faloutsos/PavloCMU SCS /6157 Detailed outline Introduction –Motivating example –How do DBMSs work? DDL, DML, views. –Fundamental concepts –DBMS users –Overall system architecture –Conclusions

CMU SCS Faloutsos/PavloCMU SCS /6158 What is the goal of rel. DBMSs (eg., you have 50 friends + phone#; Or a dentist has 100 customers, addresses, visit-info, treatment-info) How can RDBMSs help?

CMU SCS Faloutsos/PavloCMU SCS /6159 What is the goal of rel. DBMSs Electronic record-keeping: Fast and convenient access to information.

CMU SCS Faloutsos/PavloCMU SCS /61510 Definitions ‘DBMS’ = ‘Data Base Management System’: the (commercial) system, like: DB2, Oracle, MS SQL-server,... ‘Database system’: DBMS + data + application programs

CMU SCS Faloutsos/PavloCMU SCS /61511 Motivating example Eg.: students, taking classes, obtaining grades; find my gpa

CMU SCS Faloutsos/PavloCMU SCS /61512 Obvious solution: paper-based advantages? disadvantages? eg., student folders, alpha sorted

CMU SCS Faloutsos/PavloCMU SCS /61513 Obvious solution: paper-based advantages? –cheap; easy to use disadvantages? eg., student folders, alpha sorted

CMU SCS Faloutsos/PavloCMU SCS /61514 Obvious solution: paper-based advantages? –cheap; easy to use disadvantages? –no ‘ad hoc’ queries –no sharing –large physical foot-print

CMU SCS Faloutsos/PavloCMU SCS /61515 Next obvious solution computer-based (flat) files + C (Java,...) programs to access them e.g., one (or more) UNIX/DOS files, with student records and their courses

CMU SCS Faloutsos/PavloCMU SCS /61516 Next obvious solution your layout for the student records?

CMU SCS Faloutsos/PavloCMU SCS /61517 Next obvious solution your layout for the student records? (eg., comma-separated values ‘csv’ Smith,John,123,db,A,os,B Tompson,Peter,234 Atkinson,Mary,345,os,B,graphics,A

CMU SCS Faloutsos/PavloCMU SCS /61518 Next obvious solution your layout for the student records? (many other layouts are fine, eg.: Smith,John,123 Tompson,Peter,234 Atkinson,Mary, ,db,A 123,os,B 345,os,B 345,graphics,A

CMU SCS Faloutsos/PavloCMU SCS /61519 Problems?

CMU SCS Faloutsos/PavloCMU SCS /61520 Problems? inconvenient access to data (need ‘C++’ expertize, plus knowledge of file-layout) –data isolation data redundancy (and inconcistencies) integrity problems atomicity problems

CMU SCS Faloutsos/PavloCMU SCS /61521 Problems? (cont’d)... concurrent-access anomalies security problems

CMU SCS Faloutsos/PavloCMU SCS /61522 Problems? (cont’d) [ why? because of two main reasons: –file-layout description is buried within the C programs and –Transactions: there is no support for them(concurrency and recovery) ] DBMSs handle exactly these two problems

CMU SCS Faloutsos/PavloCMU SCS /61523 DBMS solution commercial/freeware DBMS & application programs

CMU SCS Faloutsos/PavloCMU SCS /61524 Main vendors/products Commercial Oracle IBM/DB2 MS SQL-server Sybase (MS Access,...) Open source Postgres (UCB) mySQL/mariaDB sqlite (sqlite.org) miniBase (Wisc) Predator (Cornell) (

CMU SCS Faloutsos/PavloCMU SCS /61525 Insert ‘student’ and ‘takes’ records Find the ‘os’ class roster Find the GPA of ‘Smith’

CMU SCS Faloutsos/PavloCMU SCS /61526 Detailed outline Introduction –Motivating example –How do DBMSs work? DDL, DML, views. –Fundamental concepts –DBMS users –Overall system architecture –Conclusions

CMU SCS Faloutsos/PavloCMU SCS /61527 How do DBs work? Pictorially: DBMS data and meta-data = catalog = data dictionary select * from student

CMU SCS Faloutsos/PavloCMU SCS /61528 How do DBs work? % sqlite3 miniu.sql sqlite>create table student ( ssn fixed; name char(20) ); Smith,John, 123,db,A,os,B Tompson,Peter,234 Atkinson,Mary,345,os,B,graphics,A

CMU SCS Faloutsos/PavloCMU SCS /61529 How do DBs work? % sqlite3 miniu.sql sqlite>create table student ( ssn fixed; name char(20) ); Smith, 123,db,A,os,B Tompson, 234 Atkinson, 345,os,B,graphics,A

CMU SCS Faloutsos/PavloCMU SCS /61530 How do DBs work? sqlite>insert into student values (123, “Smith”); sqlite>select * from student;

CMU SCS Faloutsos/PavloCMU SCS /61531 create table student (ssn fixed, name char(20)); insert into student values(123, "Smith"); insert into student values(234, "Tompson"); insert into student values(345, "Atkinson"); -- see what we have inserted select * from student; ssn name Smith 234 Tompson 345 Atkinson

CMU SCS Faloutsos/PavloCMU SCS /61532 How do DBs work? sqlite>create table takes ( ssn fixed, cid char(10), grade fixed));

CMU SCS Faloutsos/PavloCMU SCS / register students in classes and give them grades drop table if exists takes; create table takes (ssn fixed, cid char(10), grade fixed); insert into takes values( 123, "db", 4); insert into takes values( 123, "os", 3); insert into takes values( 345, "os", 3); insert into takes values( 345, "graphics", 4); Smith,John,123,db,A,os,B Tompson,Peter,234 Atkinson,Mary,345,os,B,graphics,A

CMU SCS Faloutsos/PavloCMU SCS / see what we inserted select * from takes; ssn cid grade db os os graphics 4 Smith,John,123,db,A,os,B Tompson,Peter,234 Atkinson,Mary,345,os,B,graphics,A

CMU SCS Faloutsos/PavloCMU SCS /61535 How do DBs work - cont’d More than one tables - joins Eg., roster (names only) for ‘os’

CMU SCS Faloutsos/PavloCMU SCS /61536 How do DBs work - cont’d sqlite> select name from student, takes where student.ssn = takes.ssn and takes.c-id = ‘os’

CMU SCS Faloutsos/PavloCMU SCS / find the os class roster select name from student, takes where student.ssn = takes.ssn and cid="os"; name Smith Atkinson Smith,John,123,db,A,os,B Tompson,Peter,234 Atkinson,Mary,345,os,B,graphics,A

CMU SCS Faloutsos/PavloCMU SCS /61538 Views - a powerful tool! what and why? suppose secy is allowed to see only ssn’s and GPAs, but not individual grades -> VIEWS!

CMU SCS Faloutsos/PavloCMU SCS /61539 Views sqlite> create view fellowship as ( select ssn, avg(grade) from takes group by ssn); takes ssncidgrade 123db4 123os3 345os3 345graphics4

CMU SCS Faloutsos/PavloCMU SCS /61540 Views Views = ‘virtual tables’

CMU SCS Faloutsos/PavloCMU SCS /61541 Views sqlite> select * from fellowship; takes ssncidgrade 123db4 123os3 345os3 345graphics4

CMU SCS Faloutsos/PavloCMU SCS /61542 Views sql> grant select on fellowship to secy; (‘grant’ not supported in sqlite) takes ssncidgrade 123db4 123os3 345os3 345graphics4

CMU SCS Faloutsos/PavloCMU SCS /61543 Iterating: advantages over (flat) files logical and physical data independence, because data layout, security etc info: stored explicitly on the disk concurrent access and transaction support

CMU SCS Faloutsos/PavloCMU SCS /61544 Disadvantages over (flat) files?

CMU SCS Faloutsos/PavloCMU SCS /61545 Disadvantages over (flat) files Price additional expertise (SQL/DBA) hence: over-kill for small, single-user data sets But: mobile phones (eg., android) use sqlite; some versions of firefox do, too:./mozilla/…/cookies.sqlite etc

CMU SCS Faloutsos/PavloCMU SCS /61546 Detailed outline Introduction –Motivating example –How do DBMSs work? DDL, DML, views. –Fundamental concepts –DBMS users –Overall system architecture –Conclusions

CMU SCS Faloutsos/PavloCMU SCS /61547 Fundamental concepts 3-level architecture logical data independence physical data independence

CMU SCS Faloutsos/PavloCMU SCS / level architecture view level logical level physical level v1 v2 v3

CMU SCS Faloutsos/PavloCMU SCS / level architecture view level logical level: eg., tables –STUDENT(ssn, name) –TAKES (ssn, cid, grade) physical level: –how are these tables stored, how many bytes / attribute etc

CMU SCS Faloutsos/PavloCMU SCS / level architecture view level, eg: –v1: select ssn from student –v2: select ssn, c-id from takes logical level physical level

CMU SCS Faloutsos/PavloCMU SCS / level architecture view level -> ‘ fellowship ’ logical level -> ‘ student ’ ‘ takes ’ physical level -> indices, hash, … v1 v2 v3

CMU SCS Faloutsos/PavloCMU SCS / level architecture -> hence, physical and logical data independence: logical D.I.: –??? physical D.I.: –???

CMU SCS Faloutsos/PavloCMU SCS / level architecture -> hence, physical and logical data independence: logical D.I.: –can add (drop) column; add/drop table physical D.I.: –can add index; change record order

CMU SCS Faloutsos/PavloCMU SCS /61554 Detailed outline Introduction –Motivating example –How do DBMSs work? DDL, DML, views. –Fundamental concepts –DBMS users –Overall system architecture –Conclusions

CMU SCS Faloutsos/PavloCMU SCS /61555 Database users ‘naive’ users casual users application programmers [ DBA (Data base administrator)]

CMU SCS Faloutsos/PavloCMU SCS /61556 Casual users DBMS data and meta-data = catalog select * from student

CMU SCS Faloutsos/PavloCMU SCS /61557 ``Naive’’ users Pictorially: DBMS data and meta-data = catalog app. (eg., report generator)

CMU SCS Faloutsos/PavloCMU SCS /61558 App. programmers Authors of applications (like the ‘report generator’) DBMS data and meta-data = catalog app. (eg., report generator)

CMU SCS Faloutsos/PavloCMU SCS /61559 DB Administrator (DBA) Duties? DBMS data and meta-data = catalog app. (eg., report generator)

CMU SCS Faloutsos/PavloCMU SCS /61560 DB Administrator (DBA) Duties? DBMS data and meta-data = catalog app. (eg., report generator)

CMU SCS Faloutsos/PavloCMU SCS /61561 DB Administrator (DBA) schema definition (‘logical’ level) physical schema (storage structure, access methods schema modifications granting authorizations integrity constraint specification

CMU SCS Faloutsos/PavloCMU SCS /61562 Detailed outline Introduction –Motivating example –How do DBMSs work? DDL, DML, views. –Fundamental concepts –DBMS users –Overall system architecture –Conclusions

CMU SCS Faloutsos/PavloCMU SCS /61563 Overall system architecture [Users] DBMS –query processor –storage manager [Files]

CMU SCS Faloutsos/PavloCMU SCS /61564 DDL int.DML proc. query eval. app. pgm(o) trans. mgr emb. DML buff. mgrfile mgr datameta-data query proc. storage mgr. naiveapp. pgmrcasualDBA users

CMU SCS Faloutsos/PavloCMU SCS /61565 Overall system architecture query processor –DML compiler –embedded DML pre-compiler –DDL interpreter –Query evaluation engine

CMU SCS Faloutsos/PavloCMU SCS /61566 Overall system architecture (cont’d) storage manager –authorization and integrity manager –transaction manager –buffer manager –file manager

CMU SCS Faloutsos/PavloCMU SCS /61567 Overall system architecture (cont’d) Files –data files –data dictionary = catalog (= meta-data) –indices –statistical data

CMU SCS Faloutsos/PavloCMU SCS /61568 Some examples: DBA doing a DDL (data definition language) operation, eg., create table student...

CMU SCS Faloutsos/PavloCMU SCS /61569 DDL int.DML proc. query eval. app. pgm(o) trans. mgr emb. DML buff. mgrfile mgr datameta-data query proc. storage mgr. naiveapp. pgmrcasualDBA users

CMU SCS Faloutsos/PavloCMU SCS /61570 Some examples: casual user, asking for an update, eg.: update student set name to ‘smith’ where ssn = ‘345’

CMU SCS Faloutsos/PavloCMU SCS /61571 DDL int.DML proc. query eval. app. pgm(o) trans. mgr emb. DML buff. mgrfile mgr datameta-data query proc. storage mgr. naiveapp. pgmrcasualDBA users

CMU SCS Faloutsos/PavloCMU SCS /61572 DDL int.DML proc. query eval. app. pgm(o) trans. mgr emb. DML buff. mgrfile mgr datameta-data query proc. storage mgr. naiveapp. pgmrcasualDBA users

CMU SCS Faloutsos/PavloCMU SCS /61573 DDL int.DML proc. query eval. app. pgm(o) trans. mgr emb. DML buff. mgrfile mgr datameta-data query proc. storage mgr. naiveapp. pgmrcasualDBA users

CMU SCS Faloutsos/PavloCMU SCS /61574 Some examples: app. programmer, creating a report, eg main(){.... exec sql “select * from student”... }

CMU SCS Faloutsos/PavloCMU SCS /61575 DDL int.DML proc. query eval. app. pgm(o) trans. mgr emb. DML buff. mgrfile mgr datameta-data query proc. storage mgr. naiveapp. pgmrcasualDBA users pgm (src)

CMU SCS Faloutsos/PavloCMU SCS /61576 Some examples: ‘naive’ user, running the previous app.

CMU SCS Faloutsos/PavloCMU SCS /61577 DDL int.DML proc. query eval. app. pgm(o) trans. mgr emb. DML buff. mgrfile mgr datameta-data query proc. storage mgr. naiveapp. pgmrcasualDBA users pgm (src)

CMU SCS Faloutsos/PavloCMU SCS /61578 Detailed outline Introduction –Motivating example –How do DBMSs work? DDL, DML, views. –Fundamental concepts –DBMS users –Overall system architecture –Conclusions

CMU SCS Faloutsos/PavloCMU SCS /61579 Conclusions (relational) DBMSs: electronic record keepers customize them with create table commands ask SQL queries to retrieve info

CMU SCS Faloutsos/PavloCMU SCS /61580 Conclusions cont’d main advantages over (flat) files & scripts: logical + physical data independence (ie., flexibility of adding new attributes, new tables and indices) concurrency control and recovery