Top SQL PLSQL Interview Questions :: ALLInterview.com http://www.allinterview.com Top SQL PLSQL Interview Questions en-us Differences between UNIQUE and DISTINCT in select statements http://www.allinterview.com/showanswers/60479.html UNIQUE and DISTINCT 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 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 an index and types of indexes. How many number of indexes can http://www.allinterview.com/showanswers/20658.html Index is a method used for faster retrieval of records.different types of indexes are 1.primary key index 2.unique index 3.bitmap index 4.hash index 5.function based index 6.B-tree index(default index created) on table. 7.Virtual index(which What is INSTEAD OF trigger ? http://www.allinterview.com/showanswers/20598.html Instead of trigger is used to update the database tables associated with the view instead of updating the view directly. Types of locks in database ? http://www.allinterview.com/showanswers/20593.html Exclusive locks, Share locks What is difference between CHAR and VARCHAR2?What is the maximum SIZ http://www.allinterview.com/showanswers/3347.html VARCHAR2(size):variable lenght character data maximum size is 4000 and minimum is 1 char2(size):fixed lenght character data of lenght size bytes minimum and default is 1 and maximum is 2000. Can a table have two primary keys? http://www.allinterview.com/showanswers/32655.html No,In the entire table,there will be only one primary key. A primary key is nothing but a collection of one or more coloumns used to identify a row in a table. What is the difference between RDBMS and DBMS? http://www.allinterview.com/showanswers/32487.html 1)DBMS permits only one person to access the database at a given time.But RDBMS gives the multiple access the database at a given time. 2)DBMS organised the data in any formmate but RDBMS allows only in row and column format. 3)In DBMS we can What is normalization and types of normalization? http://www.allinterview.com/showanswers/20409.html Normalization is process for reducing the redency of the data.there 5 normal forms mainly used in 3 forms 4th one boyesscoded normal form What is difference between TRUNCATE &amp; DELETE? http://www.allinterview.com/showanswers/3341.html TRuncate removes all the rows in a table in one go. Delete deoes it for each row Truncate does not make entries in a LOG file Delete makes entries for each row that gets deleted What is mutating table? http://www.allinterview.com/showanswers/2737.html A mutating table is a table that is currently being modified by an update, delete, or insert statement. For example, if your trigger contains a select statement or an update statement referencing the table it is triggering off of you will rec What is a join?Explain the different types of joins? http://www.allinterview.com/showanswers/3336.html Joins are the methods used to access related data from one or more tables. there are five types of join 1. Inner Join 2. Outer Join 3. Self Join 4. Mix Join 5. Exception Join how to retrieve the top 3 salaries of the table using rownum http://www.allinterview.com/showanswers/6831.html select salary_column from salary_table where rownum<4 order by salary_column desc