SEIT DBMS PR Question Bank
SEIT DBMS PR Question Bank
1) Write down the SQL command which will show the Regd. No of Pradeep.
2) Write down the SQL command which will display the Name and Branch of Regd. No
0002.
3) Write a SQL command which will count the number of rows existing in STUDENT table.
---------------------------------------------------------------------------------------------------------------------
S2) Create the following table STUDENT with Regd No as Primary Key.
1. Find the name of all salespeople that have an order with Samsonic.
2. The names of all salespeople that do not have any order with Samsonic.
3. The names of salespeople that have 2 or more orders.
4. Display all salesperson with age less than 40.
5. Find the ID and name of sales person who is sealing product Panasonic.
------------------------------------------------------------------------------------------------------------
S4) Create a table Salesperson as follows with SID as a Primary Key and Table Product with
SID as foreign Key and PID as a primary key.
Salesperson Product
SID Name Age Salary PID SID Name City
1 Abe 61 140000 1 1 Samsonic pleasant
2 Bob 34 44000 2 5 Panasonic oaktown
5 Chris 34 40000 3 7 Sony jackson
7 Dan 41 52000 4 8 Orange Jackson
8 Ken 57 115000
11 Joe 38 38000
1. Find the name of all salespeople that have an order with Sony.
2. The names of all salespeople that do not have any order with Samsonic.
3. The names of salespeople that have 2 or more orders.
4. Display all salesperson with age more than 40.
5. Find the ID and name of sales person who is sealing product Panasonic.
--------------------------------------------------------------------------------------------------------------------
S5) Consider the following schema:
Suppliers (sid: integer, sname: varchar(50), address: varchar(60)),sid as a primary key.
Parts (pid: integer, pname: varchar(50), color: varchar(20)),pid as primary key.
Catalog (sid: integer, pid: integer, cost: real),sid and pid as a foreign key which refers
Supplier and Parts table respectively.
1) Write an SQL query that returns the project number and name for projects with a budget
greater than Rs.100,000.
2) Write an SQL query that returns all works on records where hours worked is less than
10 and the responsibility is 'Manager'.
3) Write an SQL query that returns the employees (number and name only) who have a
title of 'EE' or 'SA' and make more than Rs.35,000.
4) Write an SQL query that returns the employees (name only) in department 'D1' ordered
by decreasing salary.
5) List manager Number whose department name is “Production”.
1) Write an SQL query that returns the project number and name for projects with a budget
greater than Rs.100,000.
2) Write an SQL query that returns all works on records where hours worked is less than
10 and the responsibility is 'Manager'.
3) Write an SQL query that returns the employees (number and name only) who have a
title of 'EE' or 'SA' and make more than Rs.35,000.
4) Write an SQL query that returns the employees (name only) in department 'D1' ordered
by decreasing salary.
5) List manager Number whose department name is “Production”.
S7) Create table as follows
dept (dno, dname, mgreno).dno as a primary key
emp (eno, ename, bdate, title, salary, dno),eno as a primary key
proj (pno, pname, budget, dno),pno as a primary key, dno as a foreign refer dept
workson (eno, pno, responsibility, hours),eno and pno as a foreign key which references
table emp and proj
S11)Create table
Employee(Employee_Id,Lastname,Firstname,Middlename,Job_Id,Manager_id,Hiredate,Salar
y,Department_id)
Department (Department_Id,Name,Location_Id)
Job (Job_Id,Function)
Department (Department_Id,Name,Location_Id)
Job (Job_Id,Function)
create a Trigger to update the 'product_price_history' table when the price of the product
is updated in the 'product' table.
Create a Trigger on account table before update in new inserted amount is less than “0” then
set amount “0” else if amount is greater than 100 then set amount 100
S16) Do the following
1) Write a Procedure to find the maximum number from given three numbers.
S17) Write a PL/SQL block to calculate the grade of minimum 10 students. Using MYSQL
procedure and function.
S19) Write a Procedure with Cursor to display employees firstname & lastname whose
salary greater than 15000.
S20) Write a PL/SQL block to find odd even number. Using MYSQL procedure and
function.