Vous êtes sur la page 1sur 4

1)Create a query that displays employee name and indicate amount of their salaries

through asterisk.Each astrick indicate a 500 rupees.Sort the data in descending


order of salary.Label the column employee and salary.

2)Create a query that display the total number of employees and of that total the
total who were hired in1980 1981 1982 1983.Give appropriate column headings.

3)Display the date of the next Friday i.e 6 months from the hire date. The resulting
data should appear as Friday march 12 1982.Order the results by hire date.

4)For each employee display the employee name and calculate the number of
months b/w today and the date employee was hired.Label the column months
worked.Order your resultsby the number of months employed.Round theno.of no.of
upto the closest whole no.

5)In which year did most people join in the company.Display the year and no.of
employees.

6)Write e query to display a star(*) against the row of the most recently hired
employee.Display name hire date,and column showing a star.

7)Create a querry to sdisplay the name , hire date and salary for all employeeswho
have same salary and common as scot.

8)Write a SQLquery to display employee, name,salary for allemployees who earn


more than the avg salary and who work in a dept with any employee with a capital
“T” in their name.

9)Display the name,dname and salary of employee whose salary and column
matches the salary and commof any employee located in Dallas.

10)Write a SQL query to delete duplicate rows from a table.

11)Display the nth record from an employee table.

12)Write a SQL statement to display alternate rows.

13)Show all the employees who were hired on the day of the week on which the
highest no.of employees were joined.

14)Show all employees who have managers with a salary>2,500. Show the
following data ename,mgr name , manager salary and salary grade of the manager.

15)Show the names of all employees together with the no.of years and the no.of
months that they have been completed.

16)Write a SQL statement to display the following format *


*
*

* *
*

17)Display last 4 lines from employee table.

18)Create a view called salary _vu basedon the employee name , dept name
,salary& salary grade for all employees.Label the column employee, department
salary and grade respectively.

19)Write a SQL statement to display the following pattern *

* *
* *
* * *
* *

20)Write a query that will return the day of the week for any date entered in format
dd,mm,yyy.

PL/SQL

1)Write a PQ/SQL procedure “Fibno” to print nth Fibonacci number, where n is any
integer passed as parameter to it.

2)Write a function “revstr” which will return the reverse of a given string.

3)Create a PL/SQL block which will accept a string and check whether it is
palindrome or not.

4)Write a procedure called stepnum that takes an integer n as its IN parameter and
prints a number series (upto n) as 1

2 2

3 3 3

------------

n n n n

5)Create a PL/SQL block which calls a procedure’proc1’ and a function ‘f1’.The


procedure proc1 should take two numbers as IN parameters and returns the sum in
an OUT parameter.

6)Create a PL/SQL block which converts an input number to words.


7)Create a PL/SQL block which prints all the Armstrong numbers between 100 and
500.

//////8) Create a PL/SQL block which caluculate the total salary of each department
using cursors.

9) Create a PL/SQL block which takes a number as input and prints the individual
digits in words.

10) Create a PL/SQL block with which accepts three numbers and displays the
biggest number among them.

11) Create a PL/SQL block which inserts the greetings ‘good morning’ or ‘good
afternoon’ or ‘good night’ into a table called dummy table depending upon the
current time.

12) Create a PL/SQL block which accepts a number as input and inserts the

a.sum of the digits

b.reverse number and

c.the number in words into a table called dt.

13) Create a PL/SQL block to display the number 1 to 100 in several words

a.display 100 to 1 numbers

b.display 1 to 100 numbers

c. display 1 to 100 numbers expect multiplies of 7.

14) display 1 to 100 numbers Create a PL/SQL block which accepts an year as
input and display if it is a leap year or not .

15) Create a PL/SQL block whh accepts the student name, admission number and
his marks (four subjects), and display the total marks,average marks and grade.

16 Create a PL/SQL block which accepts a string and prints the reverse string.

17) Create a PL/SQL block which accepts a string and displays the output in the
following format

String:GRIET

G R

G R I
G R I E

G R I E T

18) Create a PL/SQL block which accepts four numbers and displays the biggest
number among four numbers without using logical operations like AND,OR,NOT.

19) Create a PL/SQL block which accepts a string and displays the count of vowels ,
words and length of the string.

20) Create a PL/SQL block ename, empno, salary and caluculate the DA,HRA, TA,
GROSS, PF, PT, IT ,DED, NET.

http://127.0.0.1:8080/apex/f?p=4500:1003:3989945792841800::NO:::

Vous aimerez peut-être aussi