A series of SQL Server basics to advanced level of Interview questions and answers which are commonly asked in interview.
SQL Server QUIZ
[ Also Read: SQL Server Basics Tutorial]
LeetCode – SQL Interview Questions
LeetCode – Rank Scores
HackerRank – SQL Interview Questions
HackerRank SQL Interview Question- Occupations
SQL Server Interview Questions and Answers
- Difference between Primary Key and Composite Key?
- SQL DDL, DML, DCL and TCL commands?
- Difference between Stored Procedure and Functions?
- Difference between Truncate and Delete statements in SQL Server?
- What is Views in SQL Server?
- How to get the definitions of stored procedures, user defined functions and triggers in SQL ?
- SQL CROSS APPLY vs OUTER APPLY, and how do they differ from Joins?
- How to check if user table or temp table exists or not in SQL Server database?
- How to display a cumulative Total/ Running Total in SQL?
- What is correlated subquery in SQL?
- Difference between NULL and BLANK in SQL Server?
- What is SQL Server user defined table type and table valued parameters?
- How to access the files name list from window directory folder to SQL Server table using T-SQL query?
- How to access a data of table from another database in SQL Server?
- How to implement a custom sorting in SQL Server?
- What is Sequence in SQL?
- What is foreign key in SQL server and how to add a foreign key in existing table?
- What is SQL drop table command, does it support rollback ?
- What is unique key constraint in SQL Server ?
- What is TRY..CATCH block and how to handle T- SQL code error using TRY.. CATCH block?
- How to Pivot a table in SQL?
- How to Unpivot a table data in SQL?
- What is triggers in SQL ?
- What is Merge Statement in SQL and use of Merge in SQL ?
- How to create Jobs in SQL Server ?
- What is SQL Server temporary tables?
- What is GROUPING SETS in SQL?
- What is CUBE in SQL ?
- What is IIF() Logical Function is SQL ?
- What is Choose() logical function in SQL?
- How to identify blocking processes/long running queries in SQL server ?
- What is SQL Server Computed Columns ?
- How to find out identity column without using column name ?
- How to configure SQL Server Database Mail ?
- How to troubleshoot SQL Server Database Mail?
- What is synonyms in SQL Server and its role ?
- How to insert explicit values into identity column ?
- How to send a SQL Server Query result in text format using database e-mail?
- What is NEWSEQUENTIALID() function in SQL Server, what is the difference between NEWSEQUENTIALID() and NEWID() ?
- How to get the sizes of all databases on a SQL Server ?
- How to display currency symbol for different different cultures in SQL Server?
- How to concatenate rows of strings into one string with a specified separator?
- How to find Nth highest salary in SQL Server ?
- How to display detailed truncation error in SQL Server ?
- How to Split Comma Separated string values into columns?
- How to Display calendar dates for any n numbers of years in SQL Server?
- Difference between VARCHAR VS NVARCHAR?
- Difference between CHAR VS NCHAR?
- What is the difference between SQL Server Stored Procedures and User Defined Functions (UDF)?
- FOR JSON clause in SQL Server?
- What is LogOn trigger in SQL Server?
- How to get all the tables in database those contains primary key constraints ?
- How to create a dynamic column in pivot ?
- Write SQL query to get the students who have scored higher than 80 marks and sort result based on last three characters of name and StudID in ascending order ?
- Print prime number separated by comma till n numbers in SQL?
- What is cascading referential integrity in SQL Server?
- How to get the last accessed time for tables in SQL Server?
- How to copy or delete files from directory in SQL Server?
- How to change the column collation to case sensitive?
- How to auto execute any stored procedure on SQL Server Services startup ?
- How to encrypt a stored procedure in SQL Server?
- How to Read SQL Server error logs?
- How to extract a Scalar value from JSON string?
- How to extract a Json object and Json array from JSON string?
- How to modify property and it’s value in JSON string?
- How to separate numbers, letters and special characters from string?
- What is SQL Ident_current function and how it differ from @@Identity and Scope_Identity?
- How to select top n records for each category from table?
- How to change the column name and their data type of result set of stored procedure?
- What is Table Value Constructor?
- How to generate a scripts for database with schema and data?
- How to script a table in SQL Server?
- How to check if column exists or not in SQL Server table?
- How to get row count for all tables in SQL Server ?
- Date and Time Conversions in SQL Server using Convert function.
- How to store the output of stored procedure into a table/temp table?
- How to insert a multi language/multilingual data in table?
- How to Update records from select statement in SQL?
- Difference between Clustered and Non-Clustered indexes in SQL Server ?
- How to fetch an alphanumeric from string?
- How to generate a range of numbers between two numbers in SQL Server?
- How to search for string within xml column in SQL table?
- How to find leading and trailing spaces in SQL Server ?
- How to compare column names in two tables in SQL Server ?
- How to Insert same row multiple times in a table in SQL Server?
- How to get the size of all tables in SQL Server?
- How to get top Nth highest salary in each department?
- How to calculate rolling average?
- How to get multiple row data in single row in SQL?
- How to reset identity column value in table?
- Display employees and their reporting manager name in SQL?
- Difference between UNION and UNION ALL?
- Find a managers with at least 3 direct reports.
- Find a largest single number in a table.
- Find department top 3 salaries.
[Also Read.. SSRS Tutorial, SQL Server Advance Tutorial, Power BI Tutorial ]