Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Sql interview questions
1. SQL InterviewQuestions
SQL Interview Questions for Fresher’s and experienced whatever i have
faced in my Interviews, these sql interview questions are very helpful
for the people who are trying to get the job on Oracle SQL, PL/SQL.
Explain briefly NVL, NVL2, NULLIF functions
I have a table and created two indexes on two columns but i want
create 3rd index how you can create an index
What is data modelling and how to create relation between A and B
tables.
Difference between truncate and delete, why truncate faster rather
than delete.
Difference between view and materialized view
What is correlated subquery?
What is complex query and have you ever work on that.
Difference between btree and bitmap index
Difference between Translate and Decode.
Difference between Delete and Truncate.
Which is faster Case or Decode.
Difference between case and decode
What are pseudo columns in oracle
What is driving table?
As a developer how to tune sql query, explain the steps.
Can we create a primary key constraint on 2 columns and foreign key on
other column is it possible?
Create sequence sequence_name; , this sequence generate a sequence
value or not.
Write a query to find 4th highest salary (without analytical
function).
10 records in excel file, i wan to load 8 records only through sql *
loader, is it possible.
I have created a simple view but there is no base table, what happens.
I found bottlenecks in sql statement as below
Select * from emp where dept_no in (10,20);
Is it possible to change select * from emp where dept_no=10 or
dept_no=20; in production?
Can we create index on virtual columns.
What is invisible column?
How many types of partitions, explain interval partition, virtual
partitions and Reference Partition.
Can we update complex view, i want to insert, delete and update
operation on view, what are the steps of instead of dml operations.
What is the purpose of materialized view?
I have trying to create a sequence like 1 2 3 4 5 next row i want
start 1 2 3 4 5 is it possible?
I want to truncate a table before loading data through sql loader is
it right way?
What is reverse key index.
What is hash partition, when you create a hash partition?
2. When you create a function based index, why you go for function based
index,
What is hash join, explain how to use,
What is the difference between primary key and unique key,
I have create a composite primary key on two columns and inserting on
value and null value, is it possible, and create a unique index on
other columns, inserting 3 rows and inserting 3 null value on unique
column, is it possible.
Have you ever create sequence on primary key column
Tell me the query to retrieve top 5 salaries in each dept wise using
analytical function.
Types of materialized view refreshing methods
Fast refresh working on complex materialized view,can we create a
index on materialized view.
what is view and materialized view, types of refreshing methods.
have you ever worked on dynamic sql.
how to get top 10 salaries from two different tables
write a query to get more then 2 employees under manager
listagg
interset
which is the faster left outer join and right outer join
how to delete duplicate records
what is primary and unique constraint
in and exist which is the faster, why exist is faster?
Write a query to find 3rd highest salary
Using DENSE_RANK
SELECT *
FROM
( SELECT emp.*,DENSE_RANK() OVER(ORDER BY Sal DESC) Rno FROM EMP
)
WHERE Rno=3;
Using ROWNUM
----------------------------------------------------------------------
----
SELECT sal
FROM
(SELECT rownum rn,
sal
FROM
( SELECT DISTINCT sal FROM emp ORDER BY sal DESC
)
)
WHERE rn = 3;
----------------------------------------------------------------------
------------------
SELECT *
FROM emp
WHERE sal =
(SELECT sal
3. FROM
(SELECT rownum rn,
sal
FROM
( SELECT DISTINCT sal FROM emp ORDER BY sal DESC
)
)
WHERE rn = 3
);
Using SELF JOIN
SELECT *
FROM emp a
WHERE 3 =
(SELECT COUNT(DISTINCT(Sal)) FROM emp b WHERE a.sal<=b.sal
)
ORDER BY sal;
Write a query to find 10 highest salary
Can you write syntax of case statement?
Can we create a table on exiting table?
How to create a synonym, write syntax of synonym
What are partitions, when we go for partitions?
How to rebuild index, syntax of rebuild index
How to create a BLOB, syntax of blob
What is control file, syntax of control file?
What truncate and delete?
How to check the table or view exiting or not
Select * from a where hiredate+60 < sysdate; (here hiredate is non-
unique index, so query scanning index range or full table scanning.
Have you worked on explain plan, how to tune sql query
Can you write pivot query?
What are analytical functions?
Difference between sql *loader and external table, explain
requirements for that
Have you ever worked on partitions, explain Virtual column based
partitioning
what is nvl and nvl2 function and examples
Explain about TK-proof , syntax of TK-proof
Merge statement syntax
Partition Exchange(One table have 5 partitions like P1...P5, I want to
move P5 partition insert into another Table)?
Difference between 10g and 11g
COLN
---------
A
A
A
B
B
B
B
Write a query output like as
4. coln
------
3
4
coln
-----
A
B
C
D
E
I want output like this
TEXT
--------
A,B,C,D,E
EMPNO ENAME
----------- -----------
12345 REDDY
I want to count of empno and ename
coln
------
-1
-2
-3
-10
1
8
7
I want to count of positive and negative
select sum(decode(sign(value),1,value)) pos, sum(decode(sign(value),-
1,value)) neg from pn
select ( select sum(value) from pn where 0<value) as positive, (select
sum(value) from pn where 0>value) as negative from dual
select unique ( select sum(value) from pn where 0<value) as positive,
(select sum(value) from pn where 0>value) as negative from pn
Have you ever created tables, tell me 3 differences between primary
key and unique key.
Have you ever worked on partitions, why should we go to partitions?
Have you ever worked on indexes, what is the default index? Why we can
create a Function based index?
Have you created Materialized view, what is it?
What is the difference between view and materialized view?
Difference between import/export and sql loader
What is conventional path and direct path, which is the faster?
What is the requirement you have used import/export?
What are the functions you have worked on every day? What is the usage
of decode?
Have you ever worked on Analytical functions?
COLUMN_NO VALUE
----------------------------------------------
1 A
1 B
5. 1 C
2 A
2 B
3 A
4 A
I want to show the output like as
COLUMN_NO VALUE
----------------------------------------------
1 A,B,C
2 A,B
3 A
4 A
What is your database version, what are 11g features,
How to find duplicate records on table, please find below table.
COL1 COL2
----------------------------------------
A 1
A 2
A 3
A 4
B 5
B 6
B 7
C 8
C 9
I want to show the output like as
A B C
-----------------------
4 3 2
SELECT A1.A,B1.B,C1.C FROM (SELECT COUNT(NAME)A FROM Ta WHERE Name
='A')A1,
(SELECT COUNT(NAME)B FROM Ta WHERE Name='B')B1,
(SELECT COUNT(Name)C FROM Ta WHERE Name='C')C1
select decode(col1,'A',count(1)) "A",decode(col1,'B',count(1))
"B",decode(col1,'C',count(1)) "C" from table1
Group by col1
Select * from( select col1,col2 from table_name ) pivot( count(col2)
for col1 in ('A','B','C') );
select count(decode(col1,'A',col2)) A,count(decode(col1,'B',col2))
B,count(decode
(col1,'C',col2)) C from r6;
6. I have a csv file in outside database, every 10 minutes added new
records in csv file. My requirement is load csv file in database,
which method you to approach to load csv file to database.
If you created primary key which index created and if you created
index which constraint created automatically?
What is nvl and nvl2?
Can you write syntax of decode
Count(*) status
-------------------------
1 s
1 s
1 s
2 a
2 a
3 c
Can you write a query for this output?
Difference between primary and unique and i am retrieving unique
column, that time unique column firing or not?
Difference between nvl and nvl2