0% found this document useful (0 votes)
9 views6 pages

Interview Questions

Hdhf

Uploaded by

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

Interview Questions

Hdhf

Uploaded by

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

Interview Questions.

1. What is DDL? Commands of DDL.

2. Features/Characters of DDL.

3. Syntax of all the commands: a) Alter b) Rename c)Drop d)Truncate

4. How to add / delete a Column from the table.

5.What is DML? Commands of DML.

6.Difference between DDL and DML.

7. Difference between Char and Varchar2.

8. Features/Characters of DML.

9. Syntax of all the commands: a) Select b)Insert c)Update d)Delete

10. How to insert the values in the table.

11. Difference between Truncate and Delete.

12. Difference between Drop and Truncate.

13. What are Features/Characters of the SQL.

14. Can we update 2 columns at a time.

15. What is the order of SQL query and briefly explain all the clauses/ commands.

16. How to retrieve the data from Table.

17. Difference between ‘where’ and ‘having’ clause.

18. How to retrieve the unique records.

19. Select ename, job from emp order by 3. What would be the output?

20. Can we ‘group by’ more than one column.


21. Can we ‘order by’ more than one column.

22. What is the order of execution / compilation of the query?

23. What is an aggregate function? Name the functions.

24. What is the difference between count (*) and count(CN).

25. Difference between Null and Not null.

26. Difference between Null and Blank.

27. Is Null comparable or not.

28. Write a query to calculate number of employees,total salary,highest salary,lowest


salary and avg salary from emp table.

29. Write a query department wise, the number of employees,total salary,highest


salary,lowest salary and avg salary from emp table.

30. Select count (1) from Table_name. What would be the output?

31. Write a query while retrieving data, add one more column containing null.

32. Write a query designation wise, number of employees,total salary and avg salary
from emp table and retrieve only total salary more than 4000 and arrange the data of
number of employees in descending order.

33. SOURCE TARGET


1. 20 20
2. NULL 20
3. 20 20

34. SOURCE TARGET


1. 20 100
2. NULL 200
3. 20 100

35. What would be the output for a) Select nullif (20,20) from dual;
b) Select nullif (20,10) from dual;
36. SOURCE TARGET

1. india ***india
2. India ***india***
3. abcd ABCD
4. abcd AbcD
5. ABCD abcd
6. ABCD ABCD

37. How to find the number of characters in a given string.

38. Define Replace and write syntax for Replace.

39. SOURCE TARGET

1. ABCDABCD BCDBCD
2. ABCD ABCD
3. ***india india
4. india i
5. pakistan p
6. i india
7. p pakistan

40. In replace syntax, if we don't pass the replacement value,what would be the output?

41. Write a SQL query to find the count of repeated characters in your name.

42. What are the string functions? Define and write syntax for Substring and Instring.

43. In substring syntax, if we don't pass the length value, what would be the output?

44. How to find the position of a character in a string?

45. Display the last character in a given name or string.

46. Display the last 3 characters in a given string.

47. Display the last 5 characters in a given string.


48. Display the first character of a given string.

49. Display the first 3 characters of a given string.

50. Write a SQL query to display a) user name from an email_id.


b) domain name from an email.id
c) service provider name from an email id

51. Display the first name from your full name.

52. Display the middle name from your full name.

53. Display the last name from your full name.

54. Display the current date.

55. Display tomorrow and next week's date.

56. Display yesterday and last week’s date.

57. Write a SQL query to display your age in years.

58.Write a SQL query, to attach experience in years column to emp table.

59. How to round off the decimal numbers in a column.

60. Write a SQL query to display the employee details having more than 40 years of
experience in the emp table.

61. Write a SQL query to display the employee details of those who are getting salary
more than average salary.

62. Display the employee name, salary, commission and total salary in emp table.

63. Display the last date of the month.

64. What are the conversion functions?

65. Difference between to_char and to_date.


66. Write a SQL query for employees who joined in the year of 1981 in the emp table.

67. What are the set operators? It’s types.

68. Difference between Union and Union all.

69. In Set operators results are joined vertically or horizontally.

70. How to create a backup table?

71. How to create only structure of the table?

72. How to copy data into another table.

73. Define Decode function and on which logic it works.

74. What is the syntax for Decode?

75. If we don't mention the ‘else’ part in Decode, what would be the output?

You might also like