Sunteți pe pagina 1din 5

1. Create a student table that contains sid,sname,branch,sem,dob,marks and write the queries to carry out the following operation.

i. ii. iii. i . . i. ii. iii. Describe the structure of student table. Rename student table as csestudent. Alter the student table to contain address of the student,and also modify the size of sname. !nsert rows into the table. "sing arious ways of insertion#insert$command. Display the content of the table. Delete some rows from student table based on conditions. Delete all records. Drop the student table.

%. &rite a pl'sql program to check whether the gi en number is prime or not. (. Create student table with the following fields rollno, name branch and apply constraints. ). &rite a *+',-+ block for inserting rows into ./*D.0 table with the following Calculations1 2RA3456 78 9A,!C DA3%56 78 9A,!C *83:6 78 9A,!C ;.0*A<39A,!C=DA=2RA>*8 4. Create a customer database with the fields first name, last name, address, city, country, birth date and write the queries to carry out the following operations. 1. Add a new field ?@.;D.RA to this table. %. Change the length of the address field. (. 8ind all customers whose first name contains ?raA. ). 8ind all customers whose first name starts with the letter ?aA. 4. 8ind all customers whose last name ends with ?BA. C. Display the customerAs name in alphabetical order. :. Display the customerAs name in re erse alphabetical order. D. "se A;D operator to display each customer with first name ?ra iA and last name ABothiA. E. "se 7R operator to display each customer with first name ?ra iA or last name ?kumarA.

15. "se both A;D,7R operator to display the customer with first name ?ra iA or first name ?DeepakA and last name ?raBA. C. Connect F9 with 7racle using AD7DC :. &rite a pl'sql code block that will accept an account number from the user,check if the users balance is less than minimum balance,only then deduct rs.155'> from the balance.this process is fired on the account table. acct#name ,curGbal ,acctno D. .Create a table called ./* with the following structure. .mp#./*;7, .;A/., H79, /@R,D.*0;7, ,A+ $ And write the queries to carry out the following operations. 1. ,elect all employees from department numbers :(CE,:)EE. %. Display all the details of the records whose employee name starts with ?,A. (1 Display all the details of the records whose employee name does not starts with ?,A. )1 Display the rows whose empno ranges from :455 to :C55. 41 Display the rows whose empno not in range from :455 to :C55. C1 Calculate the square root of the salary of all employees. :1 Count the total records in the emp table. D1 Calculate the total and a erage salary amount of the emptable. E1 Determine the maI and min salary and rename the column as maIGsalary and minGsalary. 151 Display total salary spent for employees. E. &rite a pl'sql program to find the factorial of a gi en number 15. Create a procedure which recei e branch code as a parameter and calculates the total gain due to reser ation and loss due to cancellation and also count the total number of total number of reser ation and cancellation. reser e#trGno ,resam $J cancel#trGno ,canam $J total#trGnum ,totalGres ,totalGcancel ,resGcount ,canGcount $J 11. . Create employee and orders database to illustrate Boins.

employee#empGid ,empGname $J orders#prodGid ,product ,empGid $J 1. &ho has ordered a product and what did they orderK %. &ho ordered a printerK (. +ist all employee and their orders. ). +ist all orders and who has ordered. 1%. Create a function which recei es day number of the week as a parameter and return the day in character format and also write a *+ ,-+ to call the function to find out the days the flight are flying. flight#flightGno ,dayGnum $J 1(. Create an emp table with the following fields .;7, .;A/.,H79 , ,A+ and write the queries to carry out the following operations 1. Display all the employees %. Count the number of employees (. 8ind the sum of all employees salary ). 8ind the a erage salary of all employees 4. 8ind the maIimum salary among the employees C. 8ind the minimum salary among the employees :. 8ind the deptno along with the maIimum salary in the department. D. 8ind the deptno along with the minimum salary in the department E. 8ind the Departments which are ha ing maIimum salary less than (555J 15. 8ind the Departments which are ha ing minimum salary greater than 1555 1). Create the following databases to illustrate nested subqueries. D.*7,!07R# C",0G;A/. ACCG;7$ 97RR7&.R#C",0G;A/.,+7A;G;7$ ACC7";0#ACCG;7, 9RG;A/., 9A+A;C.,$ +7A;#+7A;G;7,9RG;A/.,A/7";0, 9RA;C2#9RG;A/. , 9RGC!0<, A,,.0,$ 1. 8ind all the customers who ha e both account and loan.

%. 8ind all the customers who ha e loan at the bank and do not ha e account at the bank. (. 8ind all the customers who ha e account at the bank and do not ha e loan at the bank. ). 8ind the customers in the bank whose names are either nisha or ramya. 4. 8ind the name of the customers who ha e an account at the bank whose account number are either C:E54 or E54D5 C. 8ind the name of customers who ha e an account at the bank are neither nisha nor ramya. :. 8ind the name of customers who ha e an account at the bank whose account numbers are neither C:E54 nor E54D5. 14. Create account,depositor,account ,borrower database and to implement triggers to handle o erdraft account#accGno ,brGname ,balance $J depositor#cusGname ,accGno $J loan#loanGno ,brGname ,amount$J borrower#cusGname ,loanGno $J &rite a trigger to handle o erdraft. 1C. Design a database application and implement it. 1:. &rite a pl'sql program to find the factorial of a gi en number 1D. Create in entory, minle el, reorder, order database and to implement triggers to handle in entory. in entory#item, le el1 $J reorder#item ,amount ,le el1 $J orders#item ,amount ,le el1 $J &rite a trigger to handle in entory control.

1E. &rite a *+',-+ block for inserting rows into ./*D.0 table with the following Calculations1 2RA3456 78 9A,!C,,DA3%56 78 9A,!C,*83:6 78 9A,!C,;.0*A<39A,!C=DA=2RA>*8 %5. &rite a pl' sql program to find the largest number among three numbers.

Internal Examiner

External Examiner

S-ar putea să vă placă și