Database

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Seat No.: ________ Enrolment No.

___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–III(NEW) EXAMINATION – SUMMER 2023
Subject Code:3130703 Date:28-07-2023
Subject Name:Database Management Systems
Time:02:30 PM TO 05:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.

MARKS
Q.1 (a) Explain the different types of database users. 03
(b) What are the responsibilities of a DBA? 04
(c) Explain database system 3 tier architecture with clear diagram in 07
detail.

Q.2 (a) Explain candidate key, primary key and foreign key. 03
(b) Explain Mapping Cardinalities. 04
(c) Explain Entity Relationship model with example. 07
OR
(c) What is join? Explain various type of joins with example. 07

Q.3 (a) Explain query optimization process. 03


(b) Explain 3NF with example 04
(c) What is functional dependency? Explain its types in detail. 07
OR
Q.3 (a) What are anomalies in database design? How can we solve it? 03
(b) Explain BCNF with example. 04
(c) Enlist and explain the basic steps in Query Processing. 07

Q.4 (a) Explain log based recovery and mention all its types. 03
(b) Explain Two phase commit protocol? 04
(c) What is a transaction? Explain the ACID properties. 07
OR
Q.4 (a) Write short note on data encryption. 03
(b) Explain deadlock detection. 04
(c) Explain conflict serializability and view serializability. 07

Q.5 (a) Describe GRANT and REVOKE commands 03


(b) Explain Transaction Control Commands 04
(c) Consider the following employee database, primary keys are 07
underlined :
employee (employee-name, street, city)
works (employee-name, company-name, salary)
company (company-name, city)
manages (employee-name, manager_name)
Give an expression in SQL for each of the following queries:

1
1. Find the names of all employees who work for First Bank
Corporation.
2. Give all employees of First Bank Corporation a 10 percent raise.
3. Find the names and cities of residence of all employees who work
for First Bank Corporation.
4. Find the names, street addresses, and cities of residence of all
employees who work for First Bank Corporation and earn more
than $10,000.
5. Find all employees in the database who live in the same cities as
the companies for which they work.
6. Find all employees in the database who do not work for First Bank
Corporation.
OR
Q.5 (a) Explain DDL,DML,DCL with example 03
(b) Discuss aggregate functions with example(s). 04
(c) Explain stored procedures and stored functions. 07

*************

2
Enrolment No./Seat No_______________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–III (NEW) EXAMINATION – SUMMER 2024
Subject Code:3130703 Date:29-06-2024
Subject Name: Database Management Systems
Time:10:30 AM TO 01:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.
MARKS

Q.1 (a) Define Logical Data Independence and Physical Data Independence. 03
(b) Draw and explain 3 layers of abstraction of DBMS 04
(c) Write relational algebra expression for following 07
(query 1,2 and 3 carry one mark/query 4 & 5 carry two marks)
Employee(eid, ename, salary, deptid)
Department(deptid, dname)
1) List name of all employee
2) List all the departments with id > 5
3) List sum of the salary all employees.
4) Department wise count the number of employees
5) Find the name of employee earning highest salary.

Q.2 (a) List various symbol used for ER diagram 03


(b) Define referential integrity constraint with example. 04
(c) List the Armstrong axioms used to compute closure of the set of functional 07
dependency.
OR
(c) What is decomposition? Explain dependency preserving decomposition with the 07
help of example.

Q.3 (a) Give syntax of command used to add a new column in a table. 03
(b) Define indexing. How will it be useful for searching data? 04
(c) How can we measure cost of Join query? Explain using example. 07
OR
Q.3 (a) Write an SQL command to modify the content of table. 03
(b) Explain sparse indexing with the help of diagram. 04
(c) Draw and explain the query processing steps 07

Q.4 (a) What is relational model? Explain schema diagram using example. 03
(b) Define transaction and its properties? 04
(c) Write a note on view serializability 07

OR
Q.4 (a) With the help of example explain Generalization.. 03
(b) Define various approach used for Log based recovery 04
(c) List and explain various types of Locks used for concurrency control. 07

1
Q.5 (a) How can we print output in PL/SQL block? Give example. 03
(b) Explain cursor and its types. 04
(c) Write SQL queries for the following 07
(query 1,2 and 3 carry one mark/query 4 & 5 carry two marks)
Employee(eid, ename, salary, deptid)
Department(deptid, dname)
1. List name of all employee
2. List all the departments with id > 5
3. List sum of the salary all employees.
4. Department wise count the number of employees
5. Find the name of employee earning highest salary.
OR
Q.5 (a) Define encryption and decryption. 03
(b) List various types of Trigers. 04
(c) What is role? How can we authorize a user using grant and revoke command? Give 07
example.
*************

2
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER– III(NEW) EXAMINATION – WINTER 2022
Subject Code:3130703 Date:24-02-2023
Subject Name:Database Management Systems
Time:02:30 PM TO 05:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.
MARKS
Q.1 (a) Define following terms. 03
i) Data Abstraction
ii) Instance
iii) Logical Data independence
(b) List the type of database users. Explain their characteristics in brief, how 04
they interact with DBMS?

(c) State the advantages of Database management systems over file 07


processing system.

Q.2 (a) Differentiate generalization and specialization. 03


(b) What are the types of attributes used in ER diagram? 04
(c) Draw an E-R diagram of following scenario. Make necessary 07
assumptions and clearly note down the assumptions.
We would like to make college’s semester fee collection system fully
computerized. Fees may include your term fees , library fees, gymkhana
fees etc..
OR
(c) Explain the concept of total participation, partial participation ,strong 07
entity set and weak entity set using ER diagram.
Q.3 (a) Define the terms. 03
i) Primary Key
ii) Unique Key
iii) Foreign Key
(b) Explain transitive and trivial functional dependencies. 04
(c) Suppose a relational schema R (A B C D E) and set of functional dependencies 07

Check out that relation is in 3NF or not? If not decompose it in 3NF


OR
Q.3 (a) What is the significance of normalization? 03
(b) Explain Armstrong’s axioms. 04
(c) Suppose a relational schema R (A B C D E F G H I) and set of functional 07
dependencies

1
Check out that relation is in 3NF or not? If not decompose it in 3NF.
Q.4 (a) List the type of storages in DBMS. Explain in brief: indexed based 03
accessing.
(b) Explain authorization and authentication with respect to database 04
security.
(c) Which type of queries would be solved by Division operator? Explain 07
with examples.
OR
Q.4 (a) Write short note on : Hashing technique. 03
(b) Explain ACID properties of transaction. 04
(c) With neat diagram steps involved in query processing. 07
Q.5 (a) Explain the concept of deadlock in brief. 03
(b) Explain GRANT and REVOKE commands with suitable example. 04
(c) Write a PL/SQL function which takes 3 integer numbers as a parameters 07
and return an average of same.
OR
Q.5 (a) Differentiate between Conflict and View Serializability with respect to 03
transaction(any three differences) .
(b) Enlist types of joins. Explain each with SQL syntax. 04
(c) TABLE Worker(WORKER_ID INT NOT NULL PRIMARY 07
KEY,FIRST_NAME CHAR(25), LAST_NAME CHAR(25),SALARY
INT(15),JOINING_DATE DATETIME,DEPARTMENT CHAR(25));

TABLE Bonus(WORKER_REF_ID INT,BONUS_AMOUNT


INT(10),BONUS_DATE DATETIME,FOREIGN KEY
(WORKER_REF_ID),REFERENCES Worker(WORKER_ID));

TABLE Title(WORKER_REF_ID INT,WORKER_TITLE


CHAR(25),AFFECTED_FROM DATETIME,FOREIGN KEY
(WORKER_REF_ID)REFERENCES Worker(WORKER_ID));
Consider above 3 tables ,assume appropriate data and solve
following SQL queries

1. Write an SQL query to fetch “FIRST_NAME” from Worker table using


the alias name as <WORKER_NAME>
2. Write an SQL query to fetch “FIRST_NAME” from Worker table in
uppercase.
3. Write an SQL query to print all Worker details from the Worker table order by
FIRST_NAME Ascending.
4. Write an SQL query to print details of the Workers whose FIRST_NAME ends
with ‘h’ and contains six alphabets.
5. Write an SQL query to print details of the Workers who are also Managers.
6. Write an SQL query to fetch departments along with the total salaries paid for
each of them.
7. Write an SQL query to fetch the names of workers who earn the highest salary.

*************

2
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–III (NEW) EXAMINATION – WINTER 2021
Subject Code:3130703 Date:21-02-2022
Subject Name:Database Management System
Time:10:30 AM TO 01:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed

MARKS
Q.1 (a) Explain three levels of data abstraction. 03
(b) Describe Data Definition Language and Data Manipulation Language. 04
(c) What is integrity constraint? Explain primary key, reference key and 07
check constraint with SQL syntax.

Q.2 (a) Differentiate single-valued and multi-valued attributes with example. 03


(b) What is weak entity? How the weak entity can be converted to the strong 04
entity? Show the symbol for representing weak entity.
(c) Why do we require E-R model? Explain the term ‘Generalization’, 07
‘Specialization’ and ‘Aggregation’.
OR
(c) What is the similarity between relational model and E-R model? How 07
the entity, attributes, primary key and relationship are shown in the
relational model.

Q.3 (a) Write Relational Algebra syntax for the following queries. 03
Employee(eno,ename,salary,designation)
Customer(cno,cname,address,city)
1) Find out name of employees who are ‘Manager’.
2) Display name of customers.
3) Retrieve Employee records whose salary is less than 20,000.
(b) Differentiate lossy decomposition and lossless decomposition. 04
(c) What is redundancy? Explain insert, update and delete anomalies in 07
database with example.
OR
Q.3 (a) Write Relational Algebra syntax for the given queries using the 03
following database.
Employee(eno,ename,salary,designation)
Customer(cno,cname,address,city)
1) Find out name of employees who are also customers.
2) Find out name of person who are employees but not customers.
3) Display all names who are either employees or customers.
(b) What is the limitation of index-sequential file? Explain with example 04
how B+ tree overcomes it.
(c) What is the difference between Join and Sub query? Explain any two 07
built-in function for following category. 1) Numeric 2) String 3) Date

Q.4 (a) What is the view? How does it different from the table? 03
(b) Explain below mentioned features of concurrency. 04
1
1) Improved throughput 2) Reduced waiting time
(c) What is index in the database? Explain sparse indices and Dense indices 07
with proper example.
OR
Q.4 (a) Differentiate dynamic hashing and static hashing. 03
(b) What is the atomicity and consistency property of transaction? 04
(c) What is Query processing? Explain why ‘Parsing and translation’ and 07
‘Optimization’ steps are required for query processing.

Q.5 (a) How does ‘partial commit’ state differ from ‘commit’ state of the 03
transaction?
(b) Enlist and explain user authorization to modify the database schema. 04
(c) How does two phase locking protocol differ from timestamp based 07
protocol? Explain timestamp-ordering protocol.
OR
Q.5 (a) Why does the trigger require in database? Write SQL syntax for creating 03
database trigger.
(b) When do we require to use group by clause? How aggregate functions 04
are used with group by clause?
(c) When Join is used in SQL? Explain Left outer, Right outer and Full outer 07
join with SQL syntax.
************

2
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–III (NEW) EXAMINATION – SUMMER 2021
Subject Code:3130703 Date:11/09/2021
Subject Name:Database Management Systems
Time:10:30 AM TO 01:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.

Marks
Q.1 (a) What is Data Definition Language? List DDL statements and explain 03
anyone with an example.
(b) List and describe ACID property of transactions. 04
(c) Consider the relation R = {A, B, C, D, E, F, G, H, I, J} and the set of 07
functional dependencies
F={{A, B} → C, A → {D, E}, B → F, F →{G, H}, D →{I, J}}
What is the key for R? Decompose R into 2NF, then 3NF relations.

Q.2 (a) Differentiate shared lock and exclusive lock in lock-based protocol. 03
(b) Describe the Cartesian Product operation in relational algebra. 04
(c) Draw E-R diagram for student management system with the necessary 07
assumption.
OR
(c) Consider the relational database given below. Give an expression in the 07
relational algebra to express each of the following queries:
Employee (person-name, street, city),
Works (person-name, company-name, salary),
Company (company-name, city),
Manages (person-name, manager-name)
(1) Find name of all employees.
(2) Find city of employee whose name is ‘jashu’.
(3) Find name and city of all employees who are having salary>50000.
(4) Find total salary of all employees who are working for company
‘HCL’.

Q.3 (a) Describe various state of transaction. 03


(b) List and explain mapping cardinalities of E-R diagram with example. 04
(c) What is the use of two-phase locking protocol in concurrency control? 07
Describe the two-phase locking protocol in detail.
OR
Q.3 (a) What is dirty write in the transaction? Explain with example. 03
(b) What are the importance of Primary key and Unique key in database? 04
Explain with example.
(c) What is a deadlock in transaction? How to detect deadlock in system? 07
Explain with example.

Q.4 (a) Differentiate closed hashing and open hashing in DBMS. 03


1
(b) What is the role of an index in the database management system? Explain 04
dense index with example.
(c) What is the schedule in truncation? How to identify that the given schedule 07
is conflict serializable? Explain with example.
OR
Q.4 (a) What is log-based recovery? List and explain various fields use in log 03
records for log-based recovery.
(b) Discuss view serializability in transactions. 04
(c) Explain various steps involved in query processing with example. 07

Q.5 (a) Explain SQL injection in brief. 03


(b) What is the use of a cursor in PL/SQL? Explain with example. 04
(c) Consider the following relations and write SQL queries for given 07
statements. Assume suitable constraints.
job(job-id, job-title, minimum-salary, maximum-salary)
employee(emp-no, emp-name, emp-salary,dept-no)
deposit(acc-no, cust-name, branch-name, amount, account-date)
borrow(loan-no, cust-name, branch-name, amount)
department (dept-no, dept-name)
(1) Give name of employees whose employee number is '001'
(2) Give name of depositors whose branch name starts from ‘S’.
(3) Give employee name(s) whose salary is between Rs. 20000 to 30000
and department name is Finance.
(4) Update the salary of employee by 10% of their salary who is working
in the Finance department.
OR
Q.5 (a) Describe two rules of mandatory access control. 03
(b) Describe Grant and Revoke commands with suitable example. 04
(c) Write a PL/SQL program that fetches records of all students and insert 07
record as students having CPI > 4 in ELIGIBLE table and students having
CPI <= 4 in NOT_ELIGIBLE table from student_master table.

You might also like