You are on page 1of 144

190280107111 Div.

: B

Certificate

This is to certify that


Shri/Ms Patel Sudhanshu R, Enrollment No.
190280107111 of B.E. Sem-3 class has
satisfactory completed the course in Database
Management System - 3130703 within four
walls of L. D. College of Engineering,
Ahmedabad-380015.

Date of submission. 2nd November, 2020


Staff in-Charge Prof. Amita Shah
Head of Department Dr. S. M. Shah

LDCE-AHM 1
1
190280107111 Div. : B

L D COLLEGE OF ENGINEERING AHMEDABAD


COMPUTER ENGINEERING DEPARTMENT

VISION
To achieve academic excellence in Computer Engineering by providing
value based education.

MISSION
1. To produce graduates according to the needs of industry, government,
society and scientific community.

2. To develop partnership with industries, research and development


organizations and government sectors for continuous improvement of
faculties and students.

3. To motivate students for participating in reputed conferences, workshops,


seminars and technical events to make them technocrats and entrepreneurs.

4. To enhance the ability of students to address the real life issues by applying
technical expertise, human values and professional ethics.

5. To inculcate habit of using free and open source software, latest technology
and soft skills so that they become competent professionals.

6. To encourage faculty members to upgrade their skills and qualification


through training and higher studies at reputed universities.

LDCE-AHM 2
2
190280107111 Div. : B

MARKS OUT OF 20
Sr. Title Page Date Grade Sign
C1 C2 C3 C4
No. No.
(5) (5) (5) (5)
1. PRACTICAL-1 4

2. PRACTICAL-2 15
3. PRACTICAL-3 26
4. PRACTICAL-4 40
5. PRACTICAL-5 50
6. PRACTICAL-6 60

7. PRACTICAL-7 64
8. PRACTICAL-8 71
9. PRACTICAL-9 74
10. PRACTICAL-10 79

Grading Criteria (C1) Understanding Concepts Grading Scale : A – Above 17 (Excellent)


(C2) Logic Designing B – 13 to 16 (Good)
(C3) Program Execution C – 10 to 12 (Fair)
(C4) Final Output D – Below 10 (Poor)
A, B, C are Passing Grades. D is Failing Grade.

LDCE-AHM 3
3
190280107111 Div. : B

PRACTICAl-1

Create a table : ACCOUNT

Create a table : LOAN

LDCE-AHM 4
4
190280107111 Div. : B

1.Insert the records if you have not inserted in PRACTICAL-1.

2.Change the name ‘PATEL JIGAR’ to ‘PATEL HIREN’.

3.Change the name and city where account number is A005.(new name =
‘KOTHARI NEHAL’ and new city = ‘PATAN’).

LDCE-AHM 5
5
190280107111 Div. : B

4.Display only those records where loan taken status is ‘YES’.

5.Add the new column (address varchar2 (20)) into table ACCOUNT.

LDCE-AHM 6
6
190280107111 Div. : B

6.Create another table ACCOUNT_TEMP(acc_no,name,balance) from table


ACCOUNT.

7.Rename the table ACCOUNT to ACCOUNT_MASTER.

LDCE-AHM 7
7
190280107111 Div. : B

8.Update the column balance for all the account holders.(multiply the balance
by 2 for each account holders).

9.Describe the structure of table ACCOUNT.

LDCE-AHM 8
8
190280107111 Div. : B

10.Delete the records whose account no. is A004.

Table : LOAN
1.Insert the records if you have not inserted in PRACTICAL-1.

LDCE-AHM 9
9
190280107111 Div. : B

2.For each loan holders add 100000 Rs. Amount into the column loan_amt.

3.For each loan holders increase the intrest rate 2%.

LDCE-AHM 10
10
190280107111 Div. : B

4.Create another table LOAN_TEMP (loan_no,acc_no,loan_amt,loan_date)


from the table LOAN.

5.Display only those records where loan holders taken a loan in month of
January.

LDCE-AHM 11
11
190280107111 Div. : B

6.Modifiy the structure of table LOAN by adding one column credit_no


varchar2
(4).

7.Display the Loan amount*2 of table LOAN.

LDCE-AHM 12
12
190280107111 Div. : B

8.Display the records of table LOAN by data wise in ascending order.

9.Display the records of table LOAN by account number wise in descending


order.

LDCE-AHM 13
13
190280107111 Div. : B

10.Increase the size 5 to 7 of column acc_no.

LDCE-AHM 14
14
190280107111 Div. : B

PRACTICAL – 2

TABLE : INSTALLMENT
1. Insert following Records if you have not inserted in PRACTICAL-1.

2. Change the Inst_Date ‘2-Feb-04’ to ’3-Mar-04’.

LDCE-AHM 15
15
190280107111 Div. : B

3. Reduce 5000 amount from all Installment holders.

4. Add the amount 5000 where loan no is ‘L003’ and ‘L002’.

LDCE-AHM 16
16
190280107111 Div. : B

5. Change the column size of 5 to 7 where column name is Loan_no.

6. Decrease the column size 5 to 4 where column name Inst_no.

LDCE-AHM 17
17
190280107111 Div. : B

7. Show the structure of the Table.

8. Change the amount 15000 to 5000 where loan number is L001.

LDCE-AHM 18
18
190280107111 Div. : B

9. Perform delete operation. (Delete only particular one record)

10. only create a structure of table installment1 from table installment.

LDCE-AHM 19
19
190280107111 Div. : B

TABLE : TRANSACTIONS
1. Insert a Following Records if you have not inserted in PRACTICAL-1.

LDCE-AHM 20
20
190280107111 Div. : B

2. Insert any duplicate value and display all the records without any
duplicate rows.

3. Select all the records in descending order(account number wise).

LDCE-AHM 21
21
190280107111 Div. : B

4. Display amt, date, and type of transaction by date wise.

5. Create another table TRANSACTION_TEMP from this table.

LDCE-AHM 22
22
190280107111 Div. : B

6. Create a another table TRANS_TEMP by change the column name


acc_no to account_no.

7. Delete a table TRANSACTION_TEMP.

LDCE-AHM 23
23
190280107111 Div. : B

8. Rename the table TRANSACTION to TRANS.

9. Only create a structure of table transaction1 from table transaction.

LDCE-AHM 24
24
190280107111 Div. : B

10. Display account number where type of transaction is ‘D’.

LDCE-AHM 25
25
190280107111 Div. : B

PRACTICAL – 3
Using Operator: NOT,BETWEEN,NOT
BETWEEN,IN,NOT IN
1.Retrieve specified information for the account holder who are not in
‘Ahmedabad’.

2. Retrieve specified information for the account holder who are not in
‘Ahmedabad’.

LDCE-AHM 26
26
190280107111 Div. : B

3.Retrieve those records of Account holder whose balance between is


500000 and 1000000.

4.Display only those records whose amount is 5000, 25000, 30000.

LDCE-AHM 27
27
190280107111 Div. : B

5. Display System date.

6. Find the date,15 days after today’s date.

LDCE-AHM 28
28
190280107111 Div. : B

9. Perform following operation using DUAL table.length of


‘uvpce’,display only month of systemdate.

LDCE-AHM 29
29
190280107111 Div. : B

10. Find the date,20 days before today’s date.

Function Based Queries.


1. Find the total transaction amount of account holder from transaction
table.
LDCE-AHM 30
30
190280107111 Div. : B

2. Find minmum amount of transaction.

LDCE-AHM 31
31
190280107111 Div. : B

3.Find maximum amount of transaction.

4. Count the total account holders.

LDCE-AHM 32
32
190280107111 Div. : B

5. Count only those records whose made of payment is ‘cash’.

6. Count only those records whose transaction made in the month of


‘MAY’

LDCE-AHM 33
33
190280107111 Div. : B

7.Find the average value of transaction.

9.Find the square root of 25.

LDCE-AHM 34
34
190280107111 Div. : B

10. Write the query for the following Function.


LOWER,INITCAP,UPPER,SUBSTR,LENGTH,LTRIM,RTRIM,LPAD,RP
AD.
LOWER

UPPER

LDCE-AHM 35
35
190280107111 Div. : B

SUBSTR

LENGTH

LDCE-AHM 36
36
190280107111 Div. : B

LTRIM

RTRIM

LDCE-AHM 37
37
190280107111 Div. : B

LPAD

RPAD

LDCE-AHM 38
38
190280107111 Div. : B

LDCE-AHM 39
39
190280107111 Div. : B

PRACTICAL – 4
1. Display the sum of balance of account holders who’s live in same city
‘Mehsana’ using group by clause.

2. Display the information about account where balance is less than total
balance of all account holders.

3. Displays the information of account holders whose loan amount and


balance both are same.
LDCE-AHM 40
40
190280107111 Div. : B

4. Display the name of city, remaining loan amount, account, date of


loan and loan number of account holders.

5. Display name of account holder, installment number and installment


amount Whose loan number is ‘L001’.

LDCE-AHM 41
41
190280107111 Div. : B

6. Display name of account holder, city, loan amount and installment


amount.

7. Display the balance of account holders whose balance and remaining


loan both are same.

LDCE-AHM 42
42
190280107111 Div. : B

8. List of all account holders’ information whose balance is same as loan


amount.

9. Display the amount of transaction, name of account holders, account


number and mode of payment whose mode of payment is ‘CHEQUE’.

LDCE-AHM 43
43
190280107111 Div. : B

10. Display account no, loan amount, amount of transaction.

11. List of installment information whose amount is less than average


amount of transaction.

LDCE-AHM 44
44
190280107111 Div. : B

12. Display the sum of installment amount and transaction amount.

13. Display the balance and amount of transaction group by amount and
balance.

LDCE-AHM 45
45
190280107111 Div. : B

14. List of installment number and account number of account holders.

15. Display loan amount, transaction amount and mode of payment


where transaction date and loan taken date both are done in month of
‘MAY’.

LDCE-AHM 46
46
190280107111 Div. : B

16. Display all the information of installment and transaction where


installment date and transaction date both are done in month of ‘JULY’.

17. Display the last three row of account table.

LDCE-AHM 47
47
190280107111 Div. : B

18. Display the balance, mode of payment, loan taken status whose
mode of payment is ‘CHEQUE’ and loan taken is ‘YES’.

19. Retrieve only rows 2 to 5 from account table.

LDCE-AHM 48
48
190280107111 Div. : B

20. Retrieve every even row from an account table.

LDCE-AHM 49
49
190280107111 Div. : B

PRACTICAL : 5

Create a table ACCOUNT.


Column name Data Type Size Attributes
Acc_no Varchar2 5 Primary key / first letter must start with ‘A’
Name Varchar2 30 NOT NULL
City Varchar2 20 NOT NULL
Balance Number 10,2 Balance >=500
Loan_taken Varchar2 3 Values(‘NO’,’YES’)
1. Insert the records using Practical list-1.

LDCE-AHM 50
50
190280107111 Div. : B

Create a Table LOAN.


Column Name Data Type Size Attributes
Loan_no Varchar2 5 Primary Key / first letter must start with ‘L’
Acc_no Varchar2 5 Foreign key References Acc_no of account table
Loan_amt Number 10,2 NOT NULL
Interest_rate Number 5,2 NOT NULL
Loan_date Date
Remaining_loan Number 10,2 Remaining loan<loan amount

1. Insert the records using Practical list-1

LDCE-AHM 51
51
190280107111 Div. : B

Create a table INSTALLMENT.


Column Name Data Type Size Attributes
Loan_no Varchar2 5 Foreign key References Loan_no of Loan table
Inst_no Varchar2 5 first letter must start with ‘I’
IDate Date NOT NULL
Amount Number 10,2 NOT NULL
Insert the records using Practical list-1.

LDCE-AHM 52
52
190280107111 Div. : B

Create a Table TRANSACTION.


Column Name Data Type Size Attributes
Acc_no Varchar2 5 Foreign key References Acc_no of account table
Trans_Date Date NOT NULL
Amt Number 10,2 NOT NULL
Type_of_tr Char 1 Values in (‘D’,’W’)
Mode_of_pay Varchar2 10 Values in (‘cash’,’check’)
1. Insert the records using Practical list-1.

LDCE-AHM 53
53
190280107111 Div. : B

CONSTRAINTS Based queries.

Create a table:STUDENT
Name of column Type and Size
Rollno Varchar2(6)
Name Varchar2(20)
Branch Varchar2(6)
Address Varchar2(20)

LDCE-AHM 54
54
190280107111 Div. : B

1. Add PRIMARY KEY (roll no) and provide constraint name PRIM_rollno.

2. Add NOT NULL constraint to name,branch for student table.

LDCE-AHM 55
55
190280107111 Div. : B

3. Add check constraint and check name is in capital letter.

4. Drop the primary key.

LDCE-AHM 56
56
190280107111 Div. : B

Create a Table REGISTER.


Name of column Type and Size
Rollno Varchar2(6)
Name Varchar2(20)

Add check constraint to check name’s first letter is always capital.

LDCE-AHM 57
57
190280107111 Div. : B

Add NOT NULL constraint to name of register table.

Drop NOT NULL constraint.

LDCE-AHM 58
58
190280107111 Div. : B

LDCE-AHM 59
59
190280107111 Div. : B

PRACTICAL : 6

1. What is view? Explain in detail.

In SQL, a view is a virtual table based on the result-set of an SQL statement.

A view contains rows and columns, just like a real table.

The fields in a view are fields from one or more real tables in the database.

You can add SQL functions, WHERE, and JOIN statements to a view and present the data as
if the data were coming from one single table.

A view always shows up-to-date data.

The database engine recreates the data, using the view's SQL statement, every time a user
queries a view.

2. Create a view vw_emp on employee table

LDCE-AHM 60
60
190280107111 Div. : B

LDCE-AHM 61
61
190280107111 Div. : B

3. Insert a value (E001,Anil,Ahmedabad,50000) into vw_emp;

4.Delete a record from view where employee no is E002.

5. Change the city Ahmedabad to Gandhinagar where emp_no=E001 of vw_emp.

LDCE-AHM 62
62
190280107111 Div. : B

LDCE-AHM 63
63
190280107111 Div. : B

PRACTICAL : 7

1. Write queries for the following tables.


T1 (Empno, Ename, Salary, Designation), T2 (Empno, Deptno.)
(1) Display all rows for salary greater than 5000.

SELECT * FROM T1
WHERE Salary > 5000;

(2) Display the deptno for the ename=’syham’.

SELECT T2.Deptno FROM T2,T1

WHERE T1.Empno = T2.Empno AND T1.Ename = “syham”;

(3) Add a new column deptname in table T2.

ALTER TABLE T2
ADD deptname varchar(20);

(4) Change the designation of ename=’ram’ from ‘clerk’ to ‘senior clerk’.

UPDATE T1
SET Designation = “senior clerk”
WHERE Ename = “ram”;

(5) Find the total salary of all the rows.

SELECT SUM(Salary) from T1;


LDCE-AHM 64
64
190280107111 Div. : B

(6) Display Empno, Ename, Deptno and Deptname.

SELECT T1.Empno,T1.Ename,T2.Deptno,T2.Deptname FROM T1,T2


WHERE T1.Empno = T2.Empno;

(7) Drop the table T1.

DROP TABLE T1;

2. Consider following schema and write SQL for given statements.


Student(RollNo, Name, Age, Sex, City)
Student_marks(RollNo, Sub1, Sub2,Sub3,Total,Average)
Write query to
(i) Display name and city of students whose total marks are greater than 225.

SELECT Student.Name,Student.City FROM Student,Student_marks


WHERE Student.RollNo = Student_marks.RollNo AND
Student_marks.Total > 225;

(ii) Display name of students who got more than 60 marks in each subject.

SELECT Student.Name from Student,Student_marks


WHERE Student.RollNo = Student_marks.RollNo
AND Student_marks.Sub1 > 60
AND Student_marks.Sub2 > 60
AND Student_marks.Sub3 > 60;

(iii) Display name of city from where more than 10 students come from.

LDCE-AHM 65
65
190280107111 Div. : B

SELECT City FROM Student


WHERE (SELECT COUNT(*) FROM Student GROUP BY City) > 10;

(iv) Display a unique pair of male and female students.

SELECT M.Name AS ‘MALE’,F.Name AS ‘FEMALE’

FROM Student M,Student F

WHERE M.Sex = ‘M’ AND F.Sex = ‘F’;

3 Implement following relation using SQL query.


Employee(emp_no,emp_name,department,city,salary)
(1) Find all the employee whose emp_no is lessthan 100 and
salary more than 25000 and department is “Account”

SELECT emp_name FROM Employee


WHERE emp_no < 100
AND salary > 25000

AND department = “Account”;

(2) count the no of employee and Sum the salary of all employee

SELECT COUNT (*) ,Sum(salary) FROM Employee;

(3) Delete the employee having minimum salary.

DELETE FROM Employee


WHERE salary = min(salary);

LDCE-AHM 66
66
190280107111 Div. : B

4 (a) Implement following relation using SQL query.


Student(stud_no,stud_name,sub1,sub2,totalmark,percentage)
Create the table, add 5 records and display the data

(b) Calculate total mark and percentage and also arrange the students on
Ascending order of total marks and also makes a view of it.

LDCE-AHM 67
67
190280107111 Div. : B

(c) Update the mark of sub1 of student_no=S002 with 50 and also


Calculate totalmark and percentage accordingly.

LDCE-AHM 68
68
190280107111 Div. : B

5 Consider the employee data. Give an expression in SQL for the following
query :
Employee(employee-name, street,city)
Works(employee-name, company-name,salary)
Company(company-name, city)
Manages(employee-name, manager-name)
(1) Find the name of all employees who work for State Bank.

SELECT Employee.employee-name FROM Employee,Works


WHERE Employee.employee-name = Works.employee-name

LDCE-AHM 69
69
190280107111 Div. : B

AND Works.company-name = ‘State Bank’;

(2) Find the names and cities of residence of all employees who work for State
Bank.

SELECT Employee.employee-name,Employee.city FROM Employee,Works


WHERE Employee.employee-name = Works.employee-name

AND Works.company-name = ‘State Bank’;

(3) Find all employee in the database who do not work for State Bank.

SELECT Employee.employee-name FROM Employee,Works


WHERE Employee.employee-name = Works.employee-name

AND Works.company-name != ‘State Bank’;

(4) Find all employee in the database who earn more than every employee of
UCO Bank.

SELECT * FROM Works


WHERE salary > (SELECT max(salary) FROM Work GROUP BY company-name
WHERE company-name = ‘UCO Bank’;

LDCE-AHM 70
70
190280107111 Div. : B

PRACTICAL : 8

1 Write down the query for the following table where primary keys are
underlined.
Person(ss#, name, address)
Car(license, year, model)
Accident(date, driver, damage-amount)
Owns(ss#, license)
Log(license, date, driver)

(1) find the total number of people whose cars were involved in accidents in
2009.

SELECT COUNT(*) FROM Accident


WHERE YEAR(date) = 2009;

(2) Find the number of accidents in which the cars belonging to “S.Sudarshan”

SELECT COUNT(*) FROM Accident,Owns,Log


WHERE Accident.driver = Log.driver
AND Log.license = Owns.license
AND Owns.ss# = (SELECT ss# FROM Person WHERE name = ‘S.Sudarshan’);

(3) Add a new customer to the database.

INSERT INTO Person VALUES (‘S132’,’Aman Agraval’,’Ram Nagar’);

INSERT INTO Owns VALUES (‘S132’,’GJ-13-1111’);

INSERT INTO Car VALUES(‘GJ-13-1111’,2010,’Santro’);

LDCE-AHM 71
71
190280107111 Div. : B

(4) Add a new accident recorded for the Santro belonging to “KORTH”

INSERT INTO Accident VALUES (‘30-10-2011’,’KORTH’,5000);

INSERT INTO Log VALUES (‘GJ-13-2222’,’30-10-2011’,’KORTH’);

3 Consider wholesaler of booh schema.


Book(book_id, book_title,publisher,book_price)
( i ) Implement procedure which print details of books whose price is more
than average price. (Use cursor).

Declare @book_id int


Declare @book_title varchar(20)
Declare @publisher varchar(20)
Declare @book_price decimal(10,2)
Declare Book_cursor CURSOR FOR
Select book_title,publisher,book_price FROM Book WHERE book_price >
avg(book_price)

OPEN Book_cursor
Fetch Next from Book_cursor into @book_title,@publisher,@book_price

While(@@FETCH_STATUS = 0)
Begin
Print ‘Book Name = ’ + @book_id
Print ‘Book Publisher = ’ + @publisher
Print ‘Book Price = ’ + @book_price

LDCE-AHM 72
72
190280107111 Div. : B

Fetch Next from Book_cursor into


@book_title,@publisher,@book_price
END
CLOSE Book_cursor
DEALLOCATE Book_cursor

(ii) Write a trigger such that if record is deleted from book table, insert old
record in book_backup table.

CREATE TRIGGER backup_trigger


BEFORE DELETE
ON Book
FOR EACH ROW
BEGIN
INSERT INTO book_backup VALUES
(:old.book_id,
:old.book_title,
:old.publisher,
:old.book_price)
END

LDCE-AHM 73
73
190280107111 Div. : B

PRACTICAL : 9

Unit :1
1 Write a PL/SQL code block to calculate the area of a circle for a value of
radius varying
from 3 to 7.Store the radius and the corresponding values of calculated area in
an empty
table named Areas.

LDCE-AHM 74
74
190280107111 Div. : B

2 Write a PL/SQL Block of code for inverting a number 5639 to 9365.

3 Write a PL/SQL Block of code that will merge the data available in the newly
created
table NEW_BRANCHES with the data available in the table BRANCH_MSTR .if
data in the
first table already exist in the second table then that data should be skipped.

LDCE-AHM 75
75
190280107111 Div. : B

Unit:2
1 Write a PL/SQL block to display whether the given number is Odd or Even.

LDCE-AHM 76
76
190280107111 Div. : B

2 Write a PL/SQL block to display LJIET 10 times using for loop

Unit3:
1 Write a PL/SQL Block to print the sum of numbers from 1 to 50.

LDCE-AHM 77
77
190280107111 Div. : B

2 Write a PL/SQL block to display the detail about given employee from EMP

LDCE-AHM 78
78
190280107111 Div. : B

PRACTICAL : 10

Create Following Tables.


Supplier(s_code, S_name, S_city)
Item(i_code, i_name, u_price)
supplied(s_code, i_code, qty, date)

LDCE-AHM 79
79
190280107111 Div. : B

Solve the following queries.


1. List the suppliers detail who have supplied on 17/12/97.

LDCE-AHM 80
80
190280107111 Div. : B

2. List the name of suppliers who have supplied all the items.

3. List the details of suppliers who have supplied atleast one item supplied by
supplier s504.

LDCE-AHM 81
81
190280107111 Div. : B

4. List the details of items supplied on 27/12/97 having the unit_price less than
Rs. 100.

5. List the details of items supplied between 17/12/97 to 20/12/97.

LDCE-AHM 82
82
190280107111 Div. : B

6.List the name of suppliers who have not supplied any time.

7. List he name of suppliers who have supplied sugur in quantity less than 10
kg in last month.

LDCE-AHM 83
83
190280107111 Div. : B

LDCE-AHM 84
84
190280107111 Div. : B

MARKS OUT OF 20
Sr. Title Page Date Grade Sign
C1 C2 C3 C4
No. No.
(5) (5) (5) (5)
1. Assignment-1 86
2. Assignment-2 92
3. Assignment-3 95
4. Assignment-4 100
5. Assignment-5 114
6. Assignment-6 120
7. Assignment-7 129
8. Assignment-8 133
9. Assignment-9 140
10. Assignment-10 143

Grading Criteria (C1) Understanding Concepts Grading Scale : A – Above 17 (Excellent)


(C2) Logic Designing B – 13 to 16 (Good)
(C3) Program Execution C – 10 to 12 (Fair)
(C4) Final Output D – Below 10 (Poor)
A, B, C are Passing Grades. D is Failing Grade.

LDCE-AHM 85
85
86
87
88
89
90
91
atel Sudiuns/he . /90280109// lASSMALc
Date

Poge
ssignncnt
LaduonLR diagaam Of yous Choicc

Stxeet
Addsess imuy key
Cmp. TDD
CA pust
Em ploype
alcta
Num
(Fnume aba BOD CE
mne
Sunum

2.Depic Concep of qLneulizcution cund Spccializ1kion-


sin CLn FR diuuaam
Gencaalzution
Gencsulihon is the proLess of cxbuiction
COmmo paopcaztics troma Set ot entuties i o
CaCAte a gcnedcalzed entlty bom I is a botom
pCAppsoth Unwhich two moxe Cntitics
CUn he eneaalzed to a
higherLevel enttis
they have S0mc aftaibukes in Cmman
Poz Cxumple
stu dent Cund fually_Can be gencKiz2d
to a highca levcl
entty called pcasanas Shay
Intiyuse Tn ths USE COmmoh CLttibut léke
PName P ADDbecome paat ot higher entty
cnd
speilizedattabu tes Like 5FES become
past ot Speciuli'zed enity (Student )
P- ADD- PER SON PName
s
FHCULT [STUDENT S-FEE 92
/902631071|1 alASSMA
Date
Page

Specialization
LnSpCcializalion, an Cnity is
15 divided
diveded uty
Sub -entitics bucd On thela Chuructenistr'cs.2
top ooaun cppaoh uheac hiyhes tevel Cntii
Specialz.cd into two 0 moe Louweg Leve enttis
o Caumple MPLOYtE entlty in u n tmp bye,
munugenmct System cun be Speciulzcd0to DVELOt
TEsTUR etcus Shawn in bu f1qux lh this Cue foTRu
Luttibutes k c E -Tt f Salaay eBc

L-saly MPLOEE E-name2

TeSTER Devclopoc
To Ty)

3 Expluin total uateipation and w enat set


Using C LA duatmm
The cnty Sels uhich do not huve. Sutti
Otaibuis to foom a paimaoy kc4Q known C
u k nilb Sets Qd the entity
5ets uhlth hue
a poimuo key t kngwn 0s Staon4 entuty sets
h the aw tak entitresdo not hue un
paimun keythey Cannot be 1dcnfio thti a on
50 they depent on Somc othhex
Cnbs hac totul Cntiticy.The cueul
Pasticiotron Constasunt n
dcntifyiny be ku tionship (veth OCunesitenity
Wea cntutics Ragented l t
double OCctang ulua the LR diuuuaa
he LdenttyIn Cwith double diuord
ke CL1toibutes ciae Partiul
Depaeseby dsbk
Lincs
93
19028010]L

TIume dube
Customeð

Stoon
woak
cnLtiy
Lonamau-
94
30280/0t1!I Rtel Slhonshu elassmto
Date
Poge

Hssiqnment3
Ans Join Dpeocution sC to co mbine ntoonutlon faom tuo
0ac aclutions
Join qp coutoa UScol as
thsc ypcs o Join opcaut os
DTheta_jon A B COxB)
2 Cauijoin3 This kindof joinin which theac sis
CuilityCodition betucen tuo ctaibuics f aclations-
3)Natuxal join when thcac Lac common (olu mmS uDd
CL c hax to_Cuule thesc_Cormmons then ue Yscd
nultuaul Loin
X Books M JCVCOSse Booksk 3cueS

Ans-2
DSupea keyIb c set of onc o mazc ataibuts_slthtn
atable that Cun unigutly ialcntity uchacod culhin a
bable
Cey No. slLna Nmc maaks
AL
A2
AA 5
B& g0
A3
CC
Req no and C3oll ho, 8 nr s c his aie
idcnbty JcLoads
2)Canddute keg : 1 is a sinyle attovbu ts oa leasi ominmal
Combinution cettolbutes thett unquely iCty Cach acwd n
twble.
2n abak tryry no ) am aall noa ad dat.

3imuaykey 3a Cidale key ChSSEn by dutabse


designea lo idcntity he tuplc 2n
ackskioruniuely
e In aboe irg l beg._ na) is poimr ke
95
elASSMAte
Date
Page

19025010 211
Bns-3
thc funccions
functions
funtion Thisfunctjans aat
agocgate
Hagacgate
gaovpallogcthca_CLS
ancac1Ialuc_O mattapic ous_Cua
nput o Ceatajn_CaiBcaiaf3omn_c Single Value _
VariouS CLgg20qae fu2nction UJC
5 Mcax )
1D Count O 3 6A g)
2) um j )61in O
RodRod na. Maks
AA LO
50
3

1DCountactuan botul numbcaof acLods


2 Sum actuan he sum of VeluesfascnE_io dttaibut
3)Hug ctuan_Uvaay ye Lalue
) i n3ctuan minimum Uahue acsent in cettaibtte,
attabut
5)lar :etuan Maaimn ValuePScnt n_Ctttajbtte

Hns
elahonul 0pesdtions
Selcction2 pojection Catesian
PJOduCt
Set oln

inteascction Union Set


Coditional Lqual AchaalL
Jon
oin Jon

e Sudenl ocDeTve
Sd SNamc Sid sha
AA 21 do5 2*7-13
BB 2 05 3-3-12
3 CC
O04 S-1-L6s
DD 23 96
cASiniLe
Dare
Page

9025010211
Find numes of ell the studens uho have JescavtSbn:005
Ost udnt-sid 2eSc Gid reseTv
LSbn O05 student X descavc
Outet
Sr Snamne age Sid isbn o
AA 21 5 2-7-18
Bb 8 05 3-3-18
e Customez Acc ount
Name Bunch Bounch
Raipe Pone
umba mumb
A umbu
punc
a l al ualozt heving In allthe bounthes
alu Namc
A

Seled Count (SS 4)foyn Peason _whcae Ss


2 (Sclect SS E fbom Owns cwhex iccKe TN
Select Licence taom log whesc daivez
CSclec?
daivca fom cuaidcm Jhcae datc 2 o1-Jan-09
Cu 3)dcc ))

2)SeloztCouatCdaheltaom caulcident whcac_daive[N


CSelcctdaivca log whcoc lictncc n

Select dalicencc taom OW tuhest Ss t7L


CSelect SS tt aom praSaN Uhedc_namc S.5deaShun JJ
3) nscat into_ peason CSStRume, cddass ales(t1,rehya
siSeat into peuns (SSA, licenc )Vulue C11 ' z '
/nseat Into Cua lluceYeaa madc11 Valucs( L1u2011,'estcenm
fagat inBo (og liccnc idae,daua J Vealucs Z1'Du,lMhan' 97
Dafe-
Page
90 2%0020
CLCcidcnt Ldate,daivco,dammgc mouts)
4 bnscst inta zo0s'ol: 0l- 2011 gpan
/8C nio loz (1hccNe, date doivc ) Valus(
2002 a l t o
nscot lnlo Ca uccne yu made1) Valucstos

os-6
in clationq L Cuc C Aand) VCO) tn93
0pcoction
cuses l
xrstentia C ) am UniuLISUl udntitca slY|
to bird he vanable
Student1 SCSpaVe
S1d Snumae isbn-
21
O 05 2-218
Ram
2 5hyam
Oo5 3-3
16
0 0 --6

F hc f of Studentsnamc or Shadents cuhosc gC21s


Cusiny TRC
T 3 s C SCStudent S29c 1SA TsiaS.Sid/.n9me
5.Sme
Frr the all Shudentswith Cge 18 Csing ORC

Flns-
Pelational algcbau :
1 s upaoccdusal qucay (cenguagakich_1s USC
Lo COLLCSSS duta Dasc tables qm to 3ctaieye thc iitaanth
Lo
in the tom ot aclati0nala
alecbc_ exPXSSION
Poopcat1cs
Tmakes SC of Opcact toas and se uahons as
Opcods
In hio, One oo tuo ehons CeeUSedq inpu cu
thesinglc aclation ieezaied as Output ahat-
name 98
clASSMAte
Date
Page
1902801 11)
cchclutia calgcbocipaodedurseal
Tb besed on scl hcany amdoess not clleu dupliute
Cntaics
It does3nt_oake USe Of uny englsh sutement
mpoata nce
It Paoidcs foamal foundapions a clctional mOdel
PCOtions
Tis4Sa5 a bastar inmplemenBing ad aptimizing
RUCies in uday paxCC5sing

9Some ot hecocpls of ils

cEmOu 1 2 0 (loun))
qmavH 1200 (lun)

3 stona
)Lcustonca-hame (
Lboaaouw.cazUNcaskbmez-pemedcpasitaa
tustonta TumE hsowC ators-NO depi1teI)

cutornea nuse boendh-remt ouridye"


numw : locnloan-humchej- Lbosaacucal a n ) l )
custornerAName L baoreh-neme Peaurnidqe (Gho.odr
humbca loun.Jean-humbe Cboomuea M lalnD) stana
nume Ldepositez

eustomezname t boonh name Peany 3idge yrotttö4


namb Loanloqn number hoasowes lotn))
U1Cstomt name lcpositc

99
Patel Sudha nshu R ASSMAte
Date
Page
Hssignment u 19028O10i1
LWhoat is tzansacbion yplain the ACUDDaaper ties.
A toansaction cun btdcincd a 9oup of
tusksbaat rom 5ing logical unit
unit
i Atomitity
Ths_p3opoty Stores that each tansaction must be
Considcd C CL singleunit end must be mpleted
ully On not Complcied at all

L)Consisktncy
hcdatubasc
The 12nust 2cmain ln consistcat state Ofte

o tnpcatoaningcu tadnscction.

CIsolation
Ln databusc Sy stem whoat mo than onc tounset e
In btin;
cLac exccuted simulobaneo usly_and in a patulle
thc
thc paoptaty of isalation state thatall the tzansatioa
Cal be coHed sut a r xeLuteds it is thc only
adnsaction n theSystcn

iv Dhuzab1lity
Thedatabais shauld beStaanenaueht hunck ang
System failuac

2 Delinc tacnscctton xplain Vaios stotc or tadnsuction-


Cithdiugaam
tzansactian canbedetincd a q7oup oi task)
hdt trgmLegicul t

Taansuction skafes
Hcervc:This isthe Fias Skaie_Ofanisáthicn
inseziion delcbion o Plutron- cCazdis dobne
hea 100
alassmate
Dale
Page
190260io7111
3Paatially commilkd
Whcna taunsachon exccuttd 15 tinal pcaatrin
itis Said to be patiuLLy Conmmtted stutc

Perbtially Comittc
COm bea

trve End

fd failed boated

3)tailed: Layns@d ion Sad t be_ failed sate


ony o he checks noe y hedata bas cCJVezy
Systena fauls

O Hhorted Zi then h
taansachtan is faild da exe cute
datubu5 secovez SYskem_wLlLmike Su22 thui the

dutcnbase n pacyiaus ConsUtent_ Stte

5 Commilecd7r a tocunsa.ction CrccuBes all IEs opeaation


5LCCeSSÍully i t _ I S K i d la be commilte This js the
Sst Sep oftaunsuction

3Explun canllrct Scakalizaailiy uth Xumtplc-


Suppac touo ounSaction and
ACthc instouction _in_L Cand T 2espckivci-
hen thex two taani a Suid tobe C o n f l i c t
Scaiclizuble if both the nstauckion aciess_the

i)heac hould bc_dfteacnt laansuchon


) The_pcaq kioh ms be_etoned Sarne_dctu Hcmu
) O bt tr paahons mus be the waileouhon- 101
ASSMAte
Date
PGge

estmy foz ScaLaliZubility 1902%31ot


To test the_cantict
G
Scaializubilly eC dn d ydph
a
(V,E) uheac : Vcatrce) which pocscni
tatl nscActign_ the 0.ot
Eedgcc cuncontlicim pus
StLp i Cacate a nodc fo cach_toynsaction
Stcp 2 md thc confLrckingPClas On he some vaicble
Step 3 Da dge foa the venschcdlc
execule aiteCI beto T excLtyke eud cO) the
daua cdge taom I and T
2Li_Cxccute accd C ) betoa: exccute aite (a) ths
datoedge taom T as
_execuies ahe (a2 befozs T Gecut es U3Tte (9)
Then dau Cdgc iam T: o T
e

L T T
RCA
RLA)
RCA
CA
CA

RCD)
LawlA)
Shep1 We aibl cid laopatop tobotlom qod buih a
paccedentc 9zuphfos
fo30tliciing enlaics
Skep 2 hea S no(YCIein the Pcctdehcc
As heat uph
he ajxen 5equcnu Conflict SCataltion
Step 3 Ascleulizability Otdca thethe taans n he
obtaincd by tinding Îmcr 0de Cosisten alia-
the puaiel 7dca poccedcne
cp.24 End Jhe Caict ahich hs ha Incomny iJe
whrh p(timlly imd the vcatea huyuing no agoin, 102
ASSMAe

190280
SCializability_th Coniikt s2i h74
Dafeacnt icake jicao
Véc gaailuzablity
Contic Scaalizability
wo Schcdula aacSuct
wo Sdhedules a Said o
be Contlict enVLilcnl i be viC 22VIhe ordca d t
allthcconilictn opaation inlhal c a d t i n a wziie
in both the: SChcaule T and updatc dIations -
XCCUBCin the 5ame dcthc Samc in botih Schedule
L Sdhesdlc is_contlict LI schcdvlc i vitw u t o
Cuto iks Scala Scheoule1t5 Scaia Shcdles

a schaddle yic sezl schedule js antiia


then itma or may not be scaiclizubleihen i s als u
Conilict Sczializahle SCializable Schcle

onfhc n_be easllg Lte ca s tlher dTTiAII


achived by 3CLazd ing theko_4chieve
p cutiens af tua tansshould poioam 5imuluz_CLetlD

31ha i deudlock auhen ii_acCuzs und ho


-yOld it
eudlotk a specitieconcusL p2oblcm_in_ahkh
ksaansationdeppeind an caih Cthe to rez
Somctnin
Detinatton
Systm '3_in degallock stoac ift theae CL
Stt ofbaansactionSuch thut_eNery tJunsLctian nn
sct of GUaitn9 fo_anothca taunsaction in thc S

TheTheoc a tant1tían
OCCua 103
clasSMAte
Dote
Page
902slo7
1 Mutal Cxcd1s ion condillon ha ms6 be c
Ves orce
Ehat
CLDY2 19ues uddi hona
a bclng hcld by 3thes
p3occsscs
2nthesystC
2 Plold
and aarb_cordation paocess tha
canbbc usgd b morethat OYepgoce5
af t bime

3 NoPacmpban conditron A 3CSeresCan+he


frisciby- tahon aon pases the
ParoLess Cun e leus c ez 0sUate thoi i belny held
CCulaz i t Condition
canditiarehcrInt A=
Ltinykarae e lhelt_ hein helal be
Selond ecadPHces_CuaItin_foy ia-
a c a0. touo_Eechgniaues taa
uscs dedlzk mgid
Wuil ic
2 ) J0u-aaii

EpJarn eg-Bc SeS RLcoaye4r Shajia a ag221


techqiae
L o y is the mgsk Commonly uSCd Stanmutae
modi tLLationsth Cs to be made in uLtyal
dedabuse Hencc during the cLOVLIY paoEcdube
o9 til IS muin tiagd
aq rcwor mdian toustypa ak opcrctians
2 Ulaie)loy acco
Comil 2 log ccoad iCgmnil2 104
LAbat lo RcO3 T:9boat
elassMAte
Date
Page
901501o11
Thcx t ayp3oah3s la hasco n
ODettcsacd dutahase moditica, bion
Inthi tcch ahabase 1 not update
Tbhis Lechit a tunsacbion Illb het
caching LsCamml painh \t j l l na hac
changed dutabuse cany aay hena thei :
ncedfox
ced
the UNDO pca0tionthc l O dpm
UBtdlo ccod the pcaution 3amlag ie to
phSiccal database

2)lmocdi aBe. Datehuse máditiccatian.


n has lech he database 15 duainthe
executfan at tans.actian bctoc CLEhes
commilspoitI he tacnsahan Ces
il bctoae t 2cachcs to Es_commt pon
the a 10LBACk_Ope2a tron heal to be danc ta
baing
baing- he dcitabase fo its casTez Consisla Stut
hat mauns the ffc at apcacatranheed to be
Udonc on the dakbase

6Epaja megie1pnp Baselcantaal


Tmestamp padcalng panhacal 5 C schen
2n nich the Oadca of_taancctian decdea n
bascdon hela timestcmps. Thusthc
schtdule 0acscalalizrd CiccOJdnj to }heta mesfam

he indiu timestam 2dca)ny paotacol_ensuaes


thot ny Conflrctingacd and àaiteOpeyclier
usc xecuted intimestanp ODaca aagc -
timsto op nd icqlcd modc OCccnt taa SLchie
O iL (CLlSs Callcd
Ccssen bme dompe ndicute otten JaansCLLh
105
cASSMAte

Dcte -
Paga

DHMSialn tuin he tallcaig


to Cud duu ie the
Yuhurs
hc bnanp On abh bjal K aas lastVend
)
RTSCA Tsl1,)
:
772e bimcStom2 on ahich obfact xo las
uis (x
(ttcn
ddtd
aansacion T gtcmps to oatosm Soc uchion_on
n d ee Call hetEime_
LC x on Sonmi hmctump
staany osdeing Lso al_heti to
Siamo 0s
S1am 77).0
ansaction h a to he Ob0zted
ecide hcthca
on Com Continu ekccution

descanbeImmedide datuhasc_mahication tax=


Baetly ly
loy basca accoCy
Inhis technaue the databsa in upke duain the
txecilion of taansuctid4 eren_if auches ts Comp
paini the tinsacilon gcl_il A beto it
2eachCs to Is Camn point thcn_Hhe a ROLLBACk
oR0cions necds t be done ta bei the dutdbgsc t t
ensca Conis)C3eafehu meunihcffcci
4n h abgk

Raud a) Rcud (LL)


C o Ca C J 0
aitk A.a
Rral CB,h)
bebH0
d e C,b
106
elASSMAte
Dote
Page

190lH
Intially -l00 B:200 C 300
hc
caCLSh Occus ftea
1 Justtc uaile CB.bl
Jus
3) Sus utte 1Commit 2
Loy
TStat2
T A 100 9
A90
T8,200
B:210
Commt
12Sto
L 303,280

aecaveary SCheme uealtaio JCO veay tcchni


i UNDOLT,)Ihebaunsaction nceas ts-be undm
SF the Log ContinS , Stot2 but does not cantdin_

CREDO LT,) lhe taans actron T nceds fo be dor 1t


the Loy Con tuin both TStuot a n d T CominE)
In hi puse, the data itemvalues a Scto th
ValePe Pe he taca tion

a Just afta wail( , ) lhen Systemcgnm baLh fzm.


this CTugh Sees thtt_heae 1 T -stoat 2 byl no-
Tomnit2 Hence m be undane.
bSustaftea u3Te CC): deoc oth thenove qad
o optaution_Guill OuJ 107
elAssMAte
Date
Poge
90253lot111
Jus afea 12 omnm hcn bhe sytcmco
cosduck
f3om th (sash, il Sces bhal the c Ode tao tounycthn=
Cnd 1, ith boBh Staat ond comm pointslhui
mecio T,, , ngedo be acdoc.

LOJ tine lockin GLplcin two phosc ockin9 Pzoldal 2dda-

laa phose loching a _paotatol m hth_thaeazease tu


DhLoL SeS
92oainy phcuc is a phse ln hich the taansatior
muy_ahtain_lok Ca do hot clcase nyla
5hinkin phasc LE_U phose in hich
thc Laan uy eleuse h locksúut
na} htaining nc Lock

ly pes gt tao_ phase locking


Shaic tao phase lokinglhc 5taict 2PL_ Daatocal L
a bastophaspaotscacll ll the Cxclusly
madeLodks cp bt_held_until the tunsaction Cann-
that mccun in hcGas l the clusire locks qid
nLo Ckcd htydtLJ thLaOIDuction is mplRel-

T TF e obply lads hen


RCA)

A2
Commit
unocd LN)
lack-as(A)
RLA)
Urlo 108
xla\
ASSMALe
Date
Page.

1902600t))

phus:_bchinlhi St>i chor tuo


RiaBoLs c 4locks aae to be
43 odinu220tacalH
Aelsgntil Lza1sLiian ConnnD
CA Cpply bck

LokSLO)
2C6 RLA)
Lock %CB)
RB)
OJCA)
CommE
Cnlock1 )
cnlath Lh
aucntu qs
Scaializabilit
Dsaduaun.toa
2ans daudlocks
t T euds to CCi5 coding adock

1 Explain msLagng 2llbarki Ond ecovtaohle Sch dulles


rallbatks_SIhatian_in uhich
CasorAmu
Snole tausaien tail2 leuds Lo a SCnses t
a n i a c h i sa a l b a d _ P A

Rcud LAD

Lte (C
Rec 109
lASSMAte
Dafe
Page
1901s010 tHIL
hcn 1, lles value Df (dhen onbs12 Con rucd
tAND ho auhcn T waileshe Vcluc of hen Ohly
taunnction con cad Bu if he taaniact ion
C C5tailcd hen uBomaticall aansudtian 7, v -
eks foiltd
T T
CCd A

bcaatg2
Commit
Cad

12Epleain lockcod bascd p3otocal


Conccpb o paotocnl The lc2 bascd paual )
mcchcnjSm_jn cwhlch thcar Oxcl1Sic O7
locks Dar the dotaItcm foa Cunt tscun34Lhan_
jpciof lo2ck
S Sha2cdlock
The hceaud ot is
The foa decldiag_dataltems
Gnly I is dosked bylak is s alsa Callc as edlad

ii l i v a lack
The exhs)a_loch 1urd foz bath OCCId cnd uitC
Opeaations T 1denolcd CLS Lochx This is als
calledas anitk loch n ce SCt o loi m4
cons o Shout on exdusne løck_falla.arn-
uiak p,enis the Comubiliky betaun_mudes
flock,

110
ASSMAte
Date
Pag
90280/ot)0
Exelain Deadlock dctaction
Lndcad lack clectior mcchansm-, an a
trt
The S e o thc in invoks.Dicricalyto de3emme
0a hot. lfdcadladk
he hen dcadlock hus dcu
acciçelecdedthcn 5yslt1 mut tany to
SCCue asm

wait t s piph
hisyauph Consis 9 c Pa G-CVE ahex V
C SeO Ues ticics nd USet o cd9c

2
RCAD
RA2
wCA

Gu CA)

CB)

Les us daau
Stcp VCabie1G ha qll the transactin
2
Ccfpnd the Recad-Uale Puis TJom tuo
dtrcsiltyansaclions acadrng
SSuch o Poa 15 for hen o Go add t h -
ody befoeeCon al ecron foo rt)3

RCAD T)
CA)
RCB)
111
SSMAte
ate
poge
19217
Step
2.0h)
CA

CuCA
wCB)
Cyclessdchecded In thzaai 40uph tiee
no nced o uothiz(p0ceSS

LsT 3) , C2 x) z
y) , (Z) w(z)

y) Cz Lz)0C z)

LY ,L) C Z) , CZ)

Dly S, isLonflick - Scaializable

Cxplanatíon koz c9Atlict Seaializdbilty gr c


schedlle Should chec o cOnflici 93a2s
hch 0 Ru
Cisch -CeTitt6Lte Dtwce ic
paiz or tacun CLtigns n oscd n thok
(Ontlicts mke- C yuh
E cgh Cantsa a Cule_its na
onilict scziolizubleSLhcdue
112
ASSMAte
Date
poge
90280)0?1)
o makc DoscnSe n a gaoph it Racdl) inin.
Tfollaed loy o a Hc CX in T thcn G
then G
dksa 0n Cd ge laom to

The Scaial adc 5 i T, 1 1


SR,CAD,L,CA R6) A,c6), R,Le),Ch),t
Step
Lis all conflicks ny opcaction and
dehcamirc th
depenay betocen the taunsaction
C CAD CT2

SLp 2
ocSetncence aaph

T)
eualy Lheac PxIss cycle In the paccodm
00ph.
ntttooC Ehe givcn3chedu le S:a nat cO ntlic-
5echali2able

113
Patel Sudhanshu R 190280107I elASSMAte

Date.
Page

Hsszniment 5 Diy-B
Waitc a shoat naBeon uey pIOLCSSin
uay9aoECSing colleztion of ectivitics Zhut a13
is
tnvolucdin tra.cttnq duta taom dtabusehaing
Qucy paoCcSsing Ehesc tunsio.tionhigh evel
gekbusetunguage 2utaaics into he ypacSsions that can
be uscd u he physzccal level on _F2lesystcn
Basic tcpsof ucay paocc S5ing

1 aanslah on
in_tus step the 2ueay 13 ans lakd into ik
intenal loam and thon into aelutionulalyebau
2 Opbimi zation
Dusin h DooleSs}he ueyevaluition plan s
DTepaLacd fom l he aclutonul algibaic
exp3ess10N
1/he ueay cast ox all the ednlution_ plans is
Culculahe2d
Amn all CquValcat plansthe one cuth ocst cøt
Cost is cotimateduSing 3kitisticol_Lnt
lntaamtim
the databasc datalaq udh as the numbtz
o tLples in- Puch aclatioT)Si 2 o taplesetc
3 vuluation
The 8Uy xCUuion_engi_takes_a 2ucay- Cualubion
plenLxecUtes hat plan cnt 3ttu2n the naucs
Query
pbnslator Relabional- calgchas
ExessJon

Optimize
Stadste
Tbon
Outpurt Evaution 114 dae
Engne Txeutron ptan
CIASSMALC

Data
Page

1902801a71|

xample bulance lo0g


baluncelo00
Seleck balamc taom
2ÇLOLtawhcoc

Skep-|Passible_Relational chlytbac CLLCount))

) Oulane looo C(
belent Ceccouné))
Li)Llasee balon
hlont1000
Shep-2 Quea Cveluton plun
VLdELOUTI) Ihalene djcleame &TO0o
t i )Cacc.ount) 6radernct00
togo bcrtone

ischocn
3Once he Queay plans
Step-3 the 2ue
l_eucluutedcuih_hat plan

2kheut b_deLomposition hy s itaequiatd explai


CLAd
he diffeacnce belucen losydccomPstion-
nonlasuecbmpasibion uith example

eccmpositron is thepaoccss of bagakunq docón ven


clabion Lnto to- 3eladan
Relabion_ A acplaced b l e omox Delctcions
(ech neu Delalign_eonterlns Siebset o l the
Lkeaibukes R.
Toyethes they ll include all tuplcs Gd atoibutee g
Relatonal databtue design_pzlc35 Staots luith_c
nivdSdL
SchemeR:RA,AA,, i whiei
Includes all Ehc elkalhutas of thc_datubug he univaidu
Ke latton states hat eveay ataihute hame
iue
sing tunctionul de3Cndencics this unjcasq 2eldtio
Schcmu iSdeLomposCd _ntg a 5et of dclation
115

Sche mes D:R R - R Hec D bacam


clASSMAte
Date
Page
190 2801021
deluttonu datubasc sthemu tyd Dis 3cHeed as dccamiEale,
ecompos ition i auixd to eliminat the elseelU: of h
pooo dauuse desian dusty Nomel2cution poocessS
Thcac aoc two tyes d decompostio)
2) Non- Lossy

1)lossy dccopositon
the decomposihon ofaclerion R inta Ri and R,i loss
Guhen the jotn d R R, das ol yiclsEhe Sam
6 inR 11 1 alsg etHeacd e Lossy-}Oin-
gecompos1ion
he distiducaate4t o
The Such kiad of decamposibion
thut sDme inBaoamahon is lest cluaiy actolval of Jea bar
.
n o Bal Acet-joined
Hccount A0 5oa AnBal 1Bname
Aa Bul Bnamc A02 500o A 0 3000 laA-
AO 5000 Koed
AOL50m
590aud
Vua
Bel-Byonch 02 00o|
an
A02
a l Bnome A02 500Kaud
5000 Vg
5 000 koud
elakion_teccountahlel 2s
The fgLDe shos Bal-Bname: na cuhe
and_Ba
dcuomposed into e t Bal
Gned
Cettnhvle
the comman
use
sColtanl vill_look ikehect-jonid
Balence he atlafion
Ehe 5 a m e a Oaiglncel
Thob is
Ihat is onO Ehe
116
lASSMAte
Date
Page

190260JOt1)
2) on loss decomposstio
Teedewmposition ofelahon R nto CLd
is Lossoss jotn of , n d odu.
he sam elation n in Tis q tten
CLS ls deco1203ition. AL_d:comp2S1tion m
be Lossls

AcBu bccioined
ACco lAna Bilana
Bul Bnani o 5300 0S0o0
non
AO 500 Von 5000 025060
A0 5o0
Accbname
AOL Van
0 2 koud

The same 2alabuorn


dCcOun}_is deuoma0sed into
bale cleubions aBal unáAec- Bame Aaue
When theac talo aclabrg Caeisined On the-
COmmon Ltfribute no the aosalkunt aclatron ilL
Loak lke Acjoincd hi aclation xuchy samea; hdixdi
Ln othca uoxs
Rfoln and , OvesX
LosLosSy
F R JotnR, and K Ove X
lassless
R : otqinal acletron
X COmmonCttoib vie
R , 2 decomposcs aclesbians 117
ASSMAte
Date
Page
90L8O1O?]|
3 xplain taanstoznatton oE sclablondl exacs5bn nt-
euivo-lant elat iana expBCSSiOn
Too aclational' algchau expacsians dac Suid bo he
e ulva lcnk it gn peay lcgal dutubuse Opebuton, the
bwa Apac.sSions yl he Of tuples Seauene
same st
Lan b&diiestnt bu m. af uple must be samne
Equivalunt Rules
DCosmbinta sdecbion optaatianCan b ditded ioto sequs
a1 irdnvIdual selections Ths s called Cuscade of

2 Select 1on Doeautrors aDcoramun]Elve

3 nly th tes Llost) Seaue.ne as ppojc hon


opcations is DequIeded Othca cOn be Skipj2cd

&)Seletion opeaihon can b: aincd cuith_agtesian


paoduct th.2 k jaina

g Theke1oin n d natuzul Joim OPLtions Lae


ASSOCiatrve

hebe C ioin_Qnd nutuaal join d2JUbions 118


Commulative e
clASSMAte
Date
Page

190LSOotl
Selection opesabron dstribute Ov theta join Opaato
undca he tollowin condiron
Cuhenall Ehe attsibus En CLnvalue onl
bhc att ibute af dne oi h xpac sSian htin4Jaines

Whcn imolves Only theatbaibutes oi E, ond B


Onlad tz

TheR301cchian opaak Dz dsaibue e a union CU


UE)E Cn,tzp U CnLE2)
e) nion und Lotesse.cton aze comrla ue na
CLSSOciatic.
E EUE
E : CE E2 E
So Selccbion 0pLadton dbtaibuks ouca U, N,and
Sg_le-C,) De CE, )d_LE
S1milud4Uand Con he plued nplace ot

119
Pakel Sudhorshu R 9026010t||| clasSMte
Date
Page

Hssigmment: G Div
Explcuin Specialization gerneelization Concepb
ER dLgacmCith Suitable exCLmple
Specialization:
Ln$PCLiulization dn entity isdivtded into suh
Cntitics scdon thcia chaaLtealstiG
IEis dtop-daun ú mLh ahez hiahz lec
entity is Speciali23 into tap moae lo Levcls entinis

mploy ee
LE
Salaay name
LS

Testea DevcLopea
-Tupc
attaibutes ike ndm Sale
n Ehis C4se ¢mmon
higneaentity and5ec2ed
etc beLome2pzt of
(Tesgec
entity Ls nneLied_aith Speciali2ed attaibtes

encBLiza.tton -
ADIEAtics
Le is th poccss of Cxtaach nq COmmon
ntities LD Cea _czenrSai2
Om( set a
hight Lntity fzom i
CopDOúLh n ahich ta0 mAC
4 is bottom 1
be gencaaized o G highe level entit
entitrCS(an
Gomc_CLktalbatlr n_(Omman
i they have
atultypan be geneauli2ea
2 Student and
thi_cCse
hiaho levelentity Celld23501
-NamCPddd eLone a t ot
LOmman attaibukes Lke
entity nd SpACLallz0 aebaibufes ik 5.Fee
hrohes 120

become Sperioi2ed ertuty


easSMAte
Date
Page

19026lot11
22whut _is Noamaliztion xpluin 1 NE, 2NE3lE
NE LNE and bCNE
Nomclization_Ls_bhe pcess_e Doganizlny the
data in database sed to minimiz h
edundancy tzom 3cleation a et of aclaticns.T
i i Clso USed to eliminake thc undcSiule_cha.aacteajshe
Like nseatior UpaaBe Lnddelchion Hnomyalies

LNE rizst noamu foam):


2clation all he 1NE iE ik contaias an alanlo
Nalae E statesthdt gn attabute of a rble di
hold ultiple_Values L mus hald 7nly Sindle
Nalued itzibute

LD Name -Phene Srcke


Jahn gs5433543 0 UP
734 21 89]0
20 Haaay
12 Sam 7390312kk1L

This is nnt 1NE beccuse ot mulkivalued cttaibuio


Lhe decamposition Of the Lmploue tabl inie i
Shoa bela
E1D Name C-Phonc Sthe
ohn hy33S P
hn P

2
Bihaa
Sm 229033 89 Puaiab
6L$9%30302 Pnib
121
clASSMAte
Date
Page
1902%0lotl
2NE CSecond poncl foam
1n 2NE aclukion must
be in NE,Qnon-key
attaibules dac ullu unctional dcoendtnt on the paim
keu

Th Teuchez 1D Subiec Teuchcz11u


Chcmistay 30
25 Bialogy 30
English 35
Maths 3
Computea

Ln diven tablz nan-poimz atziblig tecacna i


dependena ona
Lndidcdeke o We_decomasc n t o to table

lecchea1D leucheaAGE Teacht Ln Sbrec


25 30 25 Chcmist
35 25 Bial
T3 3 Lnelsh
Meths
3 CompuR
Foam)
3 NF CThiad noamul s in_ZNE an nat
selation i l l be in3NE i
btal dependchcy3N
taansitiveposti
Contal
Contan nu Used
hethe dtu d u p l i c a t i o n t iis_alsa
s
usc to c
Eo chNC ihe data inleqaih
Lo anNF i t it holds Qecyt onc
Zclationis
tolloCuin (Onditions rod veay on-aLvL
of bhc
Functions depcndency X
y is a Supea key 122
i a paime dtalbl1e-
elASSMAte
Date.
Page

1902K01o_

EmpID mpName Lmp- AP Lmp-Stute p Ary


222 Haxoay 20lolo P Noida
33 0222% US
US Bosbon
john Chicao
Bob Noatich
G66 luak C6200} Bhop
tht above
Latht table mpID is cundidite ka peb
mp-D- thethe ttaimuies a c ne- pamlo
ComNCA2b bhe ocn_taat into 3NE ue 4ecompo S
tu o tables

amp=
222 20ol0
333 am- 0222%O
Jahn
555 Bal
laah 4C2002
TagZI? mpS tule
201olo UP Noid
US
O922%0 BasteF
OSOoo US ChiccM
Nozuich
42002
Bhopu
4NECfouath noametl taam)
elattan wll be in UNEE IE_s n_Bucc coddd
YOsmal tamm_dna p45 O myltNucd dependnt 123
alASSMAte
Date.
Page

1902xoldt
5TD CouasSe Hoboy
2
Computcz Vancin
Maths SLnging
3 Chpms kay Dantin9
59 Bjolagy Caritkch
Dhysicss Hocke
The giuen STUDENT able s In2NL hli tha Loe
C Hob
Hobba4c Huo lndcpendcat_entlty Hcnu he
Lution Shlp betweenCouzsc nd 1obby
D S ludent CawsSe Shudent Habbu
S-;D_Couase S-1p
21 Lamputea 21 Duneng
Maths Sinuiny
Chemis 34 Dandnu
Bialocy Lie
physics 59 Hacke
BCNE CBosce Codd noamCiL_Faam);
BCNE is he dduane V¢ilan t NE Stzlte
than 3NE Atuble s in BiNE fungéiolGL

dependen i i the sijpcakes ot the


the ubc
Fuhe
y lets qsSu me thcseS C COmpany hCac_employc
gzk in m0ae han_Onc depgakmct
mplayce able
Emp-_Couniay Emp Deat Dep- Tygz DeoNo
24- Losia Desaniny 39
India lestio 394 00
U
Stoxcs D 23 232
364 levplopin 023 549
124
Date
Page

190230111

teodccompOsc itinto 3 tables


Cmp-L) Emp-Coun.byy Emp-Dept Dept-IypeeplNo
2 Lndiu Designiny
Testin
Stoac O263 232
Dephyp DeptN o DevolopCni 23 549
939 2
OD
D283 232
D283

NE Cfih Ocama
i_zelation isin 5NEit itis n 4NEand jaininy
should be loseless 5NE Satisneduhcn al thc tuble uzo
baoken nto Cs manytublas as passiale 10 cadca 221uda

e-
Saubject LectulerSEr
Conpu'ez Anshin4
Lamfutca
halhs John
laths Heash 2
Cnemisizy Paavccn

Soto oakc table intg 3 NE, e


IMdeeOmndseit
P P
StM Subt Subicc Lecudca
Conputc Comput.cx nshiku
laths omputta John
2 Chemstay
2
alhs Sohn
laths Moths Rkash 125

Chemstay Puveen \
classMAte
Date
Page
P SEM Okolo
Lt-CTURER
Anghku
Jahn
1aha
kash

C00i1dea a zlatjonr R h
Hviny folloaine dependenty tiuc_cizibuke i BLD.E
ldt all Jey of R iA0,CT ED= -
bIn_auhich Eable_oam table isushty yoh linlu
SrnceKA doesn'E huve_CO So CCDE)
CACO) : ABLDE ED ABCD
CB CD AeCD
So kcys 33 AcDEDf¢D
a CAOLDE
ED
ALL C Po2&ne
attoibues
So CABDE)p in 3NE
4Lwha 1s functiondl dcpcndonuy xplaln is usage in
daabuse desiqn
7he tuctional dependcncy is qaclationship thg
Qxistsbetaeen two_sttalkues s typically iSs_betucen
the 122aimazy key Cmd non- kcy attaihaeithin a tuble
The lrt Sde o_ED_Iknown a deheaminunEne
aight_Side of the paoductionsknan us 4 depeldeni
Fmct1Onal dependen dCkesminesEhe aclatton ot a
atta1ube ta analhe qtaibutei h a_ DbMs_ 126
clASSMAte
Date
Poge
1902&0l0711
FD. hclps o muin tainthe aNat hy O Datu -7L uA
LEalso hcps la _pacvanbt ng data acdundancy Cnd es
abau the bad designs
5With example xplan Vdaous ma)pinq caadinalitie
ira.
totalpáaticijution
mappiny_Cuadinality i s u datu Cons 1lnt nar
sptciis) hou a_enhtcs m entiy un aldtta to
tn aacleationship set Lis mastUSe hulio
cscalbln the 2elationship_Scs hak Lavdve mac
Tha
Cao entitq setS

2re etionsho sh Seh R on


O PaSihle mapnln Cazainclitie hoe
D Onc to One
n ths moppin9 n_ntuky in E 1S dSsociaT
dbtanc ntitys in Un Cnhu In_
s 55odated_ th dt masL dDL entity in_
in
C

One bo any
- la his mapin Cin Cniity E14Sociaicd
CibhQni) onumbe ot entt cs 10 Lnd can_eoiy
in 1S1 QsSociaied (ith at
mostgac ¢ntihy ln
tii)fMany to onc
neai ty- in _G is g6ciubsd Gith g mast_ane
entllu10 a Lat1ty in howCuGa CL he assoCigte
ith an ntez_Of entitic ia 127
clASSMAe
Dote
Poge
902&0o ?11)
V lunyts muny
hn entiby iM_ s a4sDtictecl with n runbe
oentitics and an entity in G i asoaa
umbt Cntics n

One t a One One o mun

A
2
- As

unyto Onc a D4n4

1otal Paoncipctlon
in_ thc acationshp
f inualwd
ach entity
i s knonC babul puttdpution

D llee_um
Ceil

Shadent Study Colle


128
Patel Sudhonshu 9020o?)t1 clASSMAte
Date
Poge-
Hss4nmcn Div
xpl uln datu a ençoyption
Encayp tron i a terhniquc of Cncoding duh, so hat
Onlq_authoat2cd ISeD Cn ndeadtud it
The dala ecaypbon tech niue nvcats euduble
datu into ndcaduble dtko jinb usiny aoMefechw
SO thdt nquthoal2e pca son Conngk ocad Lt

Step1:Selal koy und Cacayp Step2 Gite kecyand


Usmy keytodzygtrSAep3: Cphstesci ta zcceieg
Pttin tot Ctphes- Plain
encayytn- text
dearypho
n aboe tiquse Sender having data that he wan
to sendhu dutu is KnadwnCos2uin tert in the
fisst Step Sendca oll_enaypt. data sing Pacaypho-
ploain text Decomes ciphestext_and i i not able
Eo 3cad hu ny Uncuthogized pcoson
Thu cipheakext iSend ta
The Sendea auillSend that key sepacctly o scavea
Oncc SecriLD aeceives this tpchesext he will
deLnYPt:_ Eby in tha.k kcy
Theve aare tuo dftcaont methads_ok daku encrpho
1 Symmctalc kay enezyphon/paixale keg enayhio
H e e theencryption and day ption kus 0adc
Ehe saTme and iSsed
theSCnde to b
aanypt md biy the accCieato desa the duea,
2 lhynnelaic key encayption / publie key ehcrypli0.
Heocthe encaypion md_decay p tion kcys
02L dieacni essauye i enaptcd by sende ulh-
Pubic key c can bo desy bDecelvea only
129
SMAte
Date
Page.

1902801O)
CLlcessContag Und.
any
22Expludn in dctail:
Ducaction
cless Cntaol
Mandatooy
contaol EDAC 2
Costion4ay uccess
DAC allaws cach LiSC3 O Sabjct to Contoollit
t o thcid own data Ln piC Onca Ot esouace
o n the
cstoict CLLLesS_to the Lsouaces bascd
entih of scs
AC s Eypicly the de tault aCEsS CONtaol mehune
OPcutin Saystem ach 3esauace obich
n DAC bescd syslem hus Gccoun cant5ol_ lic.
Ch contain lis of Uscs und CTaLps to
which_ the sea huu peomitted CILLcSShaçethça
ith bhe lexel ok aCcess fon ecuch sea 0 gaoup
e
tsti.doc Poa)ku acud 1
test2exe mkika execule Pagikku Ceate
test 3 Com Ankileaecute De0d1-

Advontae
T lexible.
Te hus Simplc and-elficicnt COCCCss Jizh_ Malem
-IL Stukuble

Disaduamiey
T incactuses tha aisk hat dzto coill be lo-
acessieto usas that shauld nothe
Thca
qiven ULSS-
s n0 COntaol OEa intasmatan ttocu
130
clasSmte
Date
Page

1902&01l1LL
Muntatoay AcLess ontml L1AC)
Tn MA hc dLcess Conhaol decisions aat bascd on
Specit oclationships betoeen the Subju Seues hny
LCcess Cand bht 0hjcttto which 9ccs5 S cquentu
Lt qunully used in qovchnmcnk nd miltuay
Unlta AL ucCCSS to all ssoeacc gbjcts s Contgal
Settm
Seitsng detined by the Suskcm adminstauta
To chcn4e Ehc qcces Contol af a acsouat is n9t
DOSs ible unolea MAL
MAC bepins Cth secuai'by labels assigncd b al
SCCOMaC 0bjcks On the System. Theác tabe Lotuin
2allaaing infoamuBion
Adaysiticatfon 5uch us contidcnhial
ttalbut assoesated
Lparovidcs bh.e ClasSsific.atign toa tuple coha
e tmp_nome ScuLca D.utoaman
Cfcai
Sham LOo0 5 good
C Contidcncial S Secoct
UUncLas Sihed STap Steaet
dyanugs
MACo0ovides uahco Sccuiby CinddcducescFaDaS-

Drs.caouan tages
ALTequiatsCaactulplannin nd Lan HDuuy
mani tooing tokep all CsaLace obicksad
us.cos clasifcca
tion s depe

3 tha is authcoaiza.bon nd uthen biccatton


131
Eplcin theLcLss Cntzalsin_u databak
clASSMAte
Date
Page.

19020)ot11
I is pootectiny the data to ensuac palveey
Cnd CLLLCSS Control of dutu uthoaizdtion
gimg CicCess to uubhoalz co Useas

Iis thc paoces5 that taaites luhat ouclae


Cuthaaizcd o dongt todo
ALLeSsinA Fle faom hasd disk bo is
Quthaalza iion becuusc the pemiss.ion G doc i n
LO Lccess thdt le cllous yo CLOCsS
L Ehdt is GUthuza1 21Ltion

-tbcnbicunon panyrdeng n feggly canto


Cind Secuattu ba the Duru fhuthentitatron
is the paocess vCIai Pyinq wha 'ugu

hen C UCO_CUdnby b dCCLSS ehc


databasC SYstcm he
aLDR willacuhe
LCLO fos_him. o d Secuah
IOpuopo ses Cwhich Keeps
cll Opeaatons CLp12licd by Centun
uSco_[E amy cLmpealn9 Cwtth he
dutabaJe iS $uspccted bhendubabas2
Udit is ptai omed ewLbh he help_ar
his l Such ly MUuhbaincd taa
secuaity_puapo se Lalled uudit

132
190260lo?||) Partel Sughanshu R lheswate
Date
Page
sstanmernt Div3
1Dcme
Weak Cnuy is an entby that Canot bcunigucly
sa ident1fied ik attatpuke alonc

22Data Dictionuay_doalu qrtionuay & callcbon_f names


deintion3 an attaibute abauldata elements-
ubstalng A_Substring is a Cantiguas s91a of chctestar
wlth in a stain9
Dual Dual athble autayaahically qap hu dotubasc
calonywith bhe dau dsbiongau

9 2Atca The tahle shtemenk ued to add.datu madih


Lolams in aexistiny table

oLAAte n Lmuncuk_ Ls UDLopeautton thd maaki the


eateniat llocotm
2aap Daop_i)1sA o delcle quhok datazsc da justa tahle

2
15lmany_kru laimiuokey cantauwat uniqucly icdentie uch
gecoa in table,

obtign key B_ lozlan_key is stt af aftaihutes in_4_tuale


epocScnts paimey înAnabhcr tahle

3 mgue key:9nqu_key_cantsurt ull dhe ble Column


bo be diflacnt 133
elASSMALe
Date
Paga.
9 0260 10} 111
4)Sct vull Data in the colormn must not be hulL.

5)Commit coXOmik StaBcrncr I l GLd taumsdcian_athi


RNe 15 an mat l dhazges yisible to othca ugas

tRoback Rol betk apeabion ohich2ctuars detubusc


DCViOu)Staie

Q1E: Sal Gucay Into lts_Lomponcnt poh cm b dhk to


a
Elha stana

9Qt uyby Lanplk (O delkaba qGlmyuuIC


Fox 8tlattomal datahask

D.3
OVOL Vza Dekinat1an lamuuye (UDL IS USed tS220SLtu uxa
Vcus_da thtlDmapplng ConupEualScheia

2)TCL:Taamachion. (ontaulungua TCL|Camnaa ax io


Magt tzunsatkion Mthe detahsc

3SDL SDL sbands tor Stoaay dcikabaseanaua

5
TalleTublo USe
the datakast abJecs
aclalional database

6 le50L Rulk 4ah t0 acmlaistea iviloá cNMA


ceata base hus man Uca
134
ASSMAte
Date

Page
1902&01o7t11
Resbaiction psaLionlhe Reslatck pau taats the Spccificed
aples Josfaom th GYCn delahon base in condition
DL Compilea taanslit DdL stutcment in uque lunguge
1 0 0 beaparte7
DDL inkeap 7elea texpoctsDDL Sshqpemends
3COdds khe qneaated stutement n the tuhe

hst ison DELETE KnDE SQL 2Explain_leanly


acign ka oth SLude delete- spcibies thot he-
dola àchu 5 deletes ahen th aet t
dclehes
CRecuhc table nvatoay
nvemay id_1AT Àiuy keu
paidutid .NT NAT NULL
aaunhiEy TN
mm- lee INT-

foeimLeyPoduchid)
Kibcalta Paodve
ON DELETE Cascude

OnOnDELEIE asCADE_Clas yhuch_ls Senca


ddke the coospspandta4 CLds he-cila tablp_whcn L
duta n the Pa2gnttable sdub dcletcd

Shah _Ton2 Explem Viqus


SQL ol lcss cOmbincCaluns faa orle
aaclorona dutulbax_ 135
alASSMAte
Date
Page

19026010hl
Lnmos j6im
AnAnnca on ucCach aau m the horo joind tubes
ta haematchiay colum valucsgnd a comnonly used
JOmOpCadtiam i nappliciign-

Seltct Smpoyee lstnaneemplaueeDepurment


som Cmplayce Lnne Join cpugteman4
CmplayccDepustment ) Mepartementepaxhpcr D
Ouba Join
Lek outro
lctt jon Conkuinsa Xous CO he LeP buhuh_dun i
ehe oin Condttan
dass mulchba
seket aom eploy left uterjon
Depntment O
Cologc D<pcttmen N: Jeadtemern DemetneN

Right out.ca on_Contain AlloLesgt


the (Ondrtlon c hc Rrqht_ be Un
nat nd qn mdhcllil
Selectlsort eployer Rght ouey jon
employce Uepuatma O
Depatment_D2Depatmai DepartneA_ID-
utea pin
Al utea Jon COYtanahi at etf cct .
dk Qpplyin4_ hath
Jett und a1ght altcajoinD

selectlaom_mplayee full olloa jah depaatnni


ON
Cnploke DeuatMunt LD_: Depuatmuht. Deggimen?In
136
elASSMALe
Date
Page

902601U
01 Lplcain
pDL
Deata Detination lanyauge
ta deline daiu Staucd use
1 DDL Lanqua 9 used
aod modity Dutu

DDL_comMadsCan he usd to addemvc moliky tublc)


ulthnin_a_datcibuse
DM
Dat Hunipulation lcmguug
l SL CO21manldstt dealsLwth the mnipyletion stdaz
paesen i hc dutdbase
CX INSTRT PDATf 9ELETE
DLL
Data Lmtaallmaus e
DCL lncdudeCommad uhCh mainly dels Oththe aight
pemniss.fans 4nd Oth Lontagle
GRANTAEVOKE

wha is Viea xplan t h suitahle ckimale


ieaus Cam bCansidtxed u Vgtudfahles_H_Va pa
Sthg detinakrany Ghicla is bulldn t4pof toble dr
PiherUCIS on doS n0 ph4sleqla sto tha
dta
e yeC

Ths i Cacute_ViDtiaal able (es peca Statcmcnt paaidsd


137
Mate
Date
Page
)901%01611L
Q xplctdn lumcalc C stalng hnctiob ith CXdraple
Nunmcar tunchioss 0 UsCd t aiob OpCogtigsOn
mbes Cd Dciaan Dumbcas
C HBS C 3ctyans. the abSolute vdluc ot a nul
ABS C-J) 2Lo

acutea than d Cuato a nuImlya


CE COS 5) 226

Stam
nyynetNON Attpata3m Gnopauijan
LnpU_StaingCndackyan an aulput_Sialng-
R NG CHAB-LENGTH Thu. ynchonI3 ud to in length
LHARLENGTH CHELLO1 4
LCASD-- Th iumcti.om s d o convCgt gve Stainy
LCASE HCLLo") hella

O10Explain_Comt ani Ralbadh Comnuni


COMO[T
Comm in saL 3 taoyuctian canlaal anatdac uhizhit
U to pcamanih th chtngcsgetqin he Lau
in uble database

Tha cetubust Loamot bsin_lt state alta fhe


CxecukioN_at

138
lAsSMAte
Date
Page

SQL2
Scle
Shaft
Cheae 1lgounet o 0
SOLL7 COmnit

Koll back
lE a taansuctrongl Qtaal lonuus4 hch s
S Udca bh l sackians t e hat kaa-
SNOVC iA- deatogu

Stttct from mplayce


whese Alsemne aa

139
falel Sudhanshu . 1902%01071 clASSMAe
Date
Poge

HssiynmEnt 9 Div B
L Explun
Stooed PaOcedUxd
Stoxdpaocduacs Coc poc complcd objccb Guhich compilc
ro bhe tiat tc and tb Conpilcd fmat isS hth
Executts Whcnavca it s Callkd
PoOCcduaccnam dctuan ZCao n valuCs
poocduacCCLn hac put Outpu pasometea
accu acs Canmot becallcd taorm hunchian

Functions i
iunction is Compilcddnd cxccutta euc me whcna i

iunlction mubh octuan_a ahe and _comat mdby he deta


LCeLVCd Cpaaamcteas
nchios n_hduc Only inpu paaamchcas iaa
Fwnctiols COn b ca.lcd tam paaccd

2 plamslygLa

|talggLat defnc Set achioS that d S3Aut oaen


3Cspansclo C L1gst updade. deleke epadtiorn dn a soccificd
tub
Bcico toiggco
By Usiy taiggca) thdt JUn betox 0 Updute nat,Ldiuo
hd d a4 updcttd_ )h%ated CUn e mLL ted bctoe
he duta.bu Qctuolly oditicd
Artea tolgca
aLyytas that U aitc) n_updule nScafo e
Oe 1 Rd in SCvC.Odl
CUYS-
140
Date
Page.

195L80

Tnstcod on talggcas
Instcud o taigycos_descaibe bw to _pcaton Lnscat,Upda
elete peaatrons agait_omplka UICUS-

Sumbax
CaCahe Lalgyca Taigyco-Name
On Datab
ton cuteTable PLlca -TahleDap- Table
Begm Taigyca Bsly
ND

3 lhat ts vSn 2Explatn the typesd Cuasaa


Cuasaa 5 empaaay duoak Cacd carcted m_tho Syittm
momosy_ hcn A_SQL Statcmn exccttal-
ANTSAa CCtm nfanmcltion_ a Slec stqkemr_4d the
aoUs at_dotci QcCeSscd by i

Lmpliut Cueps
CaLoltedhy dctaut_awhen DrL, sehme l -
LNSERT JPDH JEOm DELEIE
hey
Stclkeniottd Cccltad -
Cacicd te Dgaccss thasc sfe@hema

vplicit_CuascS
Tha mst_be caclkd Cahy you aac CTLCuin4
Thy
SELLT
statcmen ocakE dctuam ma thunOA 30
Lven hough the (uasJ Stga miltple
n accoadsonly-
acud Canbe paagsssdd Ctaftme chch e
cdas
141
ClASSMATe

Date
Page

DOOK C book idboo fiNpumluhca book-dle


LImpl.cmen pJoccdux hh patnt details q bodk cshan Palc
LURS0R (usoabaah TS
SLECT taom Booh Cheae
AVG Csok-aCe _bohp2Ice-
PEN Cuaso e boak

ETCHCuasaa book NLG-


cLoS (ud sa sagk
U Wanke a ta49ea Sech thuli s actaad dctahd taam
book eable na gldacLoad in_bodk bachp_ ble

CRAIERREPLALE LRIGGGR tarupeabackup


BEPOR elET ON BOOA
RLFLRENCING JLO sdeleled FgA CALhRau
1 SC RI TATO boak-buh pp aLue
delelcd boak-Id delefed bookllp deleBei publte
deleth boak-

142
etel Sudhanshu R . Div B ASSMAte
Dote
Page
tss iq/6nt-10 19028010i
.1What s B:tacc and hat is u t aes
sclholunci2 Scuxch, tacc
Whenbhe- numbta of ktys shh bhc du
aead taom disk hetoam d blocks

Disk acess time vcay high compudtd ta he


the mir
main

momomy CLess timp he n idcu a iny


8-lae _Lo 2duce tha umbez df di CLLSS

- a ctace is _attagc Thhigh o the B-Laccs


is bept_lo b4 pubbng maximum possibl

keys in uB- nodc

HLaoaithm ime camplcx1ey

Search O Cioan
Olaan
Delche OCLoyn

.Luhat b hushinq2Ezplatn uth example

Hhíny i he paaLess of Conucating giucr


Lty into anatht3 Value.

hash huncbion b LLic , chgauk he ne


Valur LCCÖDding LO_CA_ mCL muctcctl LLaaaltm

Key HSs hnctin Hash


Ag0od Ahu hincéron u s q gi way hashing algant
b e cgnutatd ba
O _ othcz Cuosds he aUsh cennot 143
nta the oaiqinalRcy
clAsSMAtee
Date
Page

902&01a
0 CxCmple pCSspoae is as2 acess
Cway_hcash functTon_and hu
thaoug Onc
Ce anc

2e hash pCLSSuad i Stoad Jn t h e


dukabae
22
abc
puss d tass
PaiSuud
tunctto

144

You might also like