-
SQL to retrieve the 5th record only
My Question is :
I have one table , from this table I have 1000 records. Particularly I need retrieve the 5th record only.
no need retrieve 1 to 4th only 5th record only I need retrieve by using SQL Query? -
Retreive data from 2 tables
I have 2 tables. Table A and Table B. I want to display all the rows from both the tables. can anyone help me on this??
-
Ascending Order and Descending Order Query
How to write a query to list the items in ascending order of Name and within Name, in descending order of Salary
-
Display Column as Rows
There is a table T with two columns C1 and C2.
The data is as below:
C1 C2
1 4
2 5
3 6
display the result as :
1 2 3
4 5 6 -
How to list employees names hired AFTER a certain date
I need to list the employees hired after any random date, lets say 10th December 2010 in ascending order and minus their salary by 100% how would I do this?
-
What is the use of DESC in SQL?
Answer :DESC has two purposes. It is used to describe a schema as well as to retrieve rows from table in descending order.Explanation : The query SELECT * FROM EMP ORDER BY ENAME DESC will display the output sorted on ENAME in descending order.
-
What is the output of the following query?
SELECT TRUNC(1234.5678,-2) FROM DUAL;1200
-
What operator performs pattern matching?
LIKE operator
-
What is the difference between TRUNCATE and DELETE commands?
TRUNCATE is a DDL command whereas DELETE is a DML command. Hence DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back. WHERE clause can be used with DELETE and not with TRUNCATE.
-
-
-
-
-
-
-
-
There are 2 tables, Employee and Department. There are few records in employee table, for which, the department is not assigned. The output of the query should contain all th employees names and their corresponding departments, if the department is assigned otherwise employee names and null value in the place department name. What is the query?
Select emp_name, Dept_name from (Employee_table left outer join Dept_table on Employee_table.Dept_id = Dept_table.Dept_id)
-
Count Records
I have following table as books101 BOOK_NO BOOK_NAME AUTHOR_NAME COST CATEGORY1234 C Dennis 450 System1235 Oracle Loni 550 Database1236 Sql Loni 250 Database1237 Pl/Sql Scott 750 Database Now I want to List all the authors and book name that has more then 1 book written by them.pls help
-
-
SQL Interview Questions
Ans