Top SQL Server interview questions and answers for freshers, 2-5 year experienced programmers and database administrators with examples.
RDBMS is database management system which is used to maintain the data records in the tables and also indices in tables. Relationships can be created to maintain the data in the table.
- Column value of any kind.
- Insignificant sequence of columns.
- Insignificant sequence of rows.
- Unique name for each column.
- Atomic values.
“Where” clause is used to filter the rows based on condition. “Having” clause used with SELECT clause and this is used with GROUP BY clause. If GROUP BY clause not used then “HAVING” clause works like a “WHERE” clause.
6) Explain primary key in Sql Server?
This is the combination of fields/columns which are used to uniquely specify a row. Primary Key has a unique constraint defined on the column and the value in the column cannot be NULL.
7) Explain unique key in Sql Server?
Unique Key constraint will enforce the uniqueness of values in the list of columns of the table. No duplicate values are allowed. Unique key will allow NULL in one row unlike Primary Key.
8) Explain foreign key in Sql Server?
Foreign key is used to establish a relationship between the columns of other table. Foreign key relationship to be created between two tables by referencing a column of the table to primary key of another table.
9) What is the use of “JOIN” in Sql Server?
“JOIN” is used to get the data from multiple tables by joining those. Keys created in the tables will play a major role in the “JOIN”.
10) Explain the types of JOINS in Sql Server?
Below are the list of JOINS in Sql Server –
- Inner Join
- Right Join
- Left Join
- Full Join
11) In which TCP/IP port does Sql Server run?
By default it runs on port – 1433 and it can be changed from “Network Utility TCP/IP” properties.