0% found this document useful (0 votes)
6 views

Lab Exam Model Questions

The document consists of various exercises and queries related to database management, covering topics such as retrieving records, updating tables, and performing calculations across multiple tables. It includes tasks for creating and manipulating employee, client, and sales databases, as well as implementing SQL commands like SELECT, UPDATE, and JOIN. Each section outlines specific requirements for data retrieval, insertion, and modification within the context of relational databases.

Uploaded by

abhisiva1729
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Lab Exam Model Questions

The document consists of various exercises and queries related to database management, covering topics such as retrieving records, updating tables, and performing calculations across multiple tables. It includes tasks for creating and manipulating employee, client, and sales databases, as well as implementing SQL commands like SELECT, UPDATE, and JOIN. Each section outlines specific requirements for data retrieval, insertion, and modification within the context of relational databases.

Uploaded by

abhisiva1729
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Question 1:

(Exercise on retrieving records from the table) EMPLOYEES (Employee_Id, First_Name,


Last_Name, Email, Phone_Number, Hire_Date, Job_Id, Salary, Commission_Pct, Manager_Id,
Department_Id)
( a) Find out the employee id, names, salaries of all the employees
( b) List out the employees who works under manager 100
( c) Find the names of the employees who have a salary greater than or equal to 4800
( d) List out the employees whose last name is ‘AUSTIN’
( e) Find the names of the employees who work in departments 60,70 and 80
( f ) Display the Manager ids
Question 2:
Consider the Insurance database given below. PERSON(driver_ id, name, address)CAR(regno,
model, year )
ACCIDENT(report_number,accd_date,location)
OWNS(driver_id,regno)
PARTICIPATED(driver_ id, regno, report_ number, damage_ amount).
1)Specify the primary keys and foreign keys and enter at least five tuples for each relation.
2 .Update the damage amount for the car with specific regno in the accident with report number is
1025.
3. Add a new accident to the database.
4. Find the total number of people who owned cars that were involved in accidents in the year 2018.
Question 1:
Create the Book database and do the following: book(book_name,author_name,price,quantity).
i. Write a query to update the quantity by double in the table book.
ii. List all the book_ name whose price is more than those of the book named "Database for
Dummies".
iii. Retrieve the list of author_name whose first letter is ’a’ along with the book_name
and price.
iv. count total number of books
Question 2:
Create Client_master with the following fields(ClientNO, Name, Address, City, State, bal _ due)
( a ) Insert five records
( b ) Find the names of clients whose bal_ due> 5000 .
( c ) Change the bal _ due of ClientNO “ C123” to Rs. 5100
( d ) Change the name of Client_ master to Client12 .
( e ) Display the bal_ due heading as “BALANCE” Client master table:
Question 1:
Rollback and Commit commands
Create Teacher table with the following fields(Name, DeptNo, Date of joining, DeptName, Location,
Salary)
( a ) Insert five records
( b ) Give an Increment of 25% salary for the Mathematics Department .
( c ) Perform Rollback command
( d ) Give an Increment of 15% salary for the Commerce Department
( e ) Perform commit command

Question 2:
Create the Company database with the following tables and do the following:
Administration(employee_salary, development _cost, fund_amount, turn_over,bonus)Emp_details
(emp_no, emp_name, DOB, address, doj, mobile_no, dept_no, salary).
i. Calculate the total and average salary amount of the employees of each department.
ii. Display total salary spent for employees.
iii. Perform cartesian product, union intersection.

Question 1:
(Exercise on order by and group by clauses) Create Sales table with the following fields( Sales No,
Salesname, Branch, Salesamount, DOB)
( a ) Insert five records
( b ) Calculate total salesamount in each branch
( c ) Calculate average salesamount in each branch .
( d ) Display all the salesmen, DOB who are born in December as day in character format i.e. 21-Dec-
09
( e ) Display the name and DOB of salesman in alphabetical order of the month.
Question 2:
Create an Emp table with the following fields:(EmpNo, EmpName, Job,Basic, DA, HRA,PF,
GrossPay, NetPay)
(Calculate DA as 30% of Basic and HRA as 40% of Basic)
( a ) Insert Five Records and calculate GrossPay and NetPay.Question 1:
Employee Database An Enterprise wishes to maintain a database to automate its operations. Enterprise is
divided into certain departments and each department consists of employees. The following two tables describes
the automation schemas
Dept (deptno, dname, loc)
Emp (empno, ename, job, mgr, hiredate, sal, comm, deptno)
a)Update the employee salary by 15%, whose experience is greater than 10 years.
Question 1:
Consider the following tables namely “DEPARTMENTS” and “EMPLOYEES” Their schemas are as
follows,
Departments ( dept _no , dept_ name , dept_location );
Employees (emp_id , emp_name , emp_salary,dept_no);
a)Develop a query to grant all privileges of employees table into departments table
b)Develop a query to grant some privileges of employees table into departments table
c)Develop a query to revoke all privileges of employees table from departments table
d)Develop a query to revoke some privileges of employees table from departments table
e)Write a query to implement the save point.
Question 2:
Using the tables “DEPARTMENTS” and “EMPLOYEES” perform the following queries
a)Display the employee details, departments that the departments are same in both the emp and dept.
b)Display the employee name and Department name by implementing a left outer join.
c)Perform union, intersection
d)Display the details of those who draw a salary greater than the average salary.

b)Delete the employees, who completed 30 years of service.


c)Display the manager who is having maximum number of employees working under him?
Question 2:
Employee Database An Enterprise wishes to maintain a database to automate its operations. Enterprise is
divided into certain departments and each department consists of employees. The following two tables describes
the automation schemas
Dept (deptno, dname, loc)
Emp (empno, ename, job, mgr, hiredate, sal, comm, deptno)
Using the Employee Database perform the following queries
a) Determine the names of employees, who earn more than their managers. b)
Determine the names of employees, who take the highest salary in their departments.
c)Determine the employees, who are located in the same place
.d)Determine the employees whose total salary is the minimum salary of any department.
e) Determine the department that does not contain any employees.

( b ) Display the employees whose Basic is lowest in each department .


( c ) If NetPay is less than <Rs. 10,000 add Rs. 1200 as special allowances .
( d ) Display the employees whose GrossPay lies between 10,000 & 20,000
( e ) Display all the employees who earn maximum salary .
Question 1:
(Exercise on updating records in table)Create Client_master with the following fields(ClientNO,
Name, Address, City, State, bal_due)
( a ) Insert five records
( b ) Find the names of clients whose bal_due> 5000 .
( c ) Change the bal_due of ClientNO “ C123” to Rs. 5100
( d ) Change the name of Client_master to Client12 .
( e ) Display the bal_due heading as “BALANCE” Client master table:
Question 2:
Create an Emp table with the following fields:(EmpNo, EmpName, Job,Basic, DA, HRA,PF,
GrossPay, NetPay)
(Calculate DA as 30% of Basic and HRA as 40% of Basic)
( a ) Insert Five Records and calculate GrossPay and NetPay.
( b ) Display the employees whose Basic is lowest in each department .
( c ) If NetPay is less than <Rs. 10,000 add Rs. 1200 as special allowances .
( d ) Display the employees whose GrossPay lies between 10,000 & 20,000
( e ) Display all the employees who earn maximum salary .

Question 1:
Create an Emp table with the following fields:
(EmpNo, EmpName, Job,Basic, DA, HRA,PF, GrossPay, NetPay) (Calculate DA as 30% of Basic
and HRA as 40% of Basic)
( a ) Insert Five Records and calculate GrossPay and NetPay.
( b ) Display the employees whose Basic is lowest in each department .
( c ) If NetPay is less than <Rs. 10,000 add Rs. 1200 as special allowances .
( d ) Display the employees whose GrossPay lies between 10,000 & 20,000 ( e ) Display all the
employees who earn maximum salary .
Question 2:
Create the Company database with the following tables and do the
following:Administration(employee_salary, development _cost, fund_amount,
turn_over,bonus)Emp_details (emp_no, emp_name, DOB, address, doj, mobile_no, dept_no, salary).
i.Calculate the total and average salary amount of the employees of each department.
ii.Display total salary spent for employees.
iii.Aggregate function
iii.alter command
iv.delete coomand

You might also like