Thursday, May 6, 2021

SQL Server Interview Questions With Answer (Complete List)

 SQL Server Interview Questions With Answer (Complete List)


1. What is the difference between “Stored Procedure” and “Function”?
2. What is difference between “Clustered Index” and “Non Clustered Index”?
3. What is the difference between the “DELETE” and “TRUNCATE” commands?
4. What is the difference between the “WHERE” clause and the “HAVING” clause?
5. What is the difference between “Primary Key” and “Unique Key”?
6. What is the difference between a “Local Temporary Table” and “Global Temporary Table”?
7. What is the difference between primary key and unique constraints?
8. What are super, primary, candidate and foreign keys?
9. What is SQL?
10. What is database normalization?
11. How do you implement one-to-one, one-to-many and many-to-many relationships while designing tables?
12. What are the differences between DDL, DML and DCL in SQL?
13. What is Identity?
14. What is a view in SQL Server ? How to create one.
15. What are the benefit or uses of view?
16. What are the different type of SQL or different commands in SQL?
17. what is a field in a database ?
18. What is a Record in a database ?
19. What is a Table in a database ?
20. What is a database transaction?
21. What are properties of a transaction?
22. What is a Database Lock ?
23. What are the different type of normalization?
24. What is a primary key?
25. What is a Composite Key ?
26. What is a Composite Primary Key ?
27. What is a Foreign Key ?
28. What is a Unique Key ?
29. Define candidate key, alternate key, composite key.
30. Define Join and explain different type of joins?
31. What is a materialized view?
32. What are the advantages and disadvantages of views in a database?
33. What is a stored procedure and its advantage?
34. What is Union, minus and Interact commands?
35. What are defaults? Is there a column to which a default can’t be bound?
36. What is a deadlock and what is a live lock? How will you go about resolving deadlocks?
37. What is blocking and how would you troubleshoot it?
38. What are the steps you will take to improve performance of a poor performing query?
39. Explain CREATE DATABASE syntax
40. How to restart SQL Server in single user mode? How to start SQL Server in minimal configuration mode?
41. What are statistics, under what circumstances they go out of date, how do you update them?
42. What are the different ways of moving data/databases between servers and databases in SQL Server?
43. What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?
44. What is User Defined Functions? What kind of User-Defined Functions can be created?
45. What is sub-query? Explain properties of sub-query?
46. What is the STUFF function and how does it differ from the REPLACE function?
47. What are the basic functions for master, msdb, model, tempdb and resource databases?
48. Can a stored procedure call itself or recursive stored procedure? How much level SP nesting is possible?
49. What is CTE? What are the Advantages of using CTE?
50. How would you handle error in SQL SERVER ?
51. What do you mean by Table Sample?
52. MOST FREQUENTLY ASKED SQL QUERY

About SQL Planner Software

 

SQL DBA Work Made Easy !

Perform SQL Health Analysis, Backup, De-fragmentation on Tablet / Mobile/ PC

Highly Secured

SQL Planner has 2 levels of security (a) your own SQL server security and (b) Application level security - which saves all credential in encrypted format. Exposing this application over internet / intranet or just at local machine configuration is totally in your hand and configurable.

Accessibility

Access SQL Planner application from any device, anywhere and manage your SQL server (Automation of SQL Health Analysis, Monitoring, Alerts, Backup and validation, Index de-fragmentation, Stats maintenance, Automation) with ease.

Huge saving in Time & cost

SQL Planner, with bundle of features, means you don’t need to login to all SQL server on internet / intranet / VM, there by saving lots of time and effort , and has 80% lowe price when compared to other tools .

Who this Application is for

Individual Service providers / SQL server Hosting Sites / SQL server DBA / SQL server Developers / Organization using several instance of SQL server / SQL Server Express Edition Users.

SQL planner under 1 umbrella offer multiple solutions to
- Monitor , Analyze SQL server Health & find root-cause, receive alerts.
- Backup with Auto-Restore to Test Server and validate with DBCC Check DB in Test server ,Post which sends you outcome in report.
- Index De-fragmentation and automation
- Database Scripting objects or tables level and automation
SQL Planner can be operated from any device and anywhere and lets you work with ease.

'' When you use SQL Planner,your client would often say, your DBA is smart, intelligent and proactive from Day 1, SQL Planner saves years of time to those who spends in writing manual scripts for monitoring and health analysis task automation , testing it and involves in recursive SDLC lifecycle. SQL planner gets you ready in few minutes.''

How SQL Planner is different

  • It is browser base and gives flexibility to work even if users are traveling or walking.
  • Monitoring and 50+ health analytical reports – Live and Historical data.
  • Backup feature – has flexibility to auto restore on test server and validate backup file.
  • Backup is even available at selective tables / objects level in the script mode with compression.
  • Supports all SQL edition (including Express) – Task automation feature is independent of SQL Agent.
  • Low Cost – price is 80% low compare to other tools and Certified as 100% Clean from Softpedia lab.
  • Free to use up-to 5 monitoring instance or jobs – dedicated to express edition users.

How SQL Planner Works

SQL Planner can be installed on your local machine having Microsoft windows Operating system, and provide SQL server credential (ensure it has Server view state permission or higher privilege, preferably Sysadmin) which has to be monitored or analyzed for health. SQL Planner starts collecting performance and server usage data very efficiently, ensuring your SQL runs smoothly, it also alerts you by email on several critical factor when encountered such as continuous high CPU, RAM, DISK usage, Database or drive space usage etc. SQL Planner instance can be used from browser (Firefox Mozilla preferred) by accessing link http://localhost/SQLPlanner , same can be accessed by anyone in your network without installing in another machine, or through Mobile device.

SQL Server version and edition supported
SQL Server 2008 R2, 2012, 2014, 2017, 2019, all editions including express.