SQL INTERVIEW QUESTION-PART 1

Welcome to your SQL INTERVIEW QUESTION-PART 1

1. What are pseudo columns?
2. What does INSTR() and SUBSTRQ return?
3. Identify the various kinds of joins?
4. What types of Date Datatypes exist?

 

  • DATE
  • TIMESTAMP
  • TIMESTAMP WITH TIME ZONE
TIMESTAMP WITH LOCAL TIME ZONE
5. What is the usage of LPAD () and RPAD() functions?
6. What is the difference between IN and = operator?
  • = operator accepts only 1 value
IN Operator can accept more than 1 value.
7. What is differences between single row function and multi row function?
8. What are Conversion functions?

 

Conversion functions are useful to typecast data from one datatype to other.

SELECT first_name,

TO_CHAR (hiredate, ’MONTH DD, YYYY') HIRE_DATE,

TO_CHAR (salary, '$99999.99') Salary FROM employees

SELECT TO_NUMBER('1210.73', '9999.99') FROM DUAL;

SELECT TO DATE('January 15, 2016', 'Month dd, YYYY') FROM DUAL;

9. What is the difference between DATE and TIMESTAMP datatype?
10. Difference between HAVING and WHERE clause?
11. What is the difference between CHAR and NCHAR datatype?

NCHAR is used to store fixed length Unicode data. It is often used to store data in different languages.

CHAR is used to store fixed-length character data.

When data is stored using CHAR, it takes n bytes while NCHAR takes 2n bytes.

12. What is a DUAL table and why do we need it in DB?
13. What is difference between Delete and Truncate and Which is faster?
14. What is difference between EXIST and IN when using in sub queries?

Author: CloudVikas