Top SQL PLSQL Interview Questions :: ALLInterview.com http://www.allinterview.com Top SQL PLSQL Interview Questions en-us 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. 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 Differences between UNIQUE and DISTINCT in select statements http://www.allinterview.com/showanswers/60479.html UNIQUE and DISTINCT 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 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 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 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 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 Types of locks in database ? http://www.allinterview.com/showanswers/20593.html Exclusive locks, Share locks 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 How to retrieve Duplicate Rows only in a Table? Suppose if a Table N http://www.allinterview.com/showanswers/27874.html select * from education where rownum < ( select max(rownum) from education group by <column_name> ) 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. When we give SELECT * FROM EMP; How does oracle respond? http://www.allinterview.com/showanswers/36384.html The oracle engine will execute the command,and retrives all the data from the database and give it to the end user. can we update a view which is created from two tables http://www.allinterview.com/showanswers/16849.html we can not update a view which is created from two tables.But we can update a view which is created from one table.