SlideShare a Scribd company logo
1 of 6
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?
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
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
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
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;
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

More Related Content

What's hot

SQL injection exploitation internals
SQL injection exploitation internalsSQL injection exploitation internals
SQL injection exploitation internalsBernardo Damele A. G.
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionIntro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionMedhat Dawoud
 
Sql tutorial-Structured query language
Sql tutorial-Structured query languageSql tutorial-Structured query language
Sql tutorial-Structured query languageMayank Bansal
 
Intro to T-SQL - 1st session
Intro to T-SQL - 1st sessionIntro to T-SQL - 1st session
Intro to T-SQL - 1st sessionMedhat Dawoud
 
Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusChhom Karath
 
Sql Injection Adv Owasp
Sql Injection Adv OwaspSql Injection Adv Owasp
Sql Injection Adv OwaspAung Khant
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredDanish Mehraj
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 Richie Rump
 

What's hot (17)

SQL injection exploitation internals
SQL injection exploitation internalsSQL injection exploitation internals
SQL injection exploitation internals
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionIntro to T-SQL – 2nd session
Intro to T-SQL – 2nd session
 
Sql tutorial-Structured query language
Sql tutorial-Structured query languageSql tutorial-Structured query language
Sql tutorial-Structured query language
 
Intro to T-SQL - 1st session
Intro to T-SQL - 1st sessionIntro to T-SQL - 1st session
Intro to T-SQL - 1st session
 
Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*Plus
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
SQL
SQLSQL
SQL
 
Sql Injection Adv Owasp
Sql Injection Adv OwaspSql Injection Adv Owasp
Sql Injection Adv Owasp
 
Pl sql-ch1
Pl sql-ch1Pl sql-ch1
Pl sql-ch1
 
SQL Injection
SQL Injection SQL Injection
SQL Injection
 
Sql injection
Sql injectionSql injection
Sql injection
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
SQL2SPARQL
SQL2SPARQLSQL2SPARQL
SQL2SPARQL
 
treeview
treeviewtreeview
treeview
 
Advanced sql injection 2
Advanced sql injection 2Advanced sql injection 2
Advanced sql injection 2
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012
 
Schema webinar
Schema webinarSchema webinar
Schema webinar
 

Viewers also liked

Sql interview question part 9
Sql interview question part 9Sql interview question part 9
Sql interview question part 9kaashiv1
 
Sql interview question part 8
Sql interview question part 8Sql interview question part 8
Sql interview question part 8kaashiv1
 
Oracle SQL Interview Questions for Freshers
Oracle SQL Interview Questions for FreshersOracle SQL Interview Questions for Freshers
Oracle SQL Interview Questions for FreshersDTecH It Education
 
SQL practice questions set - 2
SQL practice questions set - 2SQL practice questions set - 2
SQL practice questions set - 2Mohd Tousif
 
Sql queries questions and answers
Sql queries questions and answersSql queries questions and answers
Sql queries questions and answersMichael Belete
 
My Experience Using Oracle SQL Plan Baselines 11g/12c
My Experience Using Oracle SQL Plan Baselines 11g/12cMy Experience Using Oracle SQL Plan Baselines 11g/12c
My Experience Using Oracle SQL Plan Baselines 11g/12cNelson Calero
 
Sql interview questions and answers
Sql interview questions and  answersSql interview questions and  answers
Sql interview questions and answerssheibansari
 
Top 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and AnswersTop 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and Answersiimjobs and hirist
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answersvijaybusu
 

Viewers also liked (12)

Sql interview question part 9
Sql interview question part 9Sql interview question part 9
Sql interview question part 9
 
Sql interview question part 8
Sql interview question part 8Sql interview question part 8
Sql interview question part 8
 
Oracle SQL Interview Questions for Freshers
Oracle SQL Interview Questions for FreshersOracle SQL Interview Questions for Freshers
Oracle SQL Interview Questions for Freshers
 
SQL practice questions set - 2
SQL practice questions set - 2SQL practice questions set - 2
SQL practice questions set - 2
 
Sql queries questions and answers
Sql queries questions and answersSql queries questions and answers
Sql queries questions and answers
 
My Experience Using Oracle SQL Plan Baselines 11g/12c
My Experience Using Oracle SQL Plan Baselines 11g/12cMy Experience Using Oracle SQL Plan Baselines 11g/12c
My Experience Using Oracle SQL Plan Baselines 11g/12c
 
Sql interview questions and answers
Sql interview questions and  answersSql interview questions and  answers
Sql interview questions and answers
 
Oracle Complete Interview Questions
Oracle Complete Interview QuestionsOracle Complete Interview Questions
Oracle Complete Interview Questions
 
Sql queires
Sql queiresSql queires
Sql queires
 
Top 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and AnswersTop 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and Answers
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answers
 

Similar to Sql interview questions

Oracle Join Methods and 12c Adaptive Plans
Oracle Join Methods and 12c Adaptive PlansOracle Join Methods and 12c Adaptive Plans
Oracle Join Methods and 12c Adaptive PlansFranck Pachot
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Alex Zaballa
 
How to leave the ORM at home and write SQL
How to leave the ORM at home and write SQLHow to leave the ORM at home and write SQL
How to leave the ORM at home and write SQLMariaDB plc
 
Analytic & Windowing functions in oracle
Analytic & Windowing functions in oracleAnalytic & Windowing functions in oracle
Analytic & Windowing functions in oracleLogan Palanisamy
 
Oracle sql tutorial
Oracle sql tutorialOracle sql tutorial
Oracle sql tutorialMohd Tousif
 
12c SQL Plan Directives
12c SQL Plan Directives12c SQL Plan Directives
12c SQL Plan DirectivesFranck Pachot
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsOracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsAlex Zaballa
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c  - New Features for Developers and DBAsOracle Database 12c  - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsAlex Zaballa
 
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL) Mohd Tousif
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsNirav Shah
 
The ultimate-guide-to-sql
The ultimate-guide-to-sqlThe ultimate-guide-to-sql
The ultimate-guide-to-sqlMcNamaraChiwaye
 
SQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersSQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersBRIJESH KUMAR
 

Similar to Sql interview questions (20)

Oracle Join Methods and 12c Adaptive Plans
Oracle Join Methods and 12c Adaptive PlansOracle Join Methods and 12c Adaptive Plans
Oracle Join Methods and 12c Adaptive Plans
 
SQLQueries
SQLQueriesSQLQueries
SQLQueries
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 
How to leave the ORM at home and write SQL
How to leave the ORM at home and write SQLHow to leave the ORM at home and write SQL
How to leave the ORM at home and write SQL
 
Table functions - Planboard Symposium 2013
Table functions - Planboard Symposium 2013Table functions - Planboard Symposium 2013
Table functions - Planboard Symposium 2013
 
Analytic & Windowing functions in oracle
Analytic & Windowing functions in oracleAnalytic & Windowing functions in oracle
Analytic & Windowing functions in oracle
 
Sql
SqlSql
Sql
 
Oracle sql tutorial
Oracle sql tutorialOracle sql tutorial
Oracle sql tutorial
 
SQL
SQLSQL
SQL
 
12c SQL Plan Directives
12c SQL Plan Directives12c SQL Plan Directives
12c SQL Plan Directives
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsOracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c  - New Features for Developers and DBAsOracle Database 12c  - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL)
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
 
Oracle NOLOGGING
Oracle NOLOGGINGOracle NOLOGGING
Oracle NOLOGGING
 
The ultimate-guide-to-sql
The ultimate-guide-to-sqlThe ultimate-guide-to-sql
The ultimate-guide-to-sql
 
Select To Order By
Select  To  Order BySelect  To  Order By
Select To Order By
 
SQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersSQL Database Performance Tuning for Developers
SQL Database Performance Tuning for Developers
 
Unit 3
Unit 3Unit 3
Unit 3
 

Recently uploaded

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Recently uploaded (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
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