-
-
What is table space?
I want to know the answer
-
How to display duplicate rows in a table?
Select * from emp where deptno=any(select deptno from emp having count(deptno)>1 group by deptno);
-
What is Dual table?
What is dual table which is used as a table in sql...
-
HAVING Clause
Given a SELECT statement that has a GROUP BY clause.The HAVING clause uses the same syntax as which other clause?A. WHEREB. UNIONC. SUBQUERYD. ORDER BY
-
How to retrieve the 2nd record from a table ?
How to retrieve the 2nd record from a table which has say 1000 records in it. Please answer this without using the row-id? I tried to say a query "select * from table where rowcount=1" which worked well and also "select * from table where rowcount=3" which gave me the result but not when I did the same query "select * from table where rowcount=2" ? why?
-
-
How to change the column name by using ALTER?
I Tried by giving......................... ALTER table table name rename column tocolumn name was changed but it's not giving entire table with altered column name.It's giving only the altered column.
-
-
Difference between joins and subquery?
Why do we use joins, instead subquery has same operation?
-
Display the employee details who joined before 5 days.
Write a query to display the employee details who joined before 5 days.
-
Query to Get Highest Marks Output
Question: student marks stable "sp_report"
sid maths chem phy engl
1 33 45 54 48
2 55 32 50 37
3 10 20 30 40
The required o/p is (SQL QUERY TO GET THE BELOW O/P)
sid highest_marks
1 54
2 55
3 40
-
What command is used to create a table by copying the structure of another table?
Answer :CREATE TABLE .. AS SELECT commandExplanation : To copy only the structure, the WHERE clause of the SELECT command should contain a FALSE statement as in the following.CREATE TABLE NEWTABLE AS SELECT * FROM EXISTINGTABLE WHERE 1=2;If the WHERE condition is true, then all the rows or rows satisfying the condition will be copied to the new table.
-
-
-
-
-
What will be the output of the following query?
SELECT REPLACE(TRANSLATE(LTRIM(RTRIM('!! ATHEN !!','!'), '!'), 'AN', '**'),'*','TROUBLE') FROM DUAL;TROUBLETHETROUBLE
-
-
SQL Interview Questions
Ans