SQL _Program_list
SQL _Program_list
2) DML Statements:
a. Add records in above table.
b. Change inv_no of I12 with ‘I111’
c. Change issue date of customer of cust_id ‘a01’ to ’22-Dec-06’
d. Change movie no of cust_id ‘a05’ to 11
e. Display all movies with issue_date between 01-jan-06 to 01-sep-06
f. Display information for cust_id ‘a01’ and ‘a02’
g. Delete records with inv_no’I11’ from invoice table.
h. Delete records having return_date<=’20-Jan-06’.
4) Create a table movie with fields mv_no(number primary key), title (char), type (char),
star(char), price(number), releasedate(date)
a. Add few records in above table.
b. Count total number of customer.
c. Calculate total price of all the movies.
d. Calculate average price of all the movies.
e. Determine the maximum and minimum movies prices and rename the title as
MAX_PRICE and MIN_PRICE.
f. Count the number of movies having price greater than or equal to 150.
g. Display all the movie which starts with letter ‘K’.
h. Display total no. of movies released in the current year.
6) PL/SQL programming
a. Write a PL/SQL block to find largest of 2 numbers.
b. Write a PL/SQL block to find largest of three numbers.
c. Write a PL/SQL block to find Factorial of a number
d. Write a PL/SQL block to display multiplication table from 1 to 10.
e. Write a PL/SQL block to find whether the entered no. is palindrome or not.
f. Write a PL/SQL block to find whether the entered string is palindrome or not.
g. Write a PL/SQL block to reverse the number.
7) Cursor
a. Write a cursor to fetch all rows of table invoice.
b. Write a cursor to display all movies with issue_date between 01-jan-06 to 01-sep-06.
If no record found then use Exception to display proper message.
c. Write a PL/SQL to accept the name and age of student and insert into table STUD
after validating age not less than 18 otherwise raise exception.
8) Create Procedure
a. Create procedure to swap two values.
b. Create procedure to display the cust_id, mv_no and call the procedure through main
program.
9) Create Function
a. Create function to find GCD of two numbers.
b. Create function to find the total price of all the movie start with letter ‘K’ and call the
function through main program.
10) Triggers
a. Create trigger that restricts the user from performing a DML on movie table on
‘Monday’
b. Create trigger to convert all the movie name into the upper case on insertion of each
row.