Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mid-term Class Review.

Similar presentations


Presentation on theme: "Mid-term Class Review."— Presentation transcript:

1 Mid-term Class Review

2 Relational DB Overview
System architecture of a DBMS SQL* Normal forms (BCNF) Basic concepts and its decomposition (BCNF, 3NF, 4NF (cs710 students only)) *: Bonus question(s) available!

3 System Aspects of SQL Embedded SQL Call-Level Interface (CLI) JDBC
Dynamic SQL Basic concepts Contrast and compare….

4 SQL Authorization and Transactions
Privileges Grant diagram Transactions ACID properties Deep understanding of the 4 isolation levels

5 Alice's transaction is a query:
The relation R(x) consists of a set of integers --- that is, one-component tuples with an integer component. Alice's transaction is a query: SELECT SUM(x) FROM R; COMMIT; Betty's transaction is a sequence of inserts: INSERT INTO R VALUES(10); INSERT INTO R VALUES(20); INSERT INTO R VALUES(30); Carol's transaction is a sequence of deletes: DELETE FROM R WHERE x=30; DELETE FROM R WHERE x=20; Before any of these transactions execute, the sum of the integers in R is 1000, and none of these integers are 10, 20, or 30. If Alice's, Betty's, and Carol's transactions run at about the same time, and each runs under isolation level READ COMMITTED, which sums could be produced by Alice's transaction? In order for Alice to see any of Betty's inserts, Betty must commit, which means that all three inserts are in R. Thus, Alice could compute the sum before Betty or Carol does anything, in which case she gets answer 1000, or after Betty commits but before Carol deletes anything, in which case she gets answer However, we also need to consider the timing of Carol's deletes. She could complete her deletes and commit before Betty starts, in which case Carol has no effect. She could do the deletes after Betty commits, but before Alice reads, in which case, Alice sees only 10 from among Betty's inserts and gets the answer 1010. Another possibility is that Carol starts before Betty commits, deleting 30 (which has no effect on R, since 30 is not in R, at least as far as Carol can see, since Betty has not committed the insert). Then, Betty does her inserts and commits, and Carol deletes 20, leaving 10 and 30 in R. Thus, when Alice reads, she gets the answer 1040. The only other possibility is that Carol starts after Betty commits, but does not get to commit before Alice reads. In that case, Alice cannot see Carol's deletes, and gets the answer 1060.

6 Object-Relational Database
SQL-99 or Oracle for O-R databases. UDT Reference type Method definition Nested tables (basic concepts and operations)

7 Datalog Logical rules Datalog program Safe and unsafe rules ….
Expressive Power of Datalog IDB, EDB Evaluating recursive rules (when no negations) Stratified Model SQL recursions (with clause, see Assignment 3)

8 Hard Disk Disk geometry … Block access time…
Elevator algorithm, double-buffering See Assignment 3

9 Representing Data Elements
Hierarchy of data elements Types of records: Main choices: FIXED vs VARIABLE FORMAT (SCHEMA) FIXED vs VARIABLE LENGTH


Download ppt "Mid-term Class Review."

Similar presentations


Ads by Google