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

DMS final exam questions

Uploaded by

anupatil7576
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

DMS final exam questions

Uploaded by

anupatil7576
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

Write SQL statements for following:


i) Create table student with roll_no, name, date_of_birth, percentage, assign
roll_no as primary key.
ii) Add new column email in student table.
iii) Change the name of table from ‘student’ to ‘stud_info’.
iv) Delete table ‘stud_info’ with its structure and data.
2. Write a PL/SQL program to print odd numbers between 1 to 100 using while
loop.
3. Create a standard user with name Matt_DMA and “Mydbpass@123”.
4. Update a name of Student to ‘Jack’ whose roll no is 5.
5. Create following table:
Student (Enrollment, Roll_no, Name, Branch, Percentage, DOB) i)
Change roll number as unique key and make “Enrollment” attribute as
primary key.
ii) Insert any 3 Rows in a table Student.
6. Write a PL/SQL program to find sum of first 10 natural numbers. 7. Assign
update privilege to Matt on student table & verify matt’s access on student
table.
8. Write a SQL command to display student details whose city is Nashik or
Nagpur.
9. Create following table :
Student (Enrollment, Roll_no, Name, Branch, Percentage,
DOB) i) Set branch and name attribute as not null.
ii) Apply check constraint on percentage attribute so that it can hold value
above 40%.
10.Write a PL/SQL program to classify whether the entered alphabet is vowel or
consonant using CASE statement.
11.Revoke assigned privileges from matt.
12.Write a SQL command to display the name of student whose name has 2nd
character as ‘a’.
13.Create Following table:
Employee (E_id, E_name, Salary, Department)
Write SQL commands for following statement.
i) Find Summation of salary for all employees.
ii) Display employee name working in department “Quality”. 14.Write a
PL/SQL program Using nested for loop print table of 2,3,4&5… 15.Modify the
data using view Stud_DMA i.e. Modify phone number of Ramesh. 16.Convert a
string to uppercase & Print length of that string.
17.Create following table:
Employee (E_id, E_name, Salary, Department)
Write SQL commands for following statement.
i) Display Minimum and Maximum Salary.
ii) Display all record in descending order of Employee name.
18.Write a PL/SQL program to demonstrate any predefined Exception.
19.Remove the view Stud_DMA.
20.Write a SQL command to display the name of employee whose salaries are
greater than 5000 & less than 10000.
21.Create following table:
Supplier(S_id, S_name, P_id, Contact_no)
Write SQL commands for following statement.
i) Change contact_no for S-123 supplier with new number as “9876543210”. ii)
Delete from Supplier where S_id=’S-126’;
22.Write a PL/SQL function to find Area of circle.
23.Create a view called stud_info of Information_Technology course students.
24.Display the contents of this view and Remove the stud_info. 25.Create
following table:
Manufacturer (M_id, M_name, Owner, City)
Write SQL commands for following statement.
i) Add following record for new manufacturer.
Id = 123, name = xyz , Owner = jack , city = Delhi
ii) Display all manufacturers whose name starts with ‘A’.
26.Write a stored procedure to find out largest amongst three numbers.
27.Create a synonym ‘s’ for a table Student _Info table.
28.Write a SQL command to Print the date for 15 days after today’s date.
29.Create following table:
Employee (emp_no, emp_name, dept, designation,
salary,Dept_location) Write SQL commands for following statement.
i) List all Managers in Mumbai location
ii) Set salary of all ‘project leaders’ to 70000/-
30.Declare a cursor & select all students in IF course. Also display total no of
rows fetched.
31.Create a view to fetch enrollment number, name, and percentage from student
table and name it as S_View.
32.Write a SQL command to Calculate your age in terms of number of month.
33.Create following table:
Employee (emp_id, emp_name, emp_city, emp_addr, emp_dept,
join_date) Write SQL commands for following statement.
i) Display the details of employees whose joining date is after ’01-Apr
1997’.
ii) Display the total no. of employees whose dept no. is ‘10’.
34.Create a trigger on student table which gets invoked when marks are less
than 40.
35.Create an index on Student_Id in student_info table and drop the created
index.
36.Count total no of student enroll for ‘JAVA’ course.
37.Create following table:
Candidate (C_id, Seat_no, Name, Score, City)
Write SQL commands for following statement.
i) Produce record of candidate who belongs to Nashik and scored more
than 60 marks.
ii) Change the city of candidate C_10 from Pune to Mumbai.
38.Write a PL/SQL program which asks for a student ID, when the user enters an
invalid ID, the exception invalid_id is raised.
39.i) Create a sequence seq_1, start with 1, increment by 1, minimum value 1,
maximum value 20. ii)Change the seq_1 max value 20 to 50.
40.Write a SQL command to Display current day, month, year separately.
41.i) Create a table Salary with following attributes.
Column Data Type

Grade Number (10)

Losal Number (10)

ii) Add new attribute hisal and avgsal with datatype Number(10) and
Number(12) respectively to Salary table.
iii) Modify the width of hisal to 20 for Salary Table.
42.i) Create table Vehicle with attribute (V_id, Chassis_No, Type,
Number_Of_Wheels)
ii) Add one attribute to Vehicle Table as (Number_Of_Axle).
43.i) Create table customer with ID, LastName, FirstName, and Age columns
where ID, LastName, FirstName will NOT accept NULL values.

ii) For the above created customer table, specify the check constraint on age
column as Age must be greater than 18.
44.Create table student with following attributes (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) Display student whose city is ‘Mumbai’
45.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. Change contact_no for S-123 supplier with new number as
“9876543210”. ii. Add following record for new manufacturer.
Id = 123, name = xyz , Owner = jack , city = Delhi
46.Consider the following database Employee(Emp_id, emp_name, emp_city,
emp_addr, emp_Dept, join_date)
i) Display the emp_id of employee who live in city ‘Mumbai’ or ‘Delhi’. ii)
Change employee name, ‘Akash’ to ‘Jayesh’.
iii) Display the total number of employee whose dept number is 5.

You might also like