Professional Documents
Culture Documents
SQL
SQL
This the material for SQL profile. I am assuming this is sufficient material for
SQL preparation. All the interview questions can be covered from these questions.
1> What is DBMS? & What is RDBMS and difference between both.
2> What is the difference between SQL and MySQL or SQL Server?
3> What is the difference between SQL and PL/SQL?
4> What are various DDL, DML,DCL commands in SQL? Give brief description of their
purposes.
5> Is a NULL value same as zero or a blank space? If not then what is the
difference?
6> What is constraints in sql and how many constraints are in SQL
Not Null ?
Unique Key (prepare Unique key in details)
Primary Key(prepare Unique key in details)
Foreign Key(prepare Unique key in details)
Check Constraint(prepare Unique key in details)
Index(prepare Unique key in details)
Default(prepare Unique key in details)
7> What is difference between Delete , drop and truncate
8> What is difference between where and having clause
9> What is join and types of join with example?
10> What is Union and Union ALL, difference between both
11> What are the properties and different Types of Sub-Queries?
12> Which TCP/IP port does SQL Server run on? How can it be changed? Answer: 1433
13> What is index and types of index
14> What is ACID property in database?
15> What is the difference among NULL value, zero and blank space?
16> Which are the different case manipulation functions in SQL?
17> What is the usage of NVL function?
18> Which function is used to return remainder in a division operator in SQL?
19> What is the usage of DISTINCT keyword?
20> What is Normalization and type of normalizations?
21> What is SQL Injection?
22> What is denormalization?
23> What is a View?
24> What is a Cursor? And type of cursor
25> What are local and global variables and their differences?
26> . What is Datawarehouse?
27> What is OLTP and OLAP and difference between both?
28> What is star Schema and snowflake Schema and difference between
29> What is Union, minus and Interact commands?
30> What is an ALIAS command?
31> What are aggregate and scalar functions?
32> What is the command used to fetch first 5 characters of the string?
Answer: Select studentId from (Select rowno, studentId from student) where
mod(rowno,2)=0
35> How can you create an empty table from an existing table?
Answer: select MAX(Salary) from Employee WHERE Salary NOT IN (select MAX(Salary)
from Employ
Answer:SELECT GetDate();
39> Write an SQL Query to check whether date passed to Query is the date of given
format or not.
40> Write an SQL Query to print the name of the distinct employee whose DOB is
between 01/01/1960 to 31/12/1975
Answer:SELECT DISTINCT EmpName FROM Employees WHERE DOB BETWEEN �01/01/1960� AND
�31/12/1975�;
41> Write SQL Query to find duplicate rows in a database? and then write SQL query
to delete them?
Answer: SELECT * FROM emp a WHERE rowid = (SELECT MAX(rowid) FROM EMP b WHERE
a.empno=b.empno)
And To delete:
DELETE FROM emp a WHERE rowid != (SELECT MAX(rowid) FROM emp b WHERE
a.empno=b.empno);
Thanks,
Admin Team