-
-
Remove Primary Key
What happens if we remove primary key from SQL table?
-
-
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);
-
-
-
User-defined Data Type
Write an SQL statement to create user-defined data types?
-
Oracle Water mark
What is water mark apporach in SQL?
-
-
-
-
What does the following query do?
SELECT SAL + NVL(COMM,0) FROM EMP;This displays the total salary of all employees. The null values in the commission column will be replaced by 0 and added to salary.
-
What are the wildcards used for pattern matching?
_ for single character substitution and % for multi-character substitution
-
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
-
What is table space?
I want to know the answer
-
What operator performs pattern matching?
LIKE operator
-
-
-
SQL Interview Questions
Ans