Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPSC-608 Database Systems Fall 2009 Instructor: Jianer Chen Office: HRBB 309B Phone: 845-4259 Notes #2.

Similar presentations


Presentation on theme: "CPSC-608 Database Systems Fall 2009 Instructor: Jianer Chen Office: HRBB 309B Phone: 845-4259 Notes #2."— Presentation transcript:

1 CPSC-608 Database Systems Fall 2009 Instructor: Jianer Chen Office: HRBB 309B Phone: 845-4259 Email: chen@cs.tamu.edu Notes #2

2 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

3 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 A Quick Review on Undergraduate Database

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

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

6 How is information represented by relations?

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

8 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

9 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

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

11 Fairly straightforward:

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

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

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

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

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

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

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

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

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

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

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

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


Download ppt "CPSC-608 Database Systems Fall 2009 Instructor: Jianer Chen Office: HRBB 309B Phone: 845-4259 Notes #2."

Similar presentations


Ads by Google