DBMS SRP
DBMS SRP
2. Outer Join (LOJ , ROJ & FOJ) = deal with missing information & return
matching items. Projection = Removes duplicate data +
LOJ = Return matching items of Left table & for non matching return NULL Display data
for right table Selection = Selects but not display
ROJ = Return matching items of Right table & for non matching return Union = Return Unique Data + Same set
NULL for Left table of attributes
FOJ = LOJ + ROJ SRP 3 Intersection = Return common data +
3. Equi Join = Based on matched data as per the equality condition Same set of attributes
Union = Combine 2 or more SELECT queries SQL Set Operation Operator Description
+ Eliminate Duplicate rows. Combine 2 or more
ALL It compares a value to all
Union All = removing duplication & sorting the data. SQL SELECT values in another value set.
Minus = No duplicates + ascending order by default statements. It allows the existence of
AND
Intersection = common rows from both the SELECT multiple conditions in an SQL
statements. ADVANTAGES statement.
i.
ii.
RULES OF SQL
Not case sensitive. In general, keywords in uppercase.
Statements are dependent on text lines. We can use a single SQL
SRP 4 LIKE It compares a value to similar
values using wildcard operator.
SQL GROUP BY statement is used to arrange identical data into groups. Use with SELECT.
HAVING clause is used to specify a search condition for a group or an aggregate.
The ORDER BY clause sorts the result-set in ascending or descending order.
BCNF :
(NORMALIZATION) SRP 6 For each Functional Dependency X Y
X must be a super key.
FIRST NORMAL FORM : R (A,B,C,D)
1. No Composite values A BCD
2. Same kind & unique entries BC AD
3. No 2 rows are identical. D B (Not BCNF)
Key = A, BC
T1 T2 T1 T2
T1 NO T2
YES NO
VIEW T3
CONFLICT SERIALIZABLE ? SERIALIZABLE ?
S1 S2 CONFLICT
VIEW EQUIVALENT ? EQUIVALENT ?
T1 T2 T1 T2
T1 T2 T3 R(A) R(A)
Read(P)
SRP 9 W(A) W(A)
R(A) R(B)
Write(P)
W(A) W(B)
Write(P) S1 R(B) R(A)
Read(P) W(B) W(A)
Write(P)
R1(A) , W2(A) + W1(A) , R2(A) + W1(A) , W2(A)
T1 T2 T3 T1 T2 T1 T2
Read(P) R(X) R(X)
Let X = 2 and Y = 5.
Write(P) X=X+5 X=X+5
Wait_Die : An older transaction is allowed to wait for a younger transaction, whereas Concurrency
a younger transaction requesting an item held by an older transaction is aborted and Control
restarted. [OPPOSITE IN WOUNDED WAIT]
SRP 11
SRP 12