SlideShare uma empresa Scribd logo
1 de 5
SQL INTERVIEW QUESTIONS FOR EXPERIENCED
What is the difference between CHAR and VARCHAR2 datatype in
SQL?
Both Char and Varchar2 are used for characters datatype but varchar2 is
used for character strings of variable length whereas Char is used for
strings of fixed length. For example, char(10) can only store 10
characters and will not be able to store a string of any other length
whereas varchar2(10) can store any length i.e 6,8,2 in this variable.
What do you understand by query optimization?
The phase that identifies a plan for evaluation query which has the least
estimated cost is known as query optimization.
What is the difference between DROP and TRUNCATE
commands?
DROP command removes a table and it cannot be rolled back from the
database whereas TRUNCATE command removes all the rows from the
table.
What do you mean by “Trigger” in SQL?
Trigger in SQL is are a special type of stored procedures that are defined
to execute automatically in place or after data modifications. It allows
you to execute a batch of code when an insert, update or any other query
is executed against a specific table.
. What is the difference between cross join and natural join?
The cross join produces the cross product or Cartesian product of two
tables whereas the natural join is based on all the columns having the
same name and data types in both the tables.
What is the need for group functions in SQL?
Group functions work on the set of rows and return one result per group.
Some of the commonly used group functions are: AVG, COUNT, MAX,
MIN, SUM, VARIANCE.
How can you insert NULL values in a column while inserting the
data?
NULL values in SQL can be inserted in the following ways:
Implicitly by omitting column from column list.
Explicitly by specifying NULL keyword in the VALUES clause
What do you mean by recursive stored procedure?
Recursive stored procedure refers to a stored procedure which calls by
itself until it reaches some boundary condition. This recursive function
or procedure helps the programmers to use the same set of code n
number of times.
List the ways in which Dynamic SQL can be executed?
Following are the ways in which dynamic SQL can be executed:
Write a query with parameters.
Using EXEC.
Using sp_executesql.
What are aggregate and scalar functions?
Aggregate functions are used to evaluate mathematical calculation and
returns a single value. These calculations are done from the columns in a
table. For example- max(),count() are calculated with respect to
numeric.
Scalar functions return a single value based on the input value. For
example – UCASE(), NOW() are calculated with respect to string.
How can you select unique records from a table?
You can select unique records from a table by using the DISTINCT
keyword.
Select DISTINCT studentID from Student
Using this command, it will print unique student id from the table
Student.
How can you fetch first 5 characters of the string?
There are a lot of ways to fetch characters from a string. For example:
Select SUBSTRING(StudentName,1,5) as studentname from student
What do you mean by Collation?
Collation is defined as a set of rules that determine how data can be
sorted as well as compared. Character data is sorted using the rules that
define the correct character sequence along with options for specifying
case-sensitivity, character width etc.
What are the different types of Collation Sensitivity?
Following are the different types of collation sensitivity:
Case Sensitivity: A and a and B and b.
Kana Sensitivity: Japanese Kana characters.
Width Sensitivity: Single byte character and double-byte character.
Accent Sensitivity.
What is Auto Increment in SQL?
Autoincrement keyword allows the user to create a unique number to get
generated whenever a new record is inserted into the table.
This keyword is usually required whenever PRIMARY KEY in SQL is
used.
AUTO INCREMENT keyword can be used in Oracle and IDENTITY
keyword can be used in SQL SERVER.
What is a Datawarehouse?
Datawarehouse refers to a central repository of data where the data is
assembled from multiple sources of information. Those data are
consolidated, transformed and made available for the mining as well as
online processing. Warehouse data also have a subset of data called Data
Marts.
What are the different authentication modes in SQL Server? How
can it be changed?
Windows mode and Mixed Mode – SQL and Windows. You can go to
the below steps to change authentication mode in SQL Server:
Click Start> Programs> Microsoft SQL Server and click SQL Enterprise
Manager to run SQL Enterprise Manager from the Microsoft SQL
Server program group.
Then select the server from the Tools menu.
Select SQL Server Configuration Properties, and choose the Security
page.

Mais conteúdo relacionado

Mais procurados

Ap Power Point Chpt7
Ap Power Point Chpt7Ap Power Point Chpt7
Ap Power Point Chpt7
dplunkett
 
Classes and objects till 16 aug
Classes and objects till 16 augClasses and objects till 16 aug
Classes and objects till 16 aug
shashank12march
 
Basics of java 2
Basics of java 2Basics of java 2
Basics of java 2
Raghu nath
 

Mais procurados (20)

OOPS in java | Super and this Keyword | Memory Management in java | pacakages...
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...OOPS in java | Super and this Keyword | Memory Management in java | pacakages...
OOPS in java | Super and this Keyword | Memory Management in java | pacakages...
 
Java interview questions 1
Java interview questions 1Java interview questions 1
Java interview questions 1
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B Kute
 
Basics of Java
Basics of JavaBasics of Java
Basics of Java
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 
Core java notes with examples
Core java notes with examplesCore java notes with examples
Core java notes with examples
 
Object oriented programming in java
Object oriented programming in javaObject oriented programming in java
Object oriented programming in java
 
Java: Objects and Object References
Java: Objects and Object ReferencesJava: Objects and Object References
Java: Objects and Object References
 
Java basics
Java basicsJava basics
Java basics
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Ap Power Point Chpt7
Ap Power Point Chpt7Ap Power Point Chpt7
Ap Power Point Chpt7
 
Java oops and fundamentals
Java oops and fundamentalsJava oops and fundamentals
Java oops and fundamentals
 
Classes and objects till 16 aug
Classes and objects till 16 augClasses and objects till 16 aug
Classes and objects till 16 aug
 
OOP java
OOP javaOOP java
OOP java
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
 
Object Oriented Programming using JAVA Notes
Object Oriented Programming using JAVA Notes Object Oriented Programming using JAVA Notes
Object Oriented Programming using JAVA Notes
 
My c++
My c++My c++
My c++
 
Basics of java 2
Basics of java 2Basics of java 2
Basics of java 2
 
Unit 1 Java
Unit 1 JavaUnit 1 Java
Unit 1 Java
 

Semelhante a SQL Interview Questions For Experienced

SQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfSQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdf
DraguClaudiu
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)
Nalina Kumari
 
3963066 pl-sql-notes-only
3963066 pl-sql-notes-only3963066 pl-sql-notes-only
3963066 pl-sql-notes-only
Ashwin Kumar
 
Presentation1
Presentation1Presentation1
Presentation1
Jay Patel
 
Anchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data typeAnchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data type
dhruv patel
 

Semelhante a SQL Interview Questions For Experienced (20)

Top 50 oracle interview questions and answers
Top 50 oracle interview questions and answersTop 50 oracle interview questions and answers
Top 50 oracle interview questions and answers
 
Viva voce
Viva voceViva voce
Viva voce
 
Sql ch 4
Sql ch 4Sql ch 4
Sql ch 4
 
SQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfSQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdf
 
Glossary
GlossaryGlossary
Glossary
 
Structure query language (sql)
Structure query language (sql)Structure query language (sql)
Structure query language (sql)
 
3963066 pl-sql-notes-only
3963066 pl-sql-notes-only3963066 pl-sql-notes-only
3963066 pl-sql-notes-only
 
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
 
Module02
Module02Module02
Module02
 
Structure Query Language (SQL).pptx
Structure Query Language (SQL).pptxStructure Query Language (SQL).pptx
Structure Query Language (SQL).pptx
 
Adbms
AdbmsAdbms
Adbms
 
12 SQL
12 SQL12 SQL
12 SQL
 
12 SQL
12 SQL12 SQL
12 SQL
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*Plus
 
Ankit
AnkitAnkit
Ankit
 
Sql server
Sql serverSql server
Sql server
 
chapter-14-sql-commands.pdf
chapter-14-sql-commands.pdfchapter-14-sql-commands.pdf
chapter-14-sql-commands.pdf
 
Presentation1
Presentation1Presentation1
Presentation1
 
Anchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data typeAnchor data type,cursor data type,array data type
Anchor data type,cursor data type,array data type
 

Mais de zynofustechnology

Mais de zynofustechnology (14)

JAVA QUESTIONS -6
JAVA QUESTIONS -6JAVA QUESTIONS -6
JAVA QUESTIONS -6
 
JAVA QUESTIONS FOR INTERVIEW-3
JAVA QUESTIONS FOR INTERVIEW-3JAVA QUESTIONS FOR INTERVIEW-3
JAVA QUESTIONS FOR INTERVIEW-3
 
PYTHON INTERVIEW QUESTIONS-4
PYTHON INTERVIEW QUESTIONS-4PYTHON INTERVIEW QUESTIONS-4
PYTHON INTERVIEW QUESTIONS-4
 
PYTHON INTERVIEW QUESTIONS-2
PYTHON INTERVIEW QUESTIONS-2PYTHON INTERVIEW QUESTIONS-2
PYTHON INTERVIEW QUESTIONS-2
 
JAVA INTERVIEW QUESTIONS -3
JAVA INTERVIEW QUESTIONS -3JAVA INTERVIEW QUESTIONS -3
JAVA INTERVIEW QUESTIONS -3
 
Java Interview Questions-5
Java Interview Questions-5Java Interview Questions-5
Java Interview Questions-5
 
Java Interview Questions - 1
Java Interview Questions - 1Java Interview Questions - 1
Java Interview Questions - 1
 
Software Testing Interview Questions For Experienced
Software Testing Interview Questions For ExperiencedSoftware Testing Interview Questions For Experienced
Software Testing Interview Questions For Experienced
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experienced
 
Python Interview Questions For Freshers
Python Interview Questions For FreshersPython Interview Questions For Freshers
Python Interview Questions For Freshers
 
HR interview questions
HR interview questionsHR interview questions
HR interview questions
 
Digital marketing questions -3
Digital marketing questions -3Digital marketing questions -3
Digital marketing questions -3
 
Digital marketing questions -2
Digital marketing questions -2Digital marketing questions -2
Digital marketing questions -2
 
Digital marketing questions 1
Digital marketing questions  1Digital marketing questions  1
Digital marketing questions 1
 

Último

JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
Max Lee
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 

Último (20)

GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion Production
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 

SQL Interview Questions For Experienced

  • 1. SQL INTERVIEW QUESTIONS FOR EXPERIENCED What is the difference between CHAR and VARCHAR2 datatype in SQL? Both Char and Varchar2 are used for characters datatype but varchar2 is used for character strings of variable length whereas Char is used for strings of fixed length. For example, char(10) can only store 10 characters and will not be able to store a string of any other length whereas varchar2(10) can store any length i.e 6,8,2 in this variable. What do you understand by query optimization? The phase that identifies a plan for evaluation query which has the least estimated cost is known as query optimization. What is the difference between DROP and TRUNCATE commands? DROP command removes a table and it cannot be rolled back from the database whereas TRUNCATE command removes all the rows from the table. What do you mean by “Trigger” in SQL? Trigger in SQL is are a special type of stored procedures that are defined to execute automatically in place or after data modifications. It allows you to execute a batch of code when an insert, update or any other query is executed against a specific table. . What is the difference between cross join and natural join? The cross join produces the cross product or Cartesian product of two tables whereas the natural join is based on all the columns having the same name and data types in both the tables.
  • 2. What is the need for group functions in SQL? Group functions work on the set of rows and return one result per group. Some of the commonly used group functions are: AVG, COUNT, MAX, MIN, SUM, VARIANCE. How can you insert NULL values in a column while inserting the data? NULL values in SQL can be inserted in the following ways: Implicitly by omitting column from column list. Explicitly by specifying NULL keyword in the VALUES clause What do you mean by recursive stored procedure? Recursive stored procedure refers to a stored procedure which calls by itself until it reaches some boundary condition. This recursive function or procedure helps the programmers to use the same set of code n number of times. List the ways in which Dynamic SQL can be executed? Following are the ways in which dynamic SQL can be executed: Write a query with parameters. Using EXEC. Using sp_executesql.
  • 3. What are aggregate and scalar functions? Aggregate functions are used to evaluate mathematical calculation and returns a single value. These calculations are done from the columns in a table. For example- max(),count() are calculated with respect to numeric. Scalar functions return a single value based on the input value. For example – UCASE(), NOW() are calculated with respect to string. How can you select unique records from a table? You can select unique records from a table by using the DISTINCT keyword. Select DISTINCT studentID from Student Using this command, it will print unique student id from the table Student. How can you fetch first 5 characters of the string? There are a lot of ways to fetch characters from a string. For example: Select SUBSTRING(StudentName,1,5) as studentname from student What do you mean by Collation? Collation is defined as a set of rules that determine how data can be sorted as well as compared. Character data is sorted using the rules that define the correct character sequence along with options for specifying case-sensitivity, character width etc.
  • 4. What are the different types of Collation Sensitivity? Following are the different types of collation sensitivity: Case Sensitivity: A and a and B and b. Kana Sensitivity: Japanese Kana characters. Width Sensitivity: Single byte character and double-byte character. Accent Sensitivity. What is Auto Increment in SQL? Autoincrement keyword allows the user to create a unique number to get generated whenever a new record is inserted into the table. This keyword is usually required whenever PRIMARY KEY in SQL is used. AUTO INCREMENT keyword can be used in Oracle and IDENTITY keyword can be used in SQL SERVER. What is a Datawarehouse? Datawarehouse refers to a central repository of data where the data is assembled from multiple sources of information. Those data are consolidated, transformed and made available for the mining as well as online processing. Warehouse data also have a subset of data called Data Marts.
  • 5. What are the different authentication modes in SQL Server? How can it be changed? Windows mode and Mixed Mode – SQL and Windows. You can go to the below steps to change authentication mode in SQL Server: Click Start> Programs> Microsoft SQL Server and click SQL Enterprise Manager to run SQL Enterprise Manager from the Microsoft SQL Server program group. Then select the server from the Tools menu. Select SQL Server Configuration Properties, and choose the Security page.