Interview Questions And Answers Pdf 4,3/5 864 reviews

Basic & Advanced SQL Interview Questions And Answers:

  1. Interview Questions And Answers Pdf Download
  2. Top Interview Questions 2019
  3. 50 Interview Questions And Answers
  4. Interview Questions And Answers Pdf Free Download

Interview – Sample Questions and Answers (April 2017) Tell me about yourself This is usually one of the first questions asked at interview because it is a good ice-breaker. You should always have a finely tuned response prepared in advance. Structure your answer around the job. Mar 04, 2018  hvac interview questions and answers pdf, hvac interview questions for freshers, hvac technician interview questions and answers pdf, common hvac interview questions, hvac technician interview questions and answers, hvac technical interview questions, hvac draftsman interview questions. Sample Interview Questions with Suggested Ways of Answering Q. Tell me about yourself. This is the dreaded, classic, open-ended interview question and likely to be among the first.

Congratulations! You got the interview! In this SQL Server Developer Interview Questions post, we have put together both basic and advanced SQL Interview Questions and Answers. This post contains Top SQL Interview Questions for Experienced as well as Freshers.

I have segregated this “SQL Server Interview Questions” post into two types.

1. Common SQL Interview Questions
2. Practical SQL Query Interview Questions (SQL Server Queries examples with answers).

I don’t want to take much time of yours but I couldn’t move further without mentioning about this inevitable job interview question which every hiring manager asks you in any interview i.e., Tell Me About Yourself. Answering these questions is very easy if you follow the link. It contains sample answers for both freshers and experienced. Now, Let’s move on to the actual post.

General SQL Interview Questions:

1. What is a Database?
A database is a collection of information in an organized form for faster and better access, storage and manipulation. It can also be defined as a collection of tables, schema, views, and other database objects.

2. What is Data warehouse?
Data warehouse refers to a central repository of data from multiple sources of information. Those data are consolidated, transformed and made available for the mining as well as online processing.

3. What is a Table in a Database?
A table is a database object used to store records in a field in the form of columns and rows that holds data.

4. What is a Field in a Database?
A field in a Database table is a space allocated to store a particular record within a table.

5. What is a Record in a Database?
A record (also called a row of data) is an ordered set of related data in a table.

6. What is a column in a Table?
A column is a vertical entity in a table that contains all information associated with a specific field in a table.

7. What is DBMS?
Database Management System is a collection of programs that enables a user to store, retrieve, update and delete information from a database.

8. What are the types of DBMS?
There are two types of DBMS
1. Relational Database Management System (RDBMS)
2. Non-Relational Database Management System

9. What is RDBMS?
RDBMS stands for Relational Database Management System. RDBMS is a database management system (DBMS) that is based on the relational model. Data from a relational database can be accessed using Structured Query Language (SQL)

10. What are the popular Database Management Systems in the IT Industry?
Oracle, MySQL, Microsoft SQL Server, PostgreSQL, Sybase, MongoDB, DB2, and Microsoft Access etc.,

11. What is SQL?
SQL Overview: SQL stands for Structured Query Language. It is an American National Standard Institute (ANSI) standard. It is a standard language for accessing and manipulating databases. Using SQL, some of the action we could do are to create databases, tables, stored procedures (SP’s), execute queries, retrieve, insert, update, delete data against a database.

12. What are the different types of SQL commands?
SQL commands are segregated into the following types:

  • DDL – Data Definition Language
  • DML – Data Manipulation Language
  • DQL – Data Query Language
  • DCL – Data Control Language
  • TCL – Transaction Control Language

13. What are the different DDL commands in SQL?
DDL commands are used to define or alter the structure of the database.

  • CREATE: To create databases and database objects
  • ALTER: To alter existing database objects
  • DROP: To drop databases and databases objects
  • TRUNCATE: To remove all records from a table but not its database structure
  • RENAME: To rename database objects

14. What are the different DML commands in SQL?
DML commands are used for managing data present in the database.

  • SELECT: To select specific data from a database
  • INSERT: To insert new records into a table
  • UPDATE: To update existing records
  • DELETE: To delete existing records from a table

15. What are the different DCL commands in SQL?
DCL commands are used to create roles, grant permission and control access to the database objects.

  • GRANT: To provide user access
  • DENY: To deny permissions to users
  • REVOKE: To remove user access

16. What are the different TCL commands in SQL?
TCL commands are used to manage the changes made by DML statements.

  • COMMIT: To write and store the changes to the database
  • ROLLBACK: To restore the database since the last commit

17. What is an Index?
An index is used to speed up the performance of queries. It makes faster retrieval of data from the table. The index can be created on one column or a group of columns.

18. What are all the different types of indexes?
There are three types of indexes
1. Unique Index: Unique Indexes helps maintain data integrity by ensuring that no two rows of data in a table have identical key values. A unique index can be applied automatically when a primary key is defined. It ensures that the values in the index key columns are unique.
2. Clustered Index: Clustered Index reorders the physical order of the table and search based on the key values. There will be only one clustered index per table.
3. Non-Clustered Index: Non-Clustered Index doesn’t alter the physical order of the table and maintains a logical order of the data. Each table can have many non-clustered indexes.

19. What is the difference between Cluster and Non-Cluster Index?
The difference between the clustered and non-clustered index in SQL is as follows:
Clustered Index:
It is used for easy retrieval of data from the database and it is faster.
One table can only have one clustered index
It alters the way records are stored in a database as it sorts out rows by the column which is set to be clustered index.
Non-Clustered Index:
It is slower compared to the Clustered index.
One table can have multiple non clustered index
It doesn’t alter the way it was sorted but it creates a separate object within a table which points back to the original table rows after searching.

20. What is a View?
A view is like a subset of a table which is stored logically in a database. A view is a virtual table. It contains rows and columns similar to a real table. The fields in the view are fields from one or more real tables. Views do not contain data of their own. They are used to restrict access to the database or to hide data complexity.

  • Atomicity
  • Consistency
  • Isolation
  • Durability

62. Define the SELECT INTO statement.
The SELECT INTO statement copies data from one table into a new table. The new table will be created with the column-names and types as defined in the old table. You can create new column names using the AS clause.

2
SELECT RIGHT(EmpName,5)ASEmployeeName FROM Employee
SELECT SUBSTRING(EmpName,1,5)ASEmployeeName FROM Employee

78. How to add new Employee details in an Employee_Details table with the following details
Employee_Name: John, Salary: 5500, Age: 29?

UPDATE Employee_Details set Salary=7500where Employee_Name=John;

81. Write an SQL Query to select all records from the table?

82. How To Get List of All Tables From A DataBase?
To view the tables available on a particular DataBase

2
4
GO
GO

83. Define SQL Delete statement.
The SQL Delete statement is used to delete records from a table.

SELECT *FROM Employee_Details WHERE Employee_Name like'E%';

Output:

2
sp_rename'TableName.OldColumnName','NewColumnName'

94. How to select all the even number records from a table?
To select all the even number records from a table:

2

95. How to select all the odd number records from a table?
To select all the odd number records from a table:

96. What is the SQL CASE statement?
SQL Case statement allows embedding an if-else like clause in the SELECT statement.

97. Can you display the result from the below table TestTable based on the criteria M,m as M and F, f as F and Null as N and g, k, I as U

50 Interview Questions And Answers

2
4
6
8
case
when Gender='g'then'U'
when Gender='NULL'then'N'
endasnewgender from TestTable GROUP BY Gender

98. What will be the result of the query below?

Top 25 interview questions
select casewhen null=nullthen'True'else'False'endasResult;

This query returns “False”. In the above question, we could see null = null is not the proper way to compare a null value. To compare a value with null, we use IS operator in SQL.

So the correct way is as follows

Interview Questions And Answers Pdf Free Download

select casewhen nullisnullthen'True'else'False'endasResult;

99. What will be the result of the query below?

select casewhen nullisnullthen'Queries In SQL Server'else'Queries In MySQL'endasResult;

This query will returns “Queries In SQL Server”.

100. How do you update F as M and M as F from the below table TestTable?

UPDATE TestTable SET Gender=CASEGender WHEN'F'THEN'M'ELSE'F'END

101. Describe SQL comments?
Single Line Comments: Single line comments start with two consecutive hyphens (–) and ended by the end of the line
Multi-Line Comments: Multi-line comments start with /* and end with */. Any text between /* and */ will be ignored.

102. What is the difference between NVL function, IFNULL function, and ISNULL function?
These three functions work in the same way. These functions are used to replace NULL value with another value. Oracle developers use NVL function, MySQL developers use IFNULL function and SQL Server developers use ISNULL function.
Assume, some of the values in a column are NULL.
If you run below statement, you will get result as NULL

Suppose any of the value in col3 is NULL then as I said your result will be NULL.

To overcome this we use NVL() function, IFNULL() function, ISNULL() Function. Call of duty play online no download.

ORACLE:

MySQL:

Also, you can use the COALESCE() function

Coments are closed
Scroll to top