Sunteți pe pagina 1din 8

DBMS

Q1. Create a table Student taking the attributes given bellow


Roll_no, Student_name, Address, Date_of_addmission, Class
Section and Contact_no.

Write query
a) To insert the value in Student table.
b) To delete the value from Student table
c) To search student Name with roll_no >20.
d) To search Date_of_addmission which roll_no between 20 and 30.
e) To drop Table.
f) To change student name Akshay by Amar.
g) Alter the table.
=============================================================
==

Q.2 Create a table Employee taking the attributes given bellow


Emp_no, Emp_name , Address , Date_of_joining , Contact_no
and Salary

Write query
a) to insert the value in Employee table.
b) to Delete the particular value from Employee table
c) to search Emp_name ,Address ,Date of joining which Emp_no
greater than 20.
d) to search Salary which Emp_no greater than20 but less than 30
e) to display all the field from a table.
f) to insert a new field in Employee table.

===============================================================

Q3 Create table Department, Employee Taking the attributes given bellow.

Employee (EmpNo, Empname,address,Dno)


Department ( Dno, Dname, Dlocation )

Write query
a) to insert the value in Department and
Employee table.
b) to Retrieve the name and address of all Employees who work on
research department.
c) to retrieve the dlocation where administration department is located.

d) to delete the particular record from the table.


===========================================================
Q4. Create table student and course taking the attributes given bellow.

Student (Roll_no, Name, Class, course_no)

Course (Course_no,Course_name)

Write Query
a) to insert command to insert the value in Student and
course table.
b) to retrive the name of all student whose roll_no less than 22.
c) to retrive the Student Name whose course name is cs.
d) to drop table.

===============================================================

Q5. Create table Employee, Department, DeptLocation, Works_on, and Project taking the
attributes given bellow.

Employee (Fname, Lname, Eno,Bdate,Address,Salary,Dno,Supereno)

Department (Dname,Dnumber,mgrno,mgrstartdate)

DeptLocations(Dnumber,DLocation)

Works_on(EENo,PNo,Hours)

Project(Pname,Pnumber,Plocation,Dnum)

Dependent(Eeno,Dependent_name,Sex,DOB,Relationship)

Write the Query to

a) insert the data of all the above tables.


b) retrive the name and address of all employees who work on Research
department.
c) find the names of employees who works on all the projects controlled by
department number 6.
d) retrieve the name of the manager of each department.
e) retrieve the location where administration department is located.
Q6 Create table Employee, Department, DeptLocation, Works_on, Project and
Dependent taking the attributes given bellow.

Employee (Fname, Lname, Eno,Bdate,Address,Salary,Dno,Supereno)


Department (Dname,Dnumber,mgrno,mgrstartdate)
DeptLocations(Dnumber,DLocation)
Works_on(EENo,PNo,Hours)
Project(Pname,Pnumber,Plocation,Dnum)
Dependent(Eeno,Dependent_name,Sex,DOB,Relationship)
Write Query
1) Insert data in the above table.
2) Retrieve all employees whose address is in Hyderabad.
3) For every project located in Mumbai list the project_number, the controlling
department and department manger name and address.
4) For each employee, retrieve the employees first and last and first and last of his or
her immediate Supervisor,.
5) Find out how many employees are there in each branch.

Q7) Create table Employee, Department, DeptLocation, Works_on, and Project


taking the attributes given bellow.

Employee (Fname, Lname, Eno,Bdate,Address,Salary,Dno,Supereno)

Department (Dname,Dnumber,mgrno,mgrstartdate)

DeptLocations(Dnumber,DLocation)

Works_on(EENo,PNo,Hours)

Project(Pname,Pnumber,Plocation,Dnum)

Dependent(Eeno,Dependent_name,Sex,DOB,Relationship)

Write query
1) Insert value in the above table.
2) Find the total sum of salary of all employees of the “Research” department, as
well as the maximum, minimum and average salary in this department.
3) Retrive the name of all employee who have no dependent.
4) Alter the “Employee” table by deleting the coloumn Supereno.
5) Retrive the Fname, Lname oaf all employee whose salary higher than average
salary.
Q8) Create table Employee, Department, DeptLocation, Works_on, and Project taking
the attributes given bellow.

Employee (Fname, Lname, Eno,Bdate,Address,Salary,Dno,Supereno)

Department (Dname,Dnumber,mgrno,mgrstartdate)

DeptLocations(Dnumber,DLocation)

Works_on(EENo,PNo,Hours)

Project(Pname,Pnumber,Plocation,Dnum)

Dependent(Eeno,Dependent_name,Sex,DOB,Relationship)
Write query
1) Insert value in the above table.
2) For each department retrieve the department number, the number of
employee in the department and their average salary.
3) For each department that has more than five employee retrieve the department
number of each employee who are making salary more than Rs 40,000.
4) Retrive the name of all employees who have two or more dependent.
5) Retrieve the employee number of all employees who works on project number
1,2,3.

Q9) Create Table

Client_master ( Client_no, name, address, Bdue)


Product_master(P_number,Description,Profitpercent,unitmaster,saleprice,costpric)
Sales_master(Salesmno,Sname,Addres,Salamnt,Remarks)
Sales_order(O_no,Client_no,Odate,Delyaddr,Salesmno)
Sales_order_detail(Order_no,Priduct_no,Qtyorder,productrate,Qtydisp)

Write query
1) Insert data in the above table.
2) List the name of all clients having ‘a’ as the second letter in their names.
3) Retrive the description and total Qty sold for each product.
4) List the order no. and date on which clients place their order.
5) Find product no. and description of non moving product (i.e product not being
sold)
Q10) Create Table

Client_master ( Client_no, name, address, Bdue)


Product_master(P_number,Description,Profitpercent,unitmaster,saleprice,costpric)
Sales_master(Salesmno,Sname,Addres,Salamnt,Remarks)
Sales_order(O_no,Client_no,Odate,Delyaddr,Salesmno)
Sales_order_detail(Order_no,Priduct_no,Qtyorder,productrate,Qtydisp)

Write query
1) Insert data in the above table.
2) List all client who stay in ‘Bangalore’ or ‘Mumbai’.
3) Find the value of each product sold.
4) List the Product no. and description of constantly sold (i.e rapidly moving)
products.
5) Find the name and address for the customer who place order no. 9001.

Q11) Create Table

Client_master ( Client_no, name, address, Bdue)


Product_master(P_number,Description,Profitpercent,unitmaster,saleprice,costpric)
Sales_master(Salesmno,Sname,Addres,Salamnt,Remarks)
Sales_order(O_no,Client_no,Odate,Delyaddr,Salesmno)
Sales_order_detail(Order_no,Priduct_no,Qtyorder,productrate,Qtydisp)

Write query
1) Insert data in the above table.
2) List the clients who stay in a city whose First letter is ‘M’.
3) Find the names of clients who have purchased ‘Trouser’.
4) Find the name of client who have place of worth Rs 10000 or more.
5) Find the total order place by each customer.

Q12) Create Table

Client_master ( Client_no, name, address, Bdue)


Product_master(P_number,Description,Profitpercent,unitmaster,saleprice,costpric)
Sales_master(Salesmno,Sname,Addres,Salamnt,Remarks)
Sales_order(O_no,Client_no,Odate,Delyaddr,Salesmno)
Sales_order_detail(Order_no,Priduct_no,Qtyorder,productrate,Qtydisp)

Write query
1) Insert data in the above table.
2) Retrive the information from the Sales_oredr table for the order placed on 5th
September-2010.
3) Find the product and their quantities for the orders placed by client_no 1002
and 1003.
4) Find out if the product ‘T-Shirt’ has been order by any client and print the
Client no. and name to whome it was sold.
5) List product whose selling price greater than 500 and less than or equal to 700.

Q13) Create Table

Client_master ( Client_no, name, address, Bdue)


Product_master(P_number,Description,Profitpercent,unitmaster,saleprice,costpric)
Sales_master(Salesmno,Sname,Addres,Salamnt,Remarks)
Sales_order(O_no,Client_no,Odate,Delyaddr,Salesmno)
Sales_order_detail(Order_no,Priduct_no,Qtyorder,productrate,Qtydisp)

Write query
1) Insert data in the above table.
2) Calculate the average Qty sold for each client that has maximum order value of
Rs 150000.
3) List the product and order from customer who have order less than 5 unit of
‘Jeans’.
4) Find the value of each product sold.
5) Find total sale price for all product sold.

Q14) Create table

Author(Author_id, Name, City, Country)


Catalog(Book_id, Title, Author_id, Publisher_id, Category_id, Year, Price)
Publisher( Publisher_id, Name, City, Country)
Order_details( Oredr_no, Book_id, Quantity)
Category(Category_id, Description)
Order_summery(Order_no,Member_id,Odate,Amount,Ostatus)
Member(Member_id, Name, Address, Contact)
Book(Book_id, Title, Author, Publisher Year, Price)

Write query
1) Insert value in the above table.
2) Retrive the title, author, and publisher names of all books published in 1999
and 2006.
3) Retrive the title of the book whose author is ‘A Tanenbum’.
4) Get the details of all books whose price is greater than the average price of
the books.
5) Get the names of all the books for which an order has been placed.
Q15) Create table

Author(Author_id, Name, City, Country)


Catalog(Book_id, Title, Author_id, Publisher_id, Category_id, Year, Price)
Publisher( Publisher_id, Name, City, Country)
Order_details( Oredr_no, Book_id, Quantity)
Category(Category_id, Description)
Order_summery(Order_no,Member_id,Odate,Amount,Ostatus)
Member(Member_id, Name, Address, Contact)
Book(Book_id, Title, Author, Publisher Year, Price)

Write query
1) Insert value in the above table.
2) Get the title and price of all the books whose price is less than the average
price of the books.
3) Get the names of all authors who have more than two books in the catalog.
4) Get the details of the authors whose books are being sold form the book club.
5) Get the title and price of all books whose price is greater than the maximum
of the category average.
COMPILER

Q1) Write a program to reorganize data type as ‘integer’, ‘float’ and ‘exponent’.
Q2) Write a program to reorganize a DFA as b*abb.
Q3) Write a program to represent a simple one pass compiler.
Q4) Write a lex program to generate token.
Q5) Write an YACC using C for a simple calculator.

S-ar putea să vă placă și