Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPSC-608 Database Systems

Similar presentations


Presentation on theme: "CPSC-608 Database Systems"— Presentation transcript:

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

2 Undergraduate Database
A Quick Review on Undergraduate Database

3 Database is just another model of information processing
(in disks) Then why study DB? Much more data, regular data techs would be very inefficient: How should data be stored? Operations are simpler & more specific: How do we take advantage of it? New programming languages for the above. (ACID) Reliability, security, consistency, currency π, σ, ρ, ∩, ⋃, \, ╳, ⋈, ⋈C SQL

4 How is Information Represented?
How can everything be given by tables? Well, information consists of objects/items and relationships among items; An item has certain properties, which can be listed in a row. Thus, a collection of similar items can be given as a table, one row for an item; A relationship can be given by listing each item group that satisfies the relationship; High-level representation of information (E-R Diagram: read Chapter 4)

5 Table structures (terminologies)
A relation schema gives the name of the relation and its attributes; A database schema gives the schemas for all relations in the database; Schemas affects how the data is stored; Database schemas are given and altered using database definition language (DDL); Only database administrator can use DDL.

6 What is a good DB schema?

7 What is a good DB schema? What is a good table structure? Fat or thin?

8 What is a good DB schema? What is a good table structure? Fat or thin?
More important: how can tables guarantee information consistency?

9 What is a good DB schema? What is a good table structure? Fat or thin?
More important: how can tables guarantee information consistency? There is a beautiful theory (functional dependency) for constructing a good database schema;

10 What is a good DB schema? What is a good table structure? Fat or thin?
More important: how can tables guarantee information consistency? There is a beautiful theory (functional dependency) for constructing a good database schema; Read Chapter 3.

11 Database is just another model of information processing
(in disks) Then why study DB? Much more data, regular data techs would be very inefficient: How should data be stored? Operations are simpler & more specific: How do we take advantage of it? New programming languages for the above. (ACID) Reliability, security, consistency, currency π, σ, ρ, ∩, ⋃, \, ╳, ⋈, ⋈C SQL

12 Database is just another model of information processing
(in disks) Then why study DB? Much more data, regular data techs would be very inefficient: How should data be stored? Operations are simpler & more specific: How do we take advantage of it? New programming languages for the above. (ACID) Reliability, security, consistency, currency π, σ, ρ, ∩, ⋃, \, ╳, ⋈, ⋈C SQL

13 What are the operations?

14 What are the operations?
Most DB operations are queries, e.g., “what is the balance of the account 12345?” which is involved in

15 What are the operations?
Most DB operations are queries, e.g., “what is the balance of the account 12345?” which is involved in * identify relations that are related to the queried information;

16 What are the operations?
Most DB operations are queries, e.g., “what is the balance of the account 12345?” which is involved in * identify relations that are related to the queried information; * search/organize the relations and collect the related information;

17 What are the operations?
Most DB operations are queries, e.g., “what is the balance of the account 12345?” which is involved in * identify relations that are related to the queried information; * search/organize the relations and collect the related information; * edit and output the queried information.

18 What are the operations?
Most DB operations are queries, e.g., “what is the balance of the account 12345?” which is involved in * identify relations that are related to the queried information; * search/organize the relations and collect the related information; * edit and output the queried information. Less often: modifications on relations;

19 What are the operations?
Most DB operations are queries, e.g., “what is the balance of the account 12345?” which is involved in * identify relations that are related to the queried information; * search/organize the relations and collect the related information; * edit and output the queried information. Less often: modifications on relations; These operations are given by data manipulation language (DML)

20 What are the operations?
The DML operations on relations can be implemented by the basic operations: * projection π and selection σ * set operations * joins * renaming ρ

21 What are the operations?
The DML operations on relations can be implemented by the basic operations: * projection π and selection σ * set operations * joins * renaming ρ There is a beautiful (mathematical) theory (relational algebra) that sets the foundation for these basic operations;

22 What are the operations?
The DML operations on relations can be implemented by the basic operations: * projection π and selection σ * set operations * joins * renaming ρ There is a beautiful (mathematical) theory (relational algebra) that sets the foundation for these basic operations; Read Chapters 2 and 5.

23 Database is just another model of information processing
(in disks) Then why study DB? Much more data, regular data techs would be very inefficient: How should data be stored? Operations are simpler & more specific: How do we take advantage of it? New programming languages for the above. (ACID) Reliability, security, consistency, currency π, σ, ρ, ∩, ⋃, \, ╳, ⋈, ⋈C SQL

24 Database is just another model of information processing
(in disks) Then why study DB? Much more data, regular data techs would be very inefficient: How should data be stored? Operations are simpler & more specific: How do we take advantage of it? New programming languages for the above. (ACID) Reliability, security, consistency, currency π, σ, ρ, ∩, ⋃, \, ╳, ⋈, ⋈C SQL

25 Database is just another model of information processing
(in disks) Then why study DB? Much more data, regular data techs would be very inefficient: How should data be stored? Operations are simpler & more specific: How do we take advantage of it? New programming languages for the above. (ACID) Reliability, security, consistency, currency π, σ, ρ, ∩, ⋃, \, ╳, ⋈, ⋈C Will get back to this with more details. SQL

26 Database is just another model of information processing
(in disks) Then why study DB? Much more data, regular data techs would be very inefficient: How should data be stored? Operations are simpler & more specific: How do we take advantage of it? New programming languages for the above. (ACID) Reliability, security, consistency, currency π, σ, ρ, ∩, ⋃, \, ╳, ⋈, ⋈C SQL

27 Database is just another model of information processing
(in disks) Then why study DB? Much more data, regular data techs would be very inefficient: How should data be stored? Operations are simpler & more specific: How do we take advantage of it? New programming languages for the above. (ACID) Reliability, security, consistency, currency π, σ, ρ, ∩, ⋃, \, ╳, ⋈, ⋈C SQL Will be studied in graduate database

28 Process of Database Development
Description of the database application High-level representation of the database (E-R diagram) Chapter 4 Converting the E-R diagram into relations (tables) Developing database operations (using DML) Chapter 4 Chapters 6-8 Relation normalization Developing database application user interface Chapter 3 Chapter 9 Defining database schema (using DDL) Testing Chapter 2

29 Process of Database Development
Description of the database application High-level representation of the database (E-R diagram) Chapter 4 Converting the E-R diagram into relations (tables) Developing database operations (using DML) Chapter 4 Chapters 6-8 Relation normalization Developing database application user interface Chapter 3 Chapter 9 Defining database schema (using DDL) Testing Chapter 2

30 Process of Database Development
Description of the database application High-level representation of the database (E-R diagram) Chapter 4 Converting the E-R diagram into relations (tables) Developing database operations (using DML) Chapter 4 Chapters 6-8 Relation normalization Developing database application user interface Chapter 3 Chapter 9 Defining database schema (using DDL) Testing Chapter 2

31 Process of Database Development
Description of the database application High-level representation of the database (E-R diagram) Chapter 4 Converting the E-R diagram into relations (tables) Developing database operations (using DML) Chapter 4 Chapters 6-8 Relation normalization Developing database application user interface Chapter 3 Chapter 9 Defining database schema (using DDL) Testing Chapter 2

32 Process of Database Development
Description of the database application High-level representation of the database (E-R diagram) Chapter 4 Converting the E-R diagram into relations (tables) Developing database operations (using DML) Chapter 4 Chapters 6-8 Relation normalization Developing database application user interface Chapter 3 Chapter 9 Defining database schema (using DDL) Testing Chapter 2

33 Process of Database Development
Description of the database application High-level representation of the database (E-R diagram) Chapter 4 Converting the E-R diagram into relations (tables) Developing database operations (using DML) Chapter 4 Chapters 6-8 Relation normalization Developing database application user interface Chapter 3 Chapter 9 Defining database schema (using DDL) Testing Chapter 2

34 Process of Database Development
Description of the database application High-level representation of the database (E-R diagram) Chapter 4 Converting the E-R diagram into relations (tables) Developing database operations (using DML) Chapter 4 Chapters 6-8 Relation normalization Developing database application user interface Chapter 3 Chapter 9 Defining database schema (using DDL) Testing Chapter 2

35 Process of Database Development
Description of the database application High-level representation of the database (E-R diagram) Chapter 4 Converting the E-R diagram into relations (tables) Developing database operations (using DML) Chapter 4 Chapters 6-8 Relation normalization Developing database application user interface Chapter 3 Chapter 9 Defining database schema (using DDL) Testing Chapter 2

36 Process of Database Development
Description of the database application High-level representation of the database (E-R diagram) Chapter 4 Converting the E-R diagram into relations (tables) Developing database operations (using DML) Chapter 4 Chapters 6-8 Relation normalization Developing database application user interface Chapter 3 Chapter 9 Defining database schema (using DDL) Testing Chapter 2

37 Process of Database Development
Description of the database application High-level representation of the database (E-R diagram) Chapter 4 Converting the E-R diagram into relations (tables) Developing database operations (using DML) Chapter 4 Chapters 6-8 Relation normalization Developing database application user interface Chapter 3 Chapter 9 Defining database schema (using DDL) Testing Chapter 2

38 Database is just another model of information processing
(in disks) Then why study DB? Much more data, regular data techs would be very inefficient: How should data be stored? Operations are simpler & more specific: How do we take advantage of it? New programming languages for the above. (ACID) Reliability, security, consistency, currency π, σ, ρ, ∩, ⋃, \, ╳, ⋈, ⋈C Back to this with more details. SQL

39 SQL: Structured Query language

40 SQL: Structured Query language
a very-high-level language.

41 SQL: Structured Query language
a very-high-level language. * say “what to do” rather than “how to do it.”

42 SQL: Structured Query language
a very-high-level language. * say “what to do” rather than “how to do it.” * avoid a lot of data-manipulation details needed in procedural languages like C or Java.

43 SQL: Structured Query language
a very-high-level language. * say “what to do” rather than “how to do it.” * avoid a lot of data-manipulation details needed in procedural languages like C or Java. Database management system figures out the “best” way to execute queries * called “query optimization”

44 SQL: Structured Query language
a very-high-level language. * say “what to do” rather than “how to do it.” * avoid a lot of data-manipulation details needed in procedural languages like C or Java. Database management system figures out the “best” way to execute queries * called “query optimization” For both data definition and data manipulation.


Download ppt "CPSC-608 Database Systems"

Similar presentations


Ads by Google