Dbms Assgn1
Dbms Assgn1
A) Define the schema for the following databases with specific data type and
constraints, the table name and its fields name are to be taken from database
description which are given below :
(a) Retrieve the list of names and the cities of all the clients.
(b) List the various products available.
(c) Find the names of all clients having ‘a’ as the second letter in their names.
(d) List all the clients who are located in TEZPUR.
(e) Find the products whose selling price is greater than 2000 and less than or
equal to 5000
(f) Add a new column NEW_PRICE into the product_master table.
(g) Rename the column product_rate of Sales_Order_Details to
new_product_rate.
(h) List the products in sorted order of their description.
(i) Display the order number and date on which the clients placed their order.
(j) Delete all the records having delivery date before 25th August, 2008.
(k) Change the delivery date of order number ON01008 to 16-08-08
(l) Change the bal_due of client_no CN01003 to 1200
(m)Find the product with description as ‘HDD1034’ and ‘DVDRW’
(n) List the names, city and state of the clients not in the state of ‘ASSAM’
(o) List of all orders that were canceled in the of March.
(a) Find all the students’ name, city, course allotted from the CSE department.
(e) List the students who earned CGPA greater than or equal to 8.5
(g) List the common students who are allotted the same courses of both the
programme MCA and M.Tech.
(h) List the total number of student enrolled in the subject DBMS.
(j) Retrieve all the student name and arrange into ascending order.
(l) Find the total credit point of student required to complete for a course like
MCA.
(m) List the all courses which are related to computer science.
(c) Find the DA, TA, HRA of the employee name ‘Rob’.
(f) List the name grades of the employee of the CSE department.
(g) How much tax will be required to pay by an employee in each month.
(h) List the employees who are joined between ’10-APR-07’ to ’28-AUG-08’.
(m) Find the employees who have the highest bank balance.
Q. 4 :
Bank Database :
A bank database keeps record of the details of customers, accounts, loans and
transactions such as deposits or withdraws. Customer record should include
customer id, customer name, address, age, contact number, email id etc.,
accounts details involves account number, account type(fixed account, savings
account, monthly account etc), date of creation of the account. Transaction detail
keeps information about amount deposited or withdrawn to/from a particular
account and the date of transaction. The database should also store record of
loans which include loan amount, loan date and the account number to which the
loan is granted.
Make appropriate tables for the above database and try to find out the following
queries :
b) List the Name and address of account holders with loan amount more than
50,000.
d) List the account number with total deposit more than 80,000.
f) Display the details of customers who created their accounts between ’20-jan-
08’ to ’20-aug-08’.
a) List the names of the books issued between 21-aug-08 and 29-Aug-08.
c) Retrieve the name of the publisher which has maximum number of books.
g) Retrieve the name of the student to whom the book named ‘Database System’,
by ‘E.Navathe’ is issued.
Lab test information should include Test name, test number, test date, results and
referred doctor’s code.
Bed information should include bed number, ward number and status(whether
allotted or not).
Queries :
c) Display the names of the patients and lab test results performed on ‘20-jul-
08’.
f) Change the bed number of the patient to 456 where patient id=’PT023’
g) Change the status of bed with bed number 123 with ‘not allotted’.
h) List the bed details which are free in ward number 10.
i) List the name of male patients in ward no 13 taking treatment under doctor
‘XYZ’
j) List the details of patients with age more than 50 taking treatment under a
doctor, whose name like ‘das’.