0% found this document useful (0 votes)
10 views2 pages

T-SQL Questions - Clean

The document contains a series of questions and answers related to SQL Server concepts, including primary keys, JOINs, and various T-SQL functions and clauses. It covers topics such as the DISTINCT keyword, TOP clause, and the differences between DELETE and TRUNCATE statements. Additionally, it addresses indexing types, table hints, and the use of subqueries and Common Table Expressions (CTEs).

Uploaded by

Vishal Maheshuni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

T-SQL Questions - Clean

The document contains a series of questions and answers related to SQL Server concepts, including primary keys, JOINs, and various T-SQL functions and clauses. It covers topics such as the DISTINCT keyword, TOP clause, and the differences between DELETE and TRUNCATE statements. Additionally, it addresses indexing types, table hints, and the use of subqueries and Common Table Expressions (CTEs).

Uploaded by

Vishal Maheshuni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1. What is a primary key in SQL Server?

2. What is a JOIN in SQL Server? Provide examples of joins.

3. What is the purpose of the DISTINCT keyword in T-SQL? Provide an example.

4. How do you use the TOP clause in T-SQL? Provide an example.

5. What is the purpose of the LIKE operator in T-SQL? Provide an example.

6. How do you use the UNION operator in T-SQL? Provide an example.

7. What is the difference between the UNION and UNION ALL operators in T-SQL?

8. What is a subquery in T-SQL and how is it used? Provide an example.

9. What is the difference between a DELETE statement and a TRUNCATE statement in SQL Server?

10. How do you sort the result set of a query in T-SQL?

11. What is the purpose of the GROUP BY clause in T-SQL?

12. What is the difference between the WHERE and HAVING clauses in T-SQL?

13. How does the CASE statement work in T-SQL? Provide an example.

14. What is the ROW_NUMBER() function in T-SQL and how is it used?

15. What is a Common Table Expression (CTE) in T-SQL and how do you create one?
16. What is the purpose of the ISNULL() function in T-SQL? How is it different from COALESCE()?

17. What is the purpose of the LEAD() and LAG() functions in T-SQL? Provide examples.
18. What is the difference between a clustered index and a non-clustered index?
19. What is a columnstore index in SQL Server, and how does it differ from a traditional rowstore index?
20. What is the purpose of the NOLOCK table hint, and when would you use it? Provide an example.

You might also like