The document contains details of two class tests for the subject Database Management Systems including questions from the question bank. Test I contains 4 questions from the question bank to be attempted and 3 long questions. Test II also contains 4 questions from the question bank and 3 long questions. The question bank section lists 38 questions on various database concepts like keys, SQL, data models, ER diagrams, PL/SQL etc. along with examples.
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
Rdbms class test ii sep 2019
1. G.S.MANDAL’S
MIT POLYTECHNIC ROTEGAON (0777)
CLASS TEST II-A
COURCE NAME: CO 3I SEMESTER: THIRD SEM
SUBJECT: DMS SUBJECT CODE: 22319
TIME: 1 HOUR DATE: /09/2019 MAX MRKS: 20
Q.1 Attempt Any FOUR. 08 Marks
1. Define Primary key and Foreign Key.
2. What is SQL? State its features.
3. List data model
4. List and draw any four symbols used in ER Model.
5. What is NULL value?
6. Define Commit and Rollback
7. What is view?
8. State any four DDL commands
9. State DML commands.
10. State DCL and Data transaction language commands
11. State Select clauses.
Q.2 Attempt any THREE. 12 Marks
1. Consider the structure Employee (empname, empid, dob, salary, job)
Create a view on employee having attribute (empname, empid, dob, salary, job) where salary is greater
than 20,000.
2. Consider the structure Employee (emp_no,emp_name, dept, salary, designation,
dept_location) Solve following queries :
(i) List all managers in Mumbai location.
(ii) Set salary of all ‘project leaders’ to ₹ 70,000.
(iii) List employees with having alphabet ‘A’ as second letter in their name.
(iv) Display details of those employees who work in Mumbai or Chennai.
3. Consider the structure for book table as Book-master = {bookid, bookname, subcode-
author, no_of copies, price} Write SQL
queries for following:
(i) Display total no. of books for subject „DBM‟
(ii) Get authorwise list of all books.
(iii) Display all books whose prices are between Rs.200 and Rs.500
(iv) Display all books with details whose name start with „S‟
4. Explain create and drops sequence with example.
5. Explain any four String functions with example.
6. Explain database security with its requirements in detail.
7. Explain Transaction ACID properties.
8. Explain difference between delete and truncate command with example.
2. G.S.MANDAL’S
MIT POLYTECHNIC ROTEGAON (0777)
CLASS TEST II -B
COURCE NAME: CO 3I SEMESTER: THIRD SEM
SUBJECT: DMS SUBJECT CODE: 22319
TIME: 1 HOUR DATE: /09/2019 MAX MRKS: 20
Q.1 Attempt Any FOUR. 08 Marks
1. Define synonyms and Index
2. State PL/SQL output statement with syntax and example.
3. Explain and draw PL/SQL as block structure.
4. State syntax to create, open and close cursor in PL/SQL block.
5. Draw the state diagram of transaction.
6. Define Database Backup and Database recovery.
7. Describe Grant and Revoke commands.
8. List the types of cursor.
9. List out any four advantages of PL/SQL.
10. Define Normalization, list its types.
11. Enlist four aggregate functions.
Q.2 Attempt any THREE. 12 Marks
1. Consider the following database
Employee(emp_id,emp_name,emp_city,emp_addr,emp_dept,join_date)
i) Display the emp_id of employee who live in city ‘Pune’ or ‘Nagpur’.
ii) Change the employee name ‘Ayush’ to ‘Ayan’.
iii) Display the total number of employee whose dept is 50.
2. Create a sequence
i. Sequence name is Seq_1, Start with 1, increment by 1, minimum value 1, maximum value
20.
ii. Use a seq_1 to insert the values into table Student( ID Number(10), Name char(20));
iii. Change the Seq_1 max value 20 to 50.
iv. Drop the sequence.
3. Write a PL/SQL program which accepts the customer_ID from the user. If the enters an invalid
ID then the exception invalid_id is raised using exception handling.
4. Execute the following commands
i) create user ‘Rahul’
ii) grant create, select,insert,update, delete, drop privilege to ‘Rahul’
iii) Remove the select privilege from user ‘Rahul’
5. Explain states of transaction with the help of diagram.
6. List the SQL operations and explain range searching operations between and pattern matching
operator ‘like’ with example.
7. Consider the following database
Employee (emp_id,emp_name,emp_city,emp_addr,emp_dept,join_date)
i) Display the emp_id of employee who live in city ‘Pune’ or ‘Nagpur’.
ii) Change the employee name ‘Ayush’ to ‘Ayan’.
iii) Display the total number of employee whose dept is 50.
8. Consider the following schema Depositor (ACC_no, Name, PAN, Balance). Create a view on
Depositor having attributes(ACC_No, PAN) where balance is greater than 100000
3. Question Bank
1. Define Primary key and Foreign Key.
2. What is SQL? State its features.
3. List data model
4. List and draw any four symbols used in ER Model.
5. What is NULL value?
6. Define Commit and Rollback
7. What is view?
8. State any four DDL commands
9. State DML commands.
10. State DCL and Data transaction language commands
11. State Select clauses.
12. Define synonyms and Index
13. State PL/SQL output statement with syntax and example.
14. Explain and draw PL/SQL as block structure.
15. State syntax to create, open and close cursor in PL/SQL block.
16. Draw the state diagram of transaction.
17. Define Database Backup and Database recovery.
18. Describe Grant and Revoke commands.
19. List the types of cursor.
20. List out any four advantages of PL/SQL.
21. Define Normalization, list its types.
22. Enlist four aggregate functions.
23. Consider the following database
Employee(emp_id,emp_name,emp_city,emp_addr,emp_dept,join_date)
i) Display the emp_id of employee who live in city ‘Pune’ or ‘Nagpur’.
ii) Change the employee name ‘Ayush’ to ‘Ayan’.
iii) Display the total number of employee whose dept is 50.
24. Create a sequence
i. Sequence name is Seq_1, Start with 1, increment by 1, minimum value 1, maximum
value 20.
ii. Use a seq_1 to insert the values into table Student( ID Number(10), Name char(20));
iii. Change the Seq_1 max value 20 to 50.
iv. Drop the sequence.
25. Write a PL/SQL program which accepts the customer_ID from the user. If the enters an invalid
ID then the exception invalid_id is raised using exception handling.
4. 26. Execute the following commands
i) create user ‘Rahul’
i) grant create, select,insert,update, delete, drop privilege to ‘Rahul’
ii) Remove the select privilege from user ‘Rahul’
27. Explain states of transaction with the help of diagram.
28. List the SQL operations and explain range searching operations between and pattern matching
operator ‘like’ with example.
29. Consider the following database
Employee (emp_id,emp_name,emp_city,emp_addr,emp_dept,join_date)
i) Display the emp_id of employee who live in city ‘Pune’ or ‘Nagpur’.
ii) Change the employee name ‘Ayush’ to ‘Ayan’.
iii) Display the total number of employee whose dept is 50.
30. Consider the following schema Depositor (ACC_no, Name, PAN, Balance). Create a view on
Depositor having attributes (ACC_No,PAN) where balance is greater than 100000.
31. Consider the structure Employee (empname, empid, dob, salary, job)
Create a view on employee having attribute (empname, empid, dob, salary, job) where salary is greater
than 20,000.
32. Consider the structure
Employee (emp_no,emp_name, dept, salary, designation, dept_location)
Solve following queries :
a. List all managers in Mumbai location.
b. Set salary of all ‘project leaders’ to ₹ 70,000.
c. List employees with having alphabet ‘A’ as second letter in their name.
d. Display details of those employees who work in Mumbai or Chennai.
33. Consider the structure for book table as
Book-master = {bookid, bookname, subcode-author, no_of copies, price} Write SQL
queries for following:
a. Display total no. of books for subject „DBM‟
b. Get authorwise list of all books.
c. Display all books whose prices are between Rs.200 and Rs.500
d. Display all books with details whose name start with „S‟
34. Explain create and drops sequence with example.
35. Explain any four String functions with example.
36. Explain database security with its requirements in detail.
37. Explain Transaction ACID properties.
38. Explain difference between delete and truncate command with example.
5. Example 1 :- Write a PL/SQL program which accepts the customer_ID from the user. If the
enters an invalid ID then the exception invalid_id is raised using exception handling.
Ans
DECLARE
c_id numeric(10);
Invalid_id_Exception Exception;
BEGIN
c_id:= &c_id;
if (c_id<0) then
raise invalid_id_Exception;
end if;
EXCEPTION
WHEN invalid_id_Exception THEN
dbms_output.put_line('Invalid customer id');
END;