Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment Introductory concepts of DBMS 1. Explain detailed 3-level architecture of database system with diagram. 2. What is DBA? What are the main duties of DBA? 3. What is DBMS? Give advantage of DBMS over RDBMS. 4. Explain various database users and administrator. 5. What are the advantages and disadvantage of database over flat file system? Relational Model 1. Define: a. Primary Key c. Super Key b. Foreign Key d. Candidate Key 2. Explain natural join operation ( ) with suitable example. 3. What is view? What are its types? Write the syntax for creating a view. What are the advantages of using view? 4. What is constraint? What are its types? Explain. 5. Consider following database: Student (RNo, Name, Address, City, Sex ) Student_marks (RNo, Sub1, Sub2, Sub3, Total ) a. Write a query to calculate total field for all the students. b. Write a query to display Roll No, Name and Total marks obtained. c. Write a query to display name(s) of students who got higher marks than average marks in Sub3. d. Write a query to display name(s) of students who got less marks than average marks in Sub2. e. Write a query to calculate Male students. f. Write a query to display names of students who got equal marks in Sub1. g. Write a query to display the name of student who got highest marks in Sub1. 6. Write a command to add new column age in student table like Student (RNo,Name,Address,City,Sex). 7. What is PL/SQL? What are the advantages of PL/SQL over SQL? 8. Explain what is trigger. What are its types? How it differs from stored procedure? 9. Explain inner join, outer join and equi-join with suitable example. 10. Write a PL/SQL program to print first 25 even numbers. 11. Explain any two DDL commands with its syntax and example. 12. What is relational algebra? Explain select and project operations with example. 13. Explain WHERE, GROUP BY and HAVING clause in select query with suitable example. 14. Write short note on: Embedded SQL programming. 15. Write a query to display today s date. 16. Write the syntax of update command. 17. Write the syntax of create table command. 18. What is stored procedure? What is stored function? What is the difference?
19. Write a PL/SQL program to print first 50 odd numbers. 20. Explain join operation. What are the different types of joins. Explain any two in detail. 21. Define following: a. Data Abstraction f. Specialization k. Data independence b. Data Redundancy g. Aggregation & Null Attribute l. Mapping cardinalities c. Data Consistency h. Trigger m. DDL d. Atomicity i. Assertions n. DML e. Instances j. Multivalued dependency o. DCL 22. List two reasons why Null values might be introduced into the database. Explain with example. 23. Explain ER Model with example. 24. Explain any four aggregate operations in SQL. 25. Explain Tuple relational calculus. 26. Explain any four relation algebra operation. 27. Explain domains and Tuples with example. 28. Write a database function which takes a number and return a square of that number. 29. Write a database trigger when update or delete operation is performed on table old value is stored in another table. 30. Explain following operation of relational algebra with example: a. Rename c. Natural join b. Select d. Cross join 31. Write a PL/SQL program to sum the digits of a given number. 32. Formulate the following queries using QBE. Branch (Branch-name, branch-city, assets) Accounts (Branch-name, acc-no, balance) a. Find all branches that have assets greater than those of at least one branch located in Bombay. b. Find the total balance of all accounts maintained at the Bombay branch. c. Find all the acc-no of account with a balance between $1300 and $2000 but not exactly $1500. 33. For Client_master, Product_master, Sales_order, Salesmen_master, Sales_order_details databases, Client_master - C (cno, cname, city) Product_master P (pno, qtyonhand, saleprice, costprice) Sales_order SO (ono, odate, cno) Salesmen_master SM (sno, sname) Sales_order_details SOD (ono, pno, qty_ordered, qty_disp, productrate) Write SQL queries for following problems. a. Find out the products which have been sold to Alpesh. b. Find the value of each product sold. c. Display the order date (odate) in the format of YY-DD-MM. d. Find the products whose selling price is more than 1500. Calculate new selling price as original selling price * 0.15. Rename the new column in the above query as new price. e. Find the names of all clients having a as the second last letter in their names. f. Find the date, 15 days after today s date. g. Construction sentence with following data: My name is {cno} and I am from {city}.
h. Count the number of products having price greater than or equal to 1500. 34. List two major problems with processing update, insert operations expressed in terms of views. 35. What is cursor? Explain any four cursor attributes. 36. What is referential integrity? Explain it with example. 37. For customer salesman and orders schema given below write any five of the following queries in SQL. Customer (Cnum, Cname, city, Rating, Snum) Salesmen (Snum, Sname, city, Rating, Commission) Order (Onum, Amount, Odate, Cnum, Snum) a. List of Snum of all salesmen with order in order table without any duplicates. b. Find the largest order taken by each salesman on date 10/03/97 (mm/dd/yy). c. List all orders of salesman who are living in Baroda. d. Find all orders attributed to salesmen in London using subquery method. e. Find all salesmen with more than one order. f. Find out all the customers in alphabetical order whose name begin with C. g. Calculate average amount ordered on each date. 38. Explain following terms: a. Rollback b. Commit 39. For supplier part database: S ( S#, Sname, Status, City) P (P#, Pname, Color, Weight, City, Price) SP (S#, P#, Qty) Write SQL solutions for the following queries: a. Get total number of suppliers. b. Get part number of all part supplied by more than one supplier. c. Get supplier names for supplier who supply at least one red part. d. Get supplier names for suppliers who do not supply part P2. e. Get supplier names for suppliers who supply part P2. f. Get all pair of city names such that a supplier located in the first city supplies a part stored in the second city. g. Find supplier details who supply blue parts. h. Find the part details which is being supplied by all suppliers. i. List part details which is sold in quantity more than 50. j. For every supplier, find total price for every part the supplies. k. Find total quantity sold for every part. l. Display maximum quantity for part P2. m. For Each part, display part number and total quantity. n. Display all parts where quantity is less than 50. o. Write PL/SQL program to print the number 1 to 8 on screen. p. Write PL/SQL block to calculate the area of circle for a value of radius varying from 3 to 7. Store the radius and the corresponding values of calculated area in Areas table.
q. Table: Employee (empname, deptno, salary), Write a PL/SQL block that will display the name, department and salary of the first 10 employees getting the highest salary. r. Explain explicit cursor. A personal relational database system uses the following scheme: Emp (eno, ename) Write down SQL query to find out (N+1)/2 th row if N is odd, N/2 th row if N is even. Note: N is number of rows in Emp table. ER Model & Relational Database Design 1. Consider the relation supp-part (sno, sname, status, city, pno, qty ). Is this relation in 3NF? If not convert it into 3NF. 2. Draw an E-R diagram for a book-store having information about books, authors and publishers. 3. What type of problems can occur in wrong database design? 4. Draw an E-R diagram for students, subjects and teachers. Each teacher teaches only one subject. 5. What is FD? A relation R is given with attributes A,B, C, D and FD s: { A BC, B C, A B, AB C, AC D } Compute an irreducible set of FDs that is equivalent to this given set. 6. Draw the symbols used in E-R diagram for following: a. Weak Entity set d. Relationship set g. Tuple b. Strong Entity set e. Relation c. Derived attribute f. Attribute 7. Explain normalization using suitable example. 8. What is normalization? Explain 2NF with example. 9. Explain Boyce/Codd normalization with example. 10. Why is the Normalization required? Define 3NF. 11. What is Heath s theorem? Explain with example Non-loss Decomposition. 12. Which NF is considered adequate for normal relational database design? Why? Explain in detail. 13. Explain Armstrog s Axioms. Suppose R is given with attribute (A, B, C, D, E, F) and Functional dependencies are {A C, A B, CG H, CG I, B H}, So Find F. Query Processing & Query Optimization 1. Write short note on cost-based optimization. 2. Enlist and briefly define steps of query processing. Transaction Management 1. What is transaction? Explain transaction control commands of SQL. 2. What is transaction? Explain its ACID properties. 3. Write short note on: Two Phase Commit Protocol. 4. Write an algorithm for Restart Procedure for finding out REDO and UNDO lists of transactions. 5. Explain different categories of transactions showing checkpoint time and failure time. Also find out REDO list and UNDO list. 6. What is concurrency? Explain any problems that occur due to concurrency. Also explain how they can be solved? +
7. What is concurrency? Explain uncommitted dependency problem. Also explain how it can be solved. 8. What is recovery? Discuss immediate database modification methods with example. 9. Define Transaction. Draw and explain state diagram of Transaction. 10. Describe Deadlock prevention. 11. What is serializability? Explain conflict serializability and view serializability. 12. Explain how locking solves the problems of concurrency related problems. 13. Explain Time Stamp based protocol. 14. Explain locking mechanism for concurrency control. 15. Explain validation based protocol. 16. Explain deadlock detection and recovery procedure. 17. Explain exclusive lock and shared lock with example. 18. State and write ahead log rule. 19. Explain Failure classification. 20. Write a short note on Shadow Paging. 21. Give example and solution of cascading Rollback. 22. Discuss lost update problem and how it can be solved. 23. Explain system recovery procedure with all categories of transactions. 24. List the two approaches to data security. =========XXXXX==========XXXXX==========XXXXX==========XXXXX==========XXXXX=========