Академический Документы
Профессиональный Документы
Культура Документы
MANAGEMENT SYSTEM
Department of Computer Science
St Thomas College Thrissur
Session 1:
Introduction To DBMS
Keys
Functional Dependency
Candidate Key
Decomposition
Normalization
Check The Normal Form
Convert To Normal Form
Session 2:
Transaction Processing
Serializability
SQL Commands
SESSION 1
DBMS
Keys
Composite key
Super key
Candidate key
Prime key attribute
Primary key
Foreign key
Constraints
cardinality ratio (max no of relationship instances in a binary relation
participation constraint existence of an entity depends on another
Total
Partial
Relational schema
Table of records
Cardinality (tuples)
Degree (attributes)
Granularity (size of data item)
Relational constraints
Domain constraint
Key constraint
entity integrity
Referential
Semantic integrity
Select
KEYS
uniquely identify tuple
primary key
Candidate key : unique & irreducibility
Super key : uniqueness
Foreign key
FUNCTIONAL DEPENDENCY
X
XY
XYZ
XZY
XY iff YC X
XY XZYZ
XY, YZ then XZ
If XY, XZ then XYZ
If YX, ZX union is not
possible
If XYZ then XY and XZ
Suppose a scheme R(A,B,C)
F={AB,BC)
then A+ (closure) =A.B.C
B+ = BC
C+ = C
CANDIDATE KEY
Find A+
If all attribute come in A+ then a is candidate key
Steps:
1. Find the attributes that are neither on the left and right side
2. Find attributes that are only on the right side
3. Find attributes that are only on the left side
4. Combine the attributes on step 1 and 3
5. Test if the closures of attributes on step 4 are all the attributes if the
closure does not include all the attributes, we should find the relation
exterior.
6. Find the relation exteriors, that is the attributes not included in step 4 and
step 2. 7. Now test the closures of attributes on step 4 + one attribute in
step 6 one at a time.. This will yield candidate keys.
F CLOSURE
Maximum number of dependencies
Compute all possible closure combinations.
2 to the power (Number of elements) gives the number of dependencies of that
group
Summation of dependencies of each closure gives required result
Note: for all relations is considred
MEMBERSHIP
To check if a dependency defined in a relation write closure of the lhs of the
dependency. If the rhs is present in the closure then its a member.
DECOMPOSITION
Splitting of tables.
Should satisfy
lossless join ( decompose table when we natural join them we find no spurious
tuples its lossless join)
Dependency preservation( the decomposed tables should satisfy all functional
dependencies of parent)
4. if, after all possible changes have been made to S, a row is made up entirely of a
symbols, a(1), a(2), ... , a(n), then the join is lossless. If there is no such row, the join is
lossy.
DEPENDENCY PRESERVING
Closure of FD
Write decomposition separately
Write all the possible fd from the closure
Project all fd to the other
If all fd are in the decomposition then dependency is preserved
NORMALISATION
Property of the relation that indicates the degree of redundancy normal form
Procedure applied on a relation to reduce redundancy normalization
INF values are atomic
2NF INF + no partial dependency( set of non prime key attributes depends on
the part of primary key)
3NF 2NF + no transitive dependency
BCNF every determinant is a candidate or superkey
4NF BCNF+ No multivalued dependency
MINIMAL COVER
END SESSION 1
SESSION 2
TRANSACTION MANAGEMENT
SERIALIZABILITY
RELATIONAL ALGEBRA
SQL COMMANDS