Top Databases Interview Questions :: ALLInterview.com http://www.allinterview.com Top Databases Interview Questions en-us What are the all different types of Joins in SQL Server 2000, Anybod http://www.allinterview.com/showanswers/36608.html Different Types Of JOINS: Most of the joins you will come across are based on equality, with the equijoin being the most dominant. In this chapter you learned about equijoins; there are other types of joins you must become familiar wi what is the difference between primary key &amp; foreign key? http://www.allinterview.com/showanswers/35345.html Primary keys enforce entity integrity by uniquely identifying entity instances. Foreign keys enforce referential integrity by completing an association between two entities. What is the difference between join and union. http://www.allinterview.com/showanswers/13863.html we can join two tables by 'join' if they have common field.we can union two tables irrespective of common field. How do we get month name in SQL Server 2000, Oracle, MS Access? http://www.allinterview.com/showanswers/28427.html select datename(mm,getdate()) Write a query to get 2nd maximum salary in an employee table ? http://www.allinterview.com/showanswers/20600.html select empno,ename,sal from (select ename,empno,sal,dense_rank() over(order by sal desc)topn from emp) where topn=2 What is the difference between SQL, DDL, and DML? http://www.allinterview.com/showanswers/404.html Structured Query Language (SQL) is a language that provides an interface to relational database systems. In common usage SQL also encompasses DML (Data Manipulation Language), for INSERTs, UPDATEs, DELETEs and DDL (Data Definition Language), what is primary key,unique key, foreign key? can u teach me in simple http://www.allinterview.com/showanswers/15625.html Primary key - Primary key means main key def:- A primary key is one which uniquely identifies a row of a table. this key does not allow null values and also does not allow duplicate values. for ex, empno empname salary 1 f What are the differences between stored procedure and functions in SQ http://www.allinterview.com/showanswers/28431.html The Text property exposes the Transact-SQL or other script that defines the referenced Microsoft? SQL Server? 2000 database object. The FunctionName property specifies the function name to call in the Microsoft? ActiveX? script associated wi How do we get current date in SQL Server 2000, Oracle, MS Access? http://www.allinterview.com/showanswers/28430.html SELECT GETDATE() AS 'Current Date' GO write the query for find the top 2 highest salary in sql server http://www.allinterview.com/showanswers/57036.html select Distinct Top 2 Salary from EMP order by Salary desc Write a query to delete duplicate records in SQL SERVER http://www.allinterview.com/showanswers/61820.html DELETE FROM A WHERE (id NOT IN (SELECT MAX(ID) FROM A GROUP BY name)) suppose i have table called A. A has two coloumn id (identity) as int and what is the difference between TRUNCATE and DELETE command in SQL http://www.allinterview.com/showanswers/3737.html Truncate command cannot be rolled back while Delete can be how to find the second highest salary from emp table? http://www.allinterview.com/showanswers/61202.html Please put the below query, u will get the second highest salary of the table :--- select sal from(select sal from (select distinct sal from emp order by sal desc) where rownum<=2 order by sal asc) where rownum=1 Define candidate key, alternate key, composite key. http://www.allinterview.com/showanswers/23527.html A candidate key is one that can identify each row of a table uniquely. Generally a candidate key becomes the primary key of the table. If the table has more than one candidate key, one of them will become the primary key, and the rest are cal how to find nth highest salary http://www.allinterview.com/showanswers/19459.html DECLARE @SQL VARCHAR(2000), @N INT SET @N = 5 SET @N = @N - 1 SET @sql = 'select top 1 salary from ABC where salary not in ( SELECT TOP ' + CAST(@n AS VARCHAR(100)) + ' salary FROM ABC ) ' SELECT @SQL EXEC (@SQL)