23bca3co1 Database Management Systems Question Bank 2024 Revised
23bca3co1 Database Management Systems Question Bank 2024 Revised
QUESTION BANK
MODULE 1:
SECTION – A
1. 5 Marks Questions
Blooms CO Marks
Level
1. Explain about multi-valued dependencies and Fourth normal form? L2 CO3 5
2. Explain any five roles of database administrator. L2 CO1 5
3. Discuss any five notations used in the E-R model L2 CO1 5
4. Define cardinality. Explain different types of cardinality relationships L2 CO1 5
with examples.
5 Describe the three schema architecture. L2 CO1 5
6. Explain the different views of a database. L2 CO1 5
7. Explain the properties of decomposition. L2 CO1 5
SECTION – B
2. 9 Marks Questions
1. Sketch the ER Diagram for parking management system. Mention your L3 CO1 9
assumption clearly.
2. Sketch an ER diagram for a car insurance company that has a set of L3 CO1 9
customers, each of whom owns one/more cars. Each car has been
associated with zero or any number of recorded accidents.
3. L3 9
Identify key attribute and sketch ER-Diagram for the following Movie
Database
DIRECTOR{DID,MID,fname,lname,dob, place}
MUSICDIRECTOR{MUID,fname,lname,dob,place}
ACTOR{AID,MID,fname,lname,dob,place}
PRODUCE{PID,MID,fname,lname,place}
3. L2 CO2 9
Describe the database architecture with a neat diagram.
4. i) Discuss any two data models. L2 CO1 4+5
6. Interpret the concept of Normalization (INF, 2NF, 3NF, BCNF )with L3 CO3 9
suitable example.
MODULE 2:
SECTION – A
1. 5 Marks Questions:
Blooms CO Marks
Level
1 Illustrate with example the syntax of group by and having clause in SQL. L3 CO2 5
2 Explain built in functions and aggregate functions in SQL. L2 CO2 5
3 Consider the table Employee with attributes empno, ename, job , L3 CO2 5
hiredate, salary, Comm. and table Dept with the attributes Deptno,
Deptname, loc.
i) Write a SQL query to display the empno, ename, job, hiredate, provide
alias for each column, display only employees who are working as
PRESIDENT or ANALYST, and employees belonging to deptno 10 or 20,
and ename should not start with S.
ii) Write a SQL query to display ename, salary, comm, calculate total
salary and annual salary of all employees whose salary ranges from
1000 and 2500, and employees belong to department 10 or 30. And
who is working as SALESMAN.
iii) Write a SQL query to display ename, salary, Deptno to display only
employees who are not working under any manager.
iv) Write a SQL query to display ENAME, SAL, HIRDATE display details of
employees who have been with the company for more than thirty
years, who are not drawing salary from 1500 to 3000.
v) Write a SQL query to display the details of all employees whose name
is Smith. But you are not sure in which case enames are stored. Which
statement will list all the employees whose ename is Smith?
4 Consider the table Employee with attributes empno, ename, job , L3 C O2 5
hiredate, salary, Comm. and table Dept with the attributes Deptno,
Deptname, loc.
) Write a SQL Query to display ename, deptno, salary, comm and find
increment of salary by 10%, and increment of commission by 5% for all
employees and sort salary and department number.
ii) Write a query to hike the salary of the employees below using CASE if
Job is CLERK hike by 15% If job is SALESMAN hike by 10% Or if job is
ANALYST hike by 12%.
5 Consider the table Employee with attributes empno, ename, job , L3 CO2 5
hiredate, salary, Comm. and table Dept with the attributes Deptno,
Deptname, loc.
2 Consider the table Employee with attributes empno, ename, job , L3 CO2 9
hiredate, salary, Comm. and table Dept with the attributes Deptno,
Deptname, loc.
each.
MODULE 3:
SECTION – A
1. 5 Marks Questions:
Blooms CO Marks
Level
1. Summarize on the set operators with a relevant example. L2 CO3 5
2 Define Joins. Explain different types of Joins with appropriate examples. L2 CO3 5
3 Consider the table Employee with attributes empno, ename, job , L6 CO3 5
hiredate, salary, Comm. and table Dept with the attributes Deptno,
Deptname, loc.
b. Write a SQL query to find the sum of salary by grouping according to job
and ndeptno having cross tabulation.
c. Write a SQL query to display all employees who were joined before
SMITH
joined.
d. Write a SQL query to Increase 250$ commission for BLAKE's team.
7 Consider the table Employee with attributes empno, ename, job , L6 CO3 5
hiredate, salary, Comm. and table Dept with the attributes Deptno,
Deptname, loc.
a. Write a SQL query to display the list of employees working under which
manager.
b. Write a SQL query to display ename and salary in dollar and employees
belonging to deptno 30 and 40 who are working as salesman and clerk.
c. Write a SQL query to delete the employees where employee salary is
greater
than average salary of the department salary.
d. Write a SQL query to modify the size 20 for the ename column.
8 Consider the table Employee with attributes empno, ename, job , L6 CO3 5
hiredate, salary, Comm. and table Dept with the attributes Deptno,
Deptname, loc.
MODULE 4:
SECTION – A
1. 5 Marks Questions
Blooms CO Marks
Level
1 Explain any five constraints with an example. L2 CO4 5
2 Write the queries for the following L6 CO4 5
i. Create a view empvu20 which has all employees details work for the
deptno 20.
ii. Write a SQl query to create a view on emp and dept table which has
details like ename, deptno, sal, dname and loc for deptno 10, and salary
should be between 1000 to 2000 and who are not drawing commission.
iii. Write a SQL query to create view as EMPDETAILS from the tables EMP,
DEPT and SALGRADE which contains empno, ename, job, sal, deptno,
dname,loc and grade, where employees working as ANALYST and are
not belongs to deptno 10 and 20
3 Write the queries below: L6 CO4 5
i. Create a table persons with the fields personid, first name, last
name, address and city.with primary key as personid.
ii. Insert the 5 records to the persons table considering the person
id from 101 to105.
iii. Modify the address field for the personid 101
iv. Alter the table with new field as mobileno
v. Write a SQL query to select the records who lives in Bangalore
city and stays at the address Shanthi Apartments.
4 Illustrate with an example the primary key and Foreign key along L4 CO4 5
with the constraints and syntax.
5 Explain the syntax to create table level constraints and column L2 CO4 5
level constraints with an example.
6 Write a SQL query to create a view on emp and dept table which L6 C04 5
has only details about deptno 20 Like ename, deptno, sal, dname
and loc where salary should be between 10000 to 20000 and who
are not drawing commission.
8 Write a SQL query to the following student_marks table. L6 C04 5
i.Create a table student_marks with stuid as primary
key,studname, marks,studgrade.
ii.Insert 3 records to the student marks table.
iii.create a view studentdata and display the rows with
studname,studgrade whose grades are A+.
iv.Sort the marks details of the studentdata view in ascending
order.
v.Write a query through views to display student data whose
marks lies between 80 to 95.
9. Differentiate between delete, truncate and drop commands L4 CO4 5
through suitable examples.
SECTION – B
2. 9 Marks Questions
1. Explain index and its types with an example. L2 CO4 9
2 Write the queries for the following L6 CO4 9
i. Create table job_history by Copying the structure data from
emp table.
ii. Insert three records to the emp table.
iii. Write a SQL query to display unique records from both table
emp and job_history.
iv. Write a SQL query to Display the employees work for the
company from beginning to till date from both the table emp
and job_history.
v. Write a SQL Query to display employees who joined recently
who have joined since the beginning.
3 i. Write a query to create a table PROGRAMMERS with the following 5 CO4 9
structure.
P_Name 20 Characters
DOJ Date
SAL NUMBER
EMPNO NUMBER
ii. Write a SQL query to set the primary key to the EMPNO column
iii. Write a SQL query to disable the primary key column.
iv. Write a SQL query to drop the primary key from the table.
v. Write a SQL query to drop the table.
vi. Create a view on the table PROGRAMMERS.
4 i. Write a SQL query to create the table called product with attributes L6 CO4 9
pno, pname, pprice, qty and total add the constraint not null for the
required columns and add check constraint to price >0.
ii. Add the constraint primary key to pno by modifying the table.
iii. Insert five records to the product table at run time.
iv. Add a new column special offer.
v. Delete first three records.
vi. Truncate the table product.
5 Describe views and illustrate how views are created with an L4 CO4 9
example by considering the student database with the attributes
as stuid, stuname, stuaddress, stuphone.
6 Write a query for the below statements L6 CO4 9
i. Write the syntax to alter the table to add a new column to
the table.
ii. Write the syntax to alter the table to modify the column from
the table.
iii. Write the syntax to alter table to drop column from table.
iv. Write the syntax to rename the table.
v. Write the syntax to enable the constraint.
7 i. Write a SQL query to create a manufacturer table with L6 CO4 9
manufacturerid, manufacturer_name and contact_address as
columns.
ii. manufacturer_name Should not be null.
iii. Set primary key constraint for manufacturer_id.
iv. Increase the size of the manufacturer_name column.
v. Insert at least three records.
Alter the table manufacturer with phone_number as another
column.
9 Explain the table level, column level constraints and integrity constraints L2 CO4 9
with suitable examples.
10 Define triggers? Explain types of triggers with suitable examples L2 CO4 9
MODULE 5:
SECTION – C
3. 12 Marks Questions
1 a) i)Write a SQL query to create a role as “developer “with password as L6 CO5 6
"pwd".
ii)write a SQL query to grant a CREATE TABLE privilege to the ROLE
“developer”.
iii) write a SQL query to revoke a CREATE TABLE privilege from
“developer” ROLE and write a query to drop a role called developer.
b) Write a SQL transaction that performs the following operations:
deducts a certain amount from a customer’s account balance in one
table and adds the same amount to another customer’s account L6 6
balance in a different table. Ensure that the transaction adheres to the
ACID properties and includes error handling.
2 a) Differentiate between conflict-serializability and view- L3 CO5 6
serializability. Provide examples to illustrate both concepts.
b) Given a schedule of transactions, explain how you would
determine if it is conflict-serializable. Illustrate your explanation L3 6
with an example schedule and its corresponding serialization
graph.
3 a) Discuss the concept of Serializable Schedules in the context of database L6 CO5 6
transactions. How does serializability ensure that the outcome of
concurrent transactions is equivalent to some serial execution of those
transactions?
b) Describe ACID properties in RDBMS.
L3 6
4 a) Illustrate with example Granting permissions, revoke permissions and L6 CO5 6
create user and their privileges in RDBMS.
b) Explain the importance of using ROLLBACK in a transaction and provide
an example scenario where ROLLBACK would be necessary to maintain
data integrity.
L2 6
5 a) Write SQL commands to create a new database user named L6 CO5 6
"report_user" and grant them the ability to select data from all tables in
the "Sales" schema but not modify any data.
b) Later, the role of "report_user" changes, and they now need permission
to insert data into a specific table within the "Sales" schema. Provide the
SQL command to grant this new permission and discuss the importance of L6 6
adjusting user permissions as roles evolve.
6 a)Define serializability in the context of transaction management in L6 CO5 6
RDBMS. Explain why it is important for maintaining database consistency.
b) Illustrate with examples the triggers and creating trigger for an
application of your choice. L6 6