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

Questions PL SQL

The document contains 50 questions related to PL/SQL programming, including questions about SQL vs PL/SQL, writing programs to perform tasks like swapping values, checking for palindromes, and displaying output in various formats. It also includes questions about writing procedures, functions, packages, and triggers to manipulate data in database tables.

Uploaded by

pandagangadhar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
240 views

Questions PL SQL

The document contains 50 questions related to PL/SQL programming, including questions about SQL vs PL/SQL, writing programs to perform tasks like swapping values, checking for palindromes, and displaying output in various formats. It also includes questions about writing procedures, functions, packages, and triggers to manipulate data in database tables.

Uploaded by

pandagangadhar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

1. What is PL/SQL, why is it used for? 2. List the differences between SQL and PL/SQL? 3.

Write a program to accept two values, swap them with and without using 3rd variable? Note : two programs to be written. Example: Input : a = 17 b = 28 Output : a = 28 b = 17 4. Write a program to accept a number and convert it into decimal format? Input : n = 18 output : 10010 5. Write a program to accept a binary number and convert it into decimal number? Input : n = 10010 Ouput : 18

6. Write a program to find sum of n natural numbers? Input : n = 10 output : Sum Of 10 Natural Numbers Is 55 7. Write a program to display Sum of individual digits of a given number? Input : n = 7162 Output : 16 8. Write a program to display Mathematical table of a given number? 9. Write a program to check whether a given number is Prime or not? 10. Write a program to check whether a given number is Palindrome or not? 11. Write a program to accept year and display all Sundays along with their Dates? 12. Write a program to display the given String in the following format? Input : str = ORACLE Output: O OR ORA ORAC ORACL ORACLE

13. Write a program to Check whether a given character is a alphabet or number or special character? 14. Write a program to Count Number of vowels , consonants and digits in a given String? 15. Write a program to check whether a given string is palindrome or not? 16. Write a program to count number of characters in a given string? 17. Write a program to display the given string in vertical format? Input : str=computer Output : C O M . . . R 18. Write a program to display Floyd's Triangle? Output : 1 23 456 7 8 9 10 19. Write a program to display Slides Triangle? Output: 1 01 101 0101 10101

20. Write a program to display the following format? Output: *

** *** **** ***** **** *** ** * 21. Write a program to display the following format? Output: 54321 4321 321 21 1 22. Write a program to display GOOD MORNING or GOOD AFTERNOON or GOOD NIGHT depending upon the current time? 23. Write a program to concatinate two strings? 24. Difference between %TYPE and %ROWTYPE? 25. Write a program to accept a year and display the employees belonging to that year? 26. Write a program to accept a mgr code and display the employees who are working under that mgr? 27. Write a program to accept a grade and display all those employees belonging to that grade? 28. Write a program to display all the information of the emp table? 29. Write a program to accept location and display the empno,ename,sal,hiredate and also display the total salary, average salary and number of employees? 30. Write a program to display the job and employees working under the job with their empno,ename and salary? Output: Job Is . Analyst Empno Ename Sal ------------

--------------Job Is . Clerk Empno Ename ----------------------

--------Sal -------------

31. Write a program to display the employees based on year wise? 32. Write a program to display the employees who dont earn any commission and categorize the employees based on deptno? Output: Department Number . 10 Empno Ename Salary ---------------------------------------------Department Number ..20 Empno Ename Salary ---------------------------------------------Department Number ..30 Empno Ename Salary ----------------------------------------------

Comm ------------------Comm ------------------Comm -------------------------------------------------------------------------

33. Write a program to display Factors of a given number? Input: n = 6 Output: 1*6 2*3 3*2 6*1 =6 =6 =6 =6

34. Write a procedure to create your own Output Statement? 35. Write a procedure to accept 2 numbers, display all odd numbers between those numbers? 36. Write a procedure to display empno,ename,sal based on given deptno. Raise the necessary exceptions at procedure. Call the procedure from other program?

37. Write a procedure to accept the string as argument and check whether a given string is palindrome or not? Call the procedure from other program? 38. Write a procedure to accept dname irrespective of case and print all the details of employees? 39. Write a procedure to accept the string as argument and reverse the string? 40. Write a procedure for swapping two numbers? (Using 3rd variable) 41. Write a function to accept empno and return experience of employee? 42. Write a function to accept a string as argument and check whether a given string is palindrome or not? 43. Write a function to accept deptno and return number of employees working under that deptno? 44. Write a function to accept a grade and return max, total, average salary and number of employees belonging to that grade. Find all these without using Group functions? 45. Create a package to store the following procedure for Multiplication table, check whether a given number is odd/even. Function for factorial and palindrome? 46. Write a trigger to halt the transaction of the employees SALESMAN & PRESIDENT? 47. Write a database trigger to display the message when the inserting hiredate is greater than system date? 48. Write a database trigger to give the appropriate message if the record exceed more than 100 rows on EMP Table? 49. Write a database trigger to halt the transactions of Emp table if the deptno does not exist in dept table? 50. Write a database trigger to store User name, type of transaction, date of transaction and time of transaction of emp table into the EMP_LOG table?

You might also like