SQL Interview Questions: Ans: 8060 Bytes Allowed Per A Single Row in A Table
A stored procedure is a group of SQL statements that perform a particular task. Stored procedures are used to encapsulate operations on a database like employee actions. Views are virtual tables derived from one or more base tables. A primary key uniquely identifies each row in a table while a unique key uniquely identifies rows but multiple null values are allowed. Joins combine rows from two or more tables based on a related column between them.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
79 views
SQL Interview Questions: Ans: 8060 Bytes Allowed Per A Single Row in A Table
A stored procedure is a group of SQL statements that perform a particular task. Stored procedures are used to encapsulate operations on a database like employee actions. Views are virtual tables derived from one or more base tables. A primary key uniquely identifies each row in a table while a unique key uniquely identifies rows but multiple null values are allowed. Joins combine rows from two or more tables based on a related column between them.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
Sql Interview Questions
1. what is the maximum size of sql row in mssql?
Ans: 8060 bytes allowed per a single row in a table
2. What is Stored Procedure?
Ans: A stored procedure is a group of SQL statements that form a logical unit and perform a particular task. Stored procedures are used to encapsulate a set of operations or queries to execute on a database server. For example operations on an employee database (hire fire promote lookup) could be coded as stored procedures executed by application code. Stored procedures can be compiled and executed with different parameters and results and they may have any combination of input output and input/output parameters. 3. What is Views in sql server? Ans: A view is a virtual table that consists of columns from one or more tables. Though it is similar to a table, it is stored in the database. It is a query stored as an object. Hence, a view is an object that derives its data from one or more tables. These tables are referred to as base or underlying tables. 4. Difference between a User Defined Function and a Stored Procedure? Ans: 1) stored procedure may use return statement, while user defined function should use return statement. 2) If any error acquire ignore the error and move to next line, while function stop execution. 3) Stored procedure is a compiled one but function compiles every time it will call.
5. Difference between a primary key and a unique key?
Ans: 6. What is a join and explain different types of joins? Ans: 7. Difference between temp table and table variable? Ans: 8. Difference between Triggers and Stored Procedures? Ans: 9. Difference between UNION ALL Statement and UNION? Ans: 10. What is COALESCE / Why do we use COALESCE? Ans: 11. Why we use SET ROWCOUNT in Sql? 12. How many clustered index can have a table? 13. How many types of local tables in SQL SERVER? 14. Difference between DELETE and TRUNCATE? 15. What is Aggregate Functions? 16. What is Row_Number()? 17. What are Ranking Functions? 18. What is NOLOCK? 19. What is CTE? 20. What are the Advantages of using CTE? 21. What is the STUFF function and how does it differ from the REPLACE function? 22. What are the difference between clustered and a non-clustered index? 23. What are the different index configurations a table can have? 24. Difference between a HAVING CLAUSE and a WHERE CLAUSE? 25. Difference between SET and SELECT? 26. Provide all the built in string function of SQL SERVER? 27. Difference between char and varchar data types? 28. Define candidate key, alternate key, composite key? 29. What are constraints? 30. Explain different types of constraints? (Refer-www. w3school.com) 31. What is a self join? Explain it with an example? 32. How will you convert table row to a column comma separated value? 33. How to restart SQL Server in single user mode? 34. How to start SQL Server in minimal configuration mode? 35. What are the steps you will take to improve performance of a poor performing query? 36. How to fetch all the duplicate records from the table? 37. How to fetch the second highest salary from the table.? 38. What is normalization? 39. Explain different levels of normalization? 40. What is denormalization and when would you go for it? 41. How do you implement one-to-one, one-to-many and many-to-many relationships while designing tables? 42. What are user’s defined datatypes and when you should go for them? 43. What is bit datatype and what's the information that can be stored inside a bit column? 44. What is a transaction and what are ACID properties? 45. Explain different isolation levels 46. What is lock escalation? 47. Explain the storage models of OLAP 48. What is RAID and what are different types of RAID configurations? 49. What is a deadlock and what is a live lock? How will you go about resolving deadlocks? 50. What is blocking and how would you troubleshoot it? 51. As a part of your job, what are the DBCC commands that you commonly use for database maintenance? 52. What are the different ways of moving data/databases between servers and databases in SQL Server? 53. Explian different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan? 54. What is database replicaion? 55. What are the different types of replication you can set up in SQL Server? 56. How to determine the service pack currently installed on SQL Server? 57. What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?