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 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 How do we get month name in SQL Server 2000, Oracle, MS Access? http://www.allinterview.com/showanswers/28427.html select datename(mm,getdate()) Define candidate key, alternate key, composite key? http://www.allinterview.com/showanswers/11457.html A composite Key can be either Primay or Unique Key More then One Key columns are said to be composite keys Candidate Key(Primary Key) is a Key which Maintains the Row Uniue .Can be defined based on the Entity Alternate Key or Unique Key is what is the difference between DBMS and RDBMS?? http://www.allinterview.com/showanswers/56803.html In DBMS Normalization process wille not be present and in RDBMS normalization process will be present to check the database table cosistency Muralidhran dharanmu@yahoo.com 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. Differences between UNIQUE and DISTINCT in select statements http://www.allinterview.com/showanswers/60479.html UNIQUE and DISTINCT 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 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 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 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 Difference between primary key and unique key ? http://www.allinterview.com/showanswers/20536.html The column holding the primary key constraint cannot accept null values.whereas colum holding the unique constraint can accept null values assume that t3 is a table with two columns t1 having primary key constraint and t2 having unique constr 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), 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)