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

Practical List

The document contains 20 questions related to SQL and PL/SQL. The questions cover topics like creating and manipulating tables, performing joins, writing queries, creating views, handling exceptions, defining constraints and more.

Uploaded by

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

Practical List

The document contains 20 questions related to SQL and PL/SQL. The questions cover topics like creating and manipulating tables, performing joins, writing queries, creating views, handling exceptions, defining constraints and more.

Uploaded by

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

SANDIP POLYTECHNIC

MSBTE Internal Exam (Summer 2024)


Diploma in Information Technology (IV)
Database Management (22416)

1. Write SQL Statement for following:


i. Create table Vehicle with attribute (V_id, Chassis_No, Type, Number_Of_Wheels) use
Chassis_No as primary key.
ii. Add one attribute to Vehicle Table as (Number_Of_Axle) .

2. Consider following Schema and perform specified join operations.


Emp (E_id, E_Name, D_id, Manager)
Department (D_id, D_name, Location)
i. Perform Inner join on above table.
ii. Perform Left Join on Department and Emp Table.

3. Consider schema Candidate (C_id, Seat_no, Name, Score, City) Write SQL Command for
following
i. Display Candidate who scored between 60 and 70 Marks.
ii. Display Candidate whose city is either Pune or Mumbai.
iii. Produce record of candidate who belongs to Nashik and scored more than 60 marks.
iv. Change the city of candidate C_10 from Pune to Mumbai.

4. Write SQL Commands for following statements.


i. Create user Jack having password as ‘MSBTE@123’.
ii. Assign create and update privileges to ‘Jack’.
iii. Remove Update privileges from ‘Jack’.

5. Write SQL Commands to perform following operations on View.


i. Create a view to fetch enrollment number, name, and percentage from student table and name
it as S_View.
ii. Display record from S_View where percentage is greater than 60.
iii. Delete view named as S_view.

6. Consider following schema


Employee (E_id, E_name, Salary, Department)
Write SQL commands for following statement.
i. Find Summation of salary for all employees.
ii. Display Minimum and Maximum Salary.
iii. Display all record in descending order of Employee name.
iv. Display employee name working in department “Quality”

7. Consider following schema:


Employee (E_id, First_name, Last_name, Salary, Department)
Write SQL commands for following statement.
i. Find length of employee names.
ii. Concatenate first name and last name of employee.
iii. Left pad each department name with “***”.
iv. Right pad each department name with “$$$”.
8. Create table for following schema.
i. Student (Enroll_no, Roll_no, Name, Percentage);
ii. Worker(W_id, W_name, Joining_Date, Department)
iii. Book (Book_id, Book_name, Author, Price, ISBN)

9. Consider given Schema. Write SQL Command for following statement.


Product (P_id, Name, Quantity, Price);
Supplier (S_id, S_name, P_id, Contact_no)
Manufacturer (M_id, M_name, Owner, City)
i. Increase Price of all products by 20% having product id P-123.
ii. Change contact_no for S-123 supplier with new number as “9876543210”.
iii. Add following record for new manufacturer.
Id = 123, name = xyz , Owner = jack , city = Delhi
iv. Display records of products supplied by supplier S-125.
v. Eliminate Supplier with Supplier id S-126.
vi. Display all manufacturers whose name starts with ‘A’.

10. Write a PL/SQL code to find sum of numbers from 1 to 20.

11. Consider the following schemas


Student(rollno, name, dt_of_birth,telephone)
Marks (rollno, sub1_marks, sub2_marks, per) Write SQL queries
for the following.
i) Display student’s rollno, name, and marks of both subjects for all
students.
ii)Delete all those students records who secured less than 35%
iii)Display all the students whose name start with ‘A’
iv)Update telephone number of student with rollno 101 as 9800010111

12. Write a PL/SQL code to raise zero_divide exception, in case of division of a number by
another.

13. Write SQL statements for following


i) Create table student with rollno, name, d-o-b, percentage, assign rollno as primary key.
ii) Add new column email in student table.
iii) Delete table ‘student’ with its structure and data.

14. Consider following schema:


employee{empid,empname,designation,salary,deptno}
dept { deptno,deptname,location}
Write SQL queries for following :
i)Find maximum salary for deptno=10;
ii Increase salary of all employee by 5%
iii)Get the names of all ‘Manager’
iv) Display deptnames located at ‘Pune’ and ‘Nagpur’.
15. Write a PL/SQL code to create a function name square_no to calculate square of number and
also have another PL/SQL code to call this function.

16. Give syntax for creating a view. Consider following schema- ACCOUNT (Account_No, Name,
Account_Type, PAN_Number, Balance). Create a view on ACCOUNT having attributes
(Account_No, Name, PAN_Number) where balance is less than 10,000.

17. Consider the following data base scheme student (roll_no, name, city, marks, result). Write
queries for the following:
(i) Display all students having result as first class.
(ii) Update roll-no of each student by adding 18 to it.
(iii) Delete percent column from table.
(iv) Display student whose city is ‘Mumbai’

18. Consider following schema


Employee (empid, ename, address, designation, salary)
Perform following operations on this schema
(i) Add column city varchar (15)
(ii) Change ename from ‘Vijay’ to ‘Sachin’
(iii) Display employees having salary more than 50000
(iv) Delete record having ename as ‘Sanjay’

19. Write PL/SQL code using user defined exception for following scenario.
If salary of employee is greater than 20,000 after giving raise by 20% then raise exception stating
“Salary too high”.

20. Create employee table with following Integrity constraints. employee (empid, ename,
phone, dob, addr, designation salary, deptno)
(i) empid as primary key
(ii) Phone as unique
(iii) deptno as not null
Also create dept table as dept (deptno, dname, totalemp)
where deptno as primary key and totalemp with check
constraint as totalemp > 10

You might also like