Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: 845-4259 Notes 1."— Presentation transcript:

1 CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: 845-4259 Email: chen@cse.tamu.edu Notes 1

2 large volume of data database system users

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

4 database system users secondary storage (disks) in secondary storage

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

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

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

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

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

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

11 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

12 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?

13 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

14 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

15 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

16 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

17 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

18 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

19 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

20 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

21 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

22 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

23 A Quick Review on Undergraduate Database

24 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

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

26 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?

27 How is information represented by relations?

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

29 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

30 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 4.1-4.4 The Entity/Relationship Model

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

32 Fairly straightforward:

33 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).

34 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

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

36 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?

37 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

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

39 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.

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

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

42 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.

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

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


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

Similar presentations


Ads by Google