CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: 845-4259 Notes 1.

Slides:



Advertisements
Similar presentations
Relational Database and Data Modeling
Advertisements

Chapter 12 File Processing and Data Management Concepts
Chapter 3 : Relational Model
CS 540 Database Management Systems
The Relational Database Model
Midterm Review Lecture 14b. 14 Lectures So Far 1.Introduction 2.The Relational Model 3.Disks and Files 4.Relational Algebra 5.File Org, Indexes 6.Relational.
CPSC-608 Database Systems Fall 2009 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #2.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #10.
CPSC-608 Database Systems Fall 2010 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #9.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #7.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #6.
Organizing Data & Information
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #4.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #11.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #13.
CPSC-608 Database Systems Fall 2010 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #5.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #9.
CPSC-608 Database Systems Fall 2008 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #3.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #12.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #14.
CPSC-608 Database Systems Fall 2010 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes 1.
CPSC-608 Database Systems Fall 2010 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #6.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #2.
CSCD34 - Data Management Systems,- A. Vaisman1 CSC D34 - Data Management Systems Instructor: Alejandro Vaisman University of Toronto.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
Introduction to Databases and Database Languages
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
CS 474 Database Design and Application Terminology Jan 11, 2000.
CHAPTER 8: MANAGING DATA RESOURCES. File Organization Terms Field: group of characters that represent something Record: group of related fields File:
Introduction to Database Management Systems. Information Instructor: Csilla Farkas Office: Swearingen 3A43 Office Hours: Monday, Wednesday 4:15 pm – 5:30.
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,
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
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.
Introduction to Database Management Systems. Information Instructor: Csilla Farkas Office: Swearingen 3A43 Office Hours: Monday, Wednesday 2:30 pm – 3:30.
1 CS3431 – Database Systems I Introduction Instructor: Mohamed Eltabakh
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
CPSC-608 Database Systems Fall 2015 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #6.
CPSC-608 Database Systems Fall 2015 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #5.
CS3431: C-Term CS3431 – Database Systems I Introduction Instructor: Mohamed Eltabakh
Database Environment Chapter 2. The Three-Level ANSI-SPARC Architecture External Level Conceptual Level Internal Level Physical Data.
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 1: INTRODUCTION Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Storage Management Database.
CPSC-310 Database Systems
Scholastic Dishonesty
CPSC-608 Database Systems
CPSC-608 Database Systems
Introduction What is a Database?.
CPSC-310 Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
Introduction to Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
Scholastic Dishonesty
CPSC-608 Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
CPSC-608 Database Systems
Presentation transcript:

CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes 1

large volume of data database system users

large volume of data database system users where do we store them?

database system users secondary storage (disks) in secondary storage

database system users secondary storage (disks) how are the data organized?

database system users secondary storage (disks) in tables (relations)

database system users secondary storage (disks) in tables (relations) how do we define relations?

database system users secondary storage (disks) in tables (relations) database administrator DDL language

database system users secondary storage (disks) in tables (relations) database administrator DDL language how do we manipulate relations?

database system secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language

database management system secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language simply translate database programs into machine programs

database management system secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language simply translate database programs into machine programs then what is the difference between DBMS and a programming language compiler?

secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language then what is the difference between DBMS and a programming language compiler? 1. it has to deal with data stored in hierarchical memory structures DBMS file manager buffer manager main memory buffers

secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language then what is the difference between DBMS and a programming language compiler? 2. it has to support efficient manipulations of data in hierarchical memory structures DBMS file manager buffer manager main memory buffers index/file manager

secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language then what is the difference between DBMS and a programming language compiler? 3. it needs to translate the input database program into an internal representation DBMS file manager buffer manager main memory buffers index/file manager DML complier DDL complier

secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language then what is the difference between DBMS and a programming language compiler? 4. it needs to produce efficient internal codes dealing with data in hierarchical memory structure DBMS file manager buffer manager main memory buffers index/file manager DML complier DDL complier query execution engine

secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language then what is the difference between DBMS and a programming language compiler? 5. it needs to be consistent DBMS file manager buffer manager main memory buffers index/file manager DML complier DDL complier query execution engine transaction manager concurrency control lock table

secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language then what is the difference between DBMS and a programming language compiler? 6. it needs to be reliable DBMS file manager buffer manager main memory buffers index/file manager DML complier DDL complier query execution engine transaction manager concurrency control lock table logging & recovery

secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language DBMS file manager buffer manager main memory buffers index/file manager DML complier DDL complier query execution engine transaction manager concurrency control lock table logging & recovery

secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language DBMS file manager buffer manager main memory buffers index/file manager DML complier DDL complier query execution engine transaction manager concurrency control lock table logging & recovery undergraduate database

secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language DBMS file manager buffer manager main memory buffers index/file manager DML complier DDL complier query execution engine transaction manager concurrency control lock table logging & recovery graduate database

secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language DBMS file manager buffer manager main memory buffers index/file manager DML complier DDL complier query execution engine transaction manager concurrency control lock table logging & recovery graduate database

A Quick Review on Undergraduate Database

secondary storage (disks) in tables (relations) database administrator DDL language database programmer DML (query) language DBMS file manager buffer manager main memory buffers index/file manager DML complier DDL complier query execution engine transaction manager concurrency control lock table logging & recovery

We have agreed Information (i.e., database) is organized in tables (i.e., relations) stored in disks.

We have agreed Information (i.e., database) is organized in tables (i.e., relations). ● How is information represented by relations? ● What are “good” table structures? ● What operations can we apply on tables?

How is information represented by relations?

Information consists of ● objects (i.e., entities) plus ● connections (i.e., relationships) among entities

How is information represented by relations? Information consists of ● objects (i.e., entities) plus ● connections (i.e., relationships) among entities Thus, information can be given by Entity/relationship (R/E) diagrams

How is information represented by relations? Information consists of ● objects (i.e., entities) plus ● connections (i.e., relationships) among entities Thus, information can be given by Entity/relationship (R/E) diagrams Read: Sections The Entity/Relationship Model

How to convert E/R diagrams into relations (i.e., tables)?

Fairly straightforward:

How are E/R diagrams converted into relations (i.e., tables)? Fairly straightforward: ● an entity set is given by a table where each column corresponds to a property (i.e., attribute) of the entities; ● a relationship among entities is given by a table whose columns correspond to the identifications of the related entities (that now become attributes).

How are E/R diagrams converted into relations (i.e., tables)? Fairly straightforward: ● an entity set is given by a table where each column corresponds to a property (i.e., attribute) of the entities; ● a relationship among entities is given by a table whose columns correspond to the identifications of the related entities (that now become attributes). Read: sections 4.5. From E/R Diagrams to Relational Designs

What are “good” table strcutures? ● have no inconsistency; ● avoid redundancy; ● easy to use

What are “good” table strcutures? ● have no inconsistency; ● avoid redundancy; ● easy to use Typical questions: ● Should we split a table when it is too fat? ● Should we merge tables when they are too thin?

What are “good” table strcutures? ● have no inconsistency; ● avoid redundancy; ● easy to use Typical questions: ● Should we split a table when it is too fat? ● Should we merge tables when they are too thin? Read: Chapter 3. Design Theory for Relational Databases

Some terminology namemanf WinterbrewPete’s Bud LiteAnheuser-Busch Beers Attributes (column headers) Tuples (rows) Relation, attribute, tuples a relation

Some terminology Keys and superkeys Superkey: a set of attributes that uniquely determines a tuple; Key: a superkey that does not contain any smaller superkey.

Some terminology Relation schema: relation name and attribute list. Database schema: set of all relation schemas in the database. Database: collection of relations.

Relational operations Typically, selecting tuples that meet a given condition.

Relational operations Core relational operations: Union, intersection, and difference. –Usual set operations; –Extended to bags Selection: picking certain rows. Projection: picking certain columns. Products and joins: compositions of relations. Renaming of relations and attributes.

Relational operations extended relational operations: ● δ = eliminate duplicates from bags. ● τ = sort tuples. ● γ = grouping and aggregation.

Relational operations extended relational operations: ● δ = eliminate duplicates from bags. ● τ = sort tuples. ● γ = grouping and aggregation. Read: Chapter 5 Algebraic and Logical Query Languages