0% found this document useful (0 votes)
40 views3 pages

DBMS Set 2

DBMS LABORATORY QUESTION SET 2

Uploaded by

ABI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views3 pages

DBMS Set 2

DBMS LABORATORY QUESTION SET 2

Uploaded by

ABI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

17. Create a Table as workers and the details are { S.

No, Name, Designation, Branch }


Perform the following commands:
 Alter the table by adding a column Salary
 Alter the table by modifying the column Name
 Describe the table employee
 Copy the table employee as emp
 Truncate the table
 Delete the Second row from the table
 Drop the table

18. Create the following tables


student_details {register_no, student_name, DOB, address, city}
mark_details {register_no, mark1, mark2, mark3, total }
 Display only those rows whose total ranges between 250 and 300.
 Drop the table mark_details and Delete the row whose register_no=161.
 Display all details whose names begins with 'a'.

19. Consider the following relational schema for a Loan database application:
Customer {Customer_id, Customer_name, Age, phone_no}
Loan { Loan_id, Amount, Customer_id)}
 Include the constraint on Loan_id that it starts with letter ‘L’.
 Display the list of the customer_ids and total Loan amount taken.
 Display the Customer_id and Customer_name who have taken less than two loans.

20. Consider the following database for a Banking Enterprise.


Branch{branch_name, branch_city, assets) ACCOUNT(accno, branch_name, balance}
Depositor {customer_name, accno) CUSTOMER(customer_name, customer_street,
customer_city}
Loan {loan_number, branch_name, amount}
Borrower { customer_name, loan_number)}
 Create the above tables by properly specifying the primary keys and foreign keys and
enter at least five tuples for each relation.
 Find all the customers who have at least two accounts at the main branch.
 Find all the customers who have an account at all the branches located in a specific
city.
 Demonstrate how you delete all account tuples at every branch located in a specific
city.

21. Write a procedure called proc_udate is created and stored in the database. This procedure
when called in PL/SQL block updates the qty_on_hand in the product_master table it also
updates the order_status in the sales_order table.
 Prodct_master { product_no, description, profit_percentage, unit_measure,
qty_on_hand, recorder_level, sell_price, cost_price }
 Sales_order {order_no, order_date, client_no, dely_address, salesman_no, dely_type,
billed_yn, delay_date, order_status }
22. Consider the following database consisting of the following tables:
Hostel (hno, hname, type [boys/girls])
Menu (hno, day, breakfast, lunch, dinner)
Warden (wname, qual, hno)
Student (sid, sname, gender, year, hno)
 Display the total number of girls and boys hostel in the college.
 Display the menu in the hostel ‘x’ on Tuesday.
 Display the number of wardens for each hostel.II.

23. Consider a view branch_cust defined as follows:


Create view branch_cust as
select branch_name, customer_name
from depositor, account
where depositor.account_number = account.account_number.
suppose that a view is materialized; that is the view is computed and stored. Write a trigger to
maintain the view, that is, to keep it up-to-date on insertions to and deletions from depositor or
account. Do not bother about updates.

24. Create an Employee table with an attributes { empid, empname, department designation,
Gross_salary . Using cursor, select the five highest paid employees from the Employee table.

Consider the employee relational database, Where the primary keys are underlined.
Employee ( employee_name, street, city)
Works ( employee_name, company_name, salary)
Company ( comapny_name, city)
Manages ( employee_name, manager_name)
 Find all employees in the database who earn more than each employee of Small Bank
Corporation.
 Assume that the companies may be located in several cities. Find all companies located
in every city in which Small Bank Corporation is located.
 Give all managers of first Bank Corporation a 10 percent raise unless the salary
becomes greater than $100,000; in such cases, give only a 3 percent raise.
25. Consider the following relational schema:
Employee( empno, name, office, age )
Books ( isbn, title, authors, publisher )
Loan ( empno, isbn, date )
Write the following queries in SQL:
 Print the names of employees who have borrowed any books published by McGraw-Hill.
 Print the names of employees who have borrowed all books published by McGraw-Hill.
 For each publishers, print the names of employees who have borrowed more than five
books of that publisher.

26. (a). Create a table as book (sl.no, book_name, author_name,price, edition,publisher_name ).


Perform the following operations:
 Insert minimum ten tuples in book table
 Commit the table book
 Create a save point for the table book as B
 Rollback the table book after inserting 4 & 5 row
 Define Grant & Revoke
(b). Design an application for Library Management System and Show the database
connectivity details using suitable Front End Tool.

You might also like