Bru Medishetty's SeekWell Blogs
SQL Server DEV QandA
This page contains SQL Server Developer Interview Questions. Since it is just the beginning days of this section. I would be having many more in the coming days, suggest you to bookmark it, I’m sure you will have plenty of Interview questions that are useful for your Interview preparation.
Can you write a SELECT statement without FROM Clause?
- Yes you can write a SELECT statement without having a FROM Clause.
Examples.
SELECT @@VERSION
OR
SELECT ‘HELLO WORLD’
What are the different contraints in SQL Server?
- Primary Key Constraint.
- Foreign Key Constraint.
- Unique Key Constraint.
- Default Constraint.
- Check Constraint.
How do you display only few # of rows from any table?
- You can use TOP Clause to return only the # of rows from an underlying table.
What are the enhancements in SQL Server 2005 over SQL Server 2000 from a developer’s stand point?
- The below is a list of enhancements in SQL Server 2005 from a developer’s point of view.
- Common Table Expressions (CTE)
- Covering Indexes
- EXCEPT and INTERSECT
- PIVOT and UNPIVOT
How will you rename a database or a database Object using T-SQL?
- Using SP_Rename system stored procedure you can rename a database object such as a table, view, stored procedure etc. Using SP_RenameDB you can rename a database. For more information read one of my blogs on this topic — Renaming database and database objects using T-SQL
What is the benefit of WHERE Clause?
- WHERE clause helps in filtering the rows that are affected by the query by using one or more conditions. Look at the following blog for examples to learn about Where caluse. http://learnsqlwithbru.com/2010/06/25/using-where-clause-in-sql-server-query/
How can you display the top n no. of records in a table based on a column?
- It is possible to return such a result-set by using Top n clause along with Order By the column name.
How many Clustered and Non-Clustered Indexes can be created on a sinlge table?
- A table can contain a single Clustered Index at any time, where as the limit for Non-Clustered Indexes is 249. SQL Server 2008 supports upto 999 Non-Clustered Indexes.
How many columns can be created in a single table?
- A normal table, can contain 1024 columns and wide table can contain 30,000 columns per table.