Skip to main content
Open navigation menu
Close suggestions
Search
Search
en
Change Language, English
Upload
Sign in
Sign in
100%
(1)
100% found this document useful (1 vote)
55 views
9 pages
SQL Query Question
SQL question
Uploaded by
Shreya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save SQL Query Question For Later
Share
100%
100% found this document useful, undefined
0%
, undefined
Print
Embed
Report
100%
(1)
100% found this document useful (1 vote)
55 views
9 pages
SQL Query Question
SQL question
Uploaded by
Shreya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Go to previous items
Download
Save
Save SQL Query Question For Later
Share
100%
100% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Go to next items
Download
Save SQL Query Question For Later
Fullscreen
* DDL, DMLCOMMANDS : CRUD operations + PRACTICE SELECT STATEMENT + FILTERS(HAVING, WHERE, IN, NOT IN ,BETWEEN) + AGGREGATION (GROUPBY, COUNT,SUM, MAX, MIN,AVG) * ORDER BY é& WILDCARDs + JOINS (INNER, LEFT, RIGHT, FULL, SELF, CROSS) + WINDOWS FUNCTION (RANK,ROW_NUMBER,DENSE_RANK,NTILE, CUME_DIST) + CASE STATEMENT * CTE,SUBQUERIES, TEMP TABLE ,RECURSIVE CTEs + LEAD,LAG, FIRST VALUE, LAST VALUE * STRING FUNCTIONS SQL Statements Execution order GROUP BY AGGREGATE FUNCTIONS HAVING pac JOINS Oh) aa ba Olgas a Faw Ke BL. Rea BCU ZAR leQ:We have one table sequence, write a SQL query to get the desired output. prere [Minseg Man Sea] A 1 3 A 6 A 8 9 8 1 n MAX_Seq from ( Select Name, sequence, sequence-ROW_NUMBER( Jover Q- Write 2 SQL query to get desired output. Input table : Airport Output: SOURCE Pane Eas Pe DELHI MuMeal DELHI MUMBAI DELHI PATNA MUMBAI DELHI BANGALORE PUNE DELHI PATNA CHANDIGARH CHENNAI BANGALORE = PUNE PUNE MUMBAI PUNE BANGALORE Goa HYDERABAD CHANDIGARH CHENNAI PUNE MUMBAL GREED [ess CASE WHEN SOURCE < DESTINATION THEN SOURCE ELSE GOA HYDERABAD IDESTINATION END AS SOURCE , ICASE WHEN SOURCE > DESTINATION THEN SOURCE ELSEQ: Write the SQL Query to get the desired output . Input Table: Employee Output: SE Anil Rajesh. 165000 i Vikas mann 16 7 Raman 62500 2 Nisha 40,000 18 18, Santosh 53750 3B Nidhi 60,000 v7 14 Priya 80,000 18 15 Mohit 45,000 18 16 Rajesh 90,000 - 17 Raman 55,000 16 18 Santosh 65,000.17 Q: Write a SQL query to get the desired output. Input Table : Rough Desired Output: 1 10 9 8 7 ©Q: Write a SQL query to get desired output ? Input Table : Salary Output : cos Ss nD Vishal Kaushal Vishal Kaushal 12000 Akshay Kumar 9000 Akshay Kumar 9000 Zishan Khan 3000 Zishan Khan 8000 Katrina Kaif 10000 Khan Zishan 5000 Katrina Kaif 10000.-«JSELECT FNAME, LNAME, S1+S2 AS TOTAL FROM ( SELECT [Link],[Link],[Link], ISNULL([Link],@) AS. oa Gs ene Kaushal Vishal 4000 * We have one table Demosales , write Sq! query to get desired output. Input :Demosales Desired Qutput : Ca Foren rod cout O01 PL 5 o1 PL 1 02 P2 1 o1 PL 1 03 P3 3 01 PL 1 o1 PL 1 o1 PL 1 o2 P2 1 03 P3 1 03 P3. 1 IORDER_BY ORDERID; 03 P3. 1Q: Write a SQL query to get the Desired output from Input Table. Output: Ee Finance 1 2 HR 1 3 7 2 1 Q: Write a SQL query to get the desired output (missing number from the input series) Input Output : (SELECT 1 AS SEQ. ( SELECT MAX(ID) FROM #MISSING_ROWS )AS SELECT SEQ+ ,MAXSEQ FROM CTE WHERE SEQ < MAXSEQ )| SELECT SEQ FROM CTE WHERE SEQ NOT IN (SELECT ID FROM Q: Write the SQL query to get the desired output. Input Table A, B Desired Output: SELECT * FROM #B HERE ID NOT IN (SELECT ID SBS Hs e+ e+e ofsolso + wae TEETHQ: Write SQL query to get the max value from Rows? Input Table : Maxrows Output: a kal S000 foo 0 Rahul 3500, 1000 2200, a Ro ‘Sukarn, 5600, 7757 8897 Se aan Select Name,Max(AMT) as Maxamt from (| iSelect Name,Amount_AS ANT from #maxro ISELECT Nane. | Q: Write SQL query to get desired output. input Table : Teams Output: AUSTRALIA — INDIA, INDIA AUSTRALIA— NEWZEALAND, AUSTRALIA AUSTRALIA ENGLAND ENGLAND ENGLAND- INDIA NEWZEALAND ENGLAND - NEWZEALAND INDIA - NEWZEALAND - '.[Link]) As MATCHES from #teamsQ: Write the SQL query to get the desired Output ? Input Table : Name Output io Name Ci 1 VISHAL, VISHAL. 2 VISHAL KAUSHAL 3 VISHAL VISHAL 4 KAUSHAL KAUSHAL 5 KAUSHAL VISHAL 6 KAUSHAL KAUSHAL Select Name, ROW_NUMBER() over (Partition by Name lorder by name) as RN Q: Write SQL query to get the desired output. Input Table : Attendance Output: oe
You might also like
American Express SQL Interview Questions
PDF
No ratings yet
American Express SQL Interview Questions
15 pages
SQL Queries for Employee Data Analysis
PDF
No ratings yet
SQL Queries for Employee Data Analysis
0 pages
SQL Basics and DML Overview
PDF
No ratings yet
SQL Basics and DML Overview
89 pages
UTL_FILE Usage in Oracle 10g
PDF
No ratings yet
UTL_FILE Usage in Oracle 10g
7 pages
Oracle SQL/PLSQL Interview Questions Guide
PDF
No ratings yet
Oracle SQL/PLSQL Interview Questions Guide
2 pages
Scenario: Executive Summary of Class Scheduler System
PDF
No ratings yet
Scenario: Executive Summary of Class Scheduler System
8 pages
Oracle Analytical Functions Explained
PDF
No ratings yet
Oracle Analytical Functions Explained
24 pages
HR Schema Exercises Answers 11g
PDF
100% (1)
HR Schema Exercises Answers 11g
5 pages
SQL Practice Questions for Employees
PDF
No ratings yet
SQL Practice Questions for Employees
6 pages
Oracle Hierarchical Queries Explained
PDF
No ratings yet
Oracle Hierarchical Queries Explained
11 pages
Top 130 SQL Interview Questions
PDF
No ratings yet
Top 130 SQL Interview Questions
21 pages
Oracle Functions and Operators Overview
PDF
No ratings yet
Oracle Functions and Operators Overview
17 pages
Employees Without Department Assignment
PDF
No ratings yet
Employees Without Department Assignment
3 pages
PL/SQL Basics and Exercises for IS221
PDF
100% (1)
PL/SQL Basics and Exercises for IS221
36 pages
Primary Constraints in SQL Tables
PDF
No ratings yet
Primary Constraints in SQL Tables
126 pages
Types of Single Row Functions in SQL
PDF
No ratings yet
Types of Single Row Functions in SQL
5 pages
Understanding SQL Subqueries
PDF
No ratings yet
Understanding SQL Subqueries
7 pages
Top SQL Interview Questions & Answers
PDF
No ratings yet
Top SQL Interview Questions & Answers
11 pages
Understanding SQL Cursors in PL/SQL
PDF
No ratings yet
Understanding SQL Cursors in PL/SQL
7 pages
SQL Keywords for Table Modifications
PDF
No ratings yet
SQL Keywords for Table Modifications
5 pages
SQL Query Interview Questions and Answers
PDF
No ratings yet
SQL Query Interview Questions and Answers
6 pages
Comprehensive SQL Query Guide
PDF
No ratings yet
Comprehensive SQL Query Guide
126 pages
Oracle SQL Interview Questions Guide
PDF
No ratings yet
Oracle SQL Interview Questions Guide
13 pages
Understanding SQL Joins
PDF
No ratings yet
Understanding SQL Joins
17 pages
Advanced SQL Lab Exercises Guide
PDF
No ratings yet
Advanced SQL Lab Exercises Guide
2 pages
Using Ref Cursors in Oracle PL/SQL
PDF
No ratings yet
Using Ref Cursors in Oracle PL/SQL
17 pages
Remove Duplicates in Oracle SQL
PDF
0% (1)
Remove Duplicates in Oracle SQL
36 pages
Oracle SQL Queries for Employee Data
PDF
No ratings yet
Oracle SQL Queries for Employee Data
8 pages
SQL SELECT Statement Examples and Errors
PDF
No ratings yet
SQL SELECT Statement Examples and Errors
5 pages
SQL Emp Table Creation and Management
PDF
No ratings yet
SQL Emp Table Creation and Management
10 pages
Oracle SQL Single-Row Functions Guide
PDF
No ratings yet
Oracle SQL Single-Row Functions Guide
5 pages
SQL Practice Queries and Exercises
PDF
No ratings yet
SQL Practice Queries and Exercises
2 pages
Understanding Materialized Views
PDF
No ratings yet
Understanding Materialized Views
3 pages
Top 27 Advanced SQL Interview Questions
PDF
No ratings yet
Top 27 Advanced SQL Interview Questions
20 pages
SQL Database Commands and Functions Guide
PDF
No ratings yet
SQL Database Commands and Functions Guide
26 pages
SQL Aggregate and Scalar Functions Guide
PDF
No ratings yet
SQL Aggregate and Scalar Functions Guide
23 pages
SQL Practice Questions for Employees
PDF
No ratings yet
SQL Practice Questions for Employees
7 pages
Oracle Employee SQL Queries
PDF
No ratings yet
Oracle Employee SQL Queries
15 pages
SQL Queries for Employee Management
PDF
No ratings yet
SQL Queries for Employee Management
20 pages
Escaping Characters in SQL Queries
PDF
No ratings yet
Escaping Characters in SQL Queries
15 pages
SQL Queries for Worker Table Sample
PDF
100% (1)
SQL Queries for Worker Table Sample
2 pages
Understanding SQL Subqueries
PDF
No ratings yet
Understanding SQL Subqueries
4 pages
Oracle SQL Queries for Sales Data
PDF
100% (3)
Oracle SQL Queries for Sales Data
17 pages
DBMS Operations for Grade 6 Students
PDF
No ratings yet
DBMS Operations for Grade 6 Students
71 pages
SQL Workshop Solutions by Alice Rischert
PDF
No ratings yet
SQL Workshop Solutions by Alice Rischert
46 pages
PL/SQL Programming Solutions
PDF
No ratings yet
PL/SQL Programming Solutions
17 pages
Oracle SQL Tutorial for Beginners
PDF
No ratings yet
Oracle SQL Tutorial for Beginners
22 pages
SQL SELECT Statement Essentials
PDF
No ratings yet
SQL SELECT Statement Essentials
11 pages
SQL Queries for Employee Management
PDF
100% (1)
SQL Queries for Employee Management
10 pages
Essential TSQL Interview Q&A 2020
PDF
No ratings yet
Essential TSQL Interview Q&A 2020
8 pages
Oracle SQL*Plus & PL/SQL Training Guide
PDF
100% (4)
Oracle SQL*Plus & PL/SQL Training Guide
396 pages
SQL Assignment: Employee & Project Queries
PDF
100% (1)
SQL Assignment: Employee & Project Queries
3 pages
Oracle SQL Analytical Functions Guide
PDF
No ratings yet
Oracle SQL Analytical Functions Guide
10 pages
SQL Scenario-Based Interview Questions
PDF
No ratings yet
SQL Scenario-Based Interview Questions
20 pages
Complex SQL Queries for Interviews
PDF
No ratings yet
Complex SQL Queries for Interviews
6 pages
Essential SQL Queries for Employees
PDF
No ratings yet
Essential SQL Queries for Employees
41 pages
Complex SQL Query Examples and Solutions
PDF
No ratings yet
Complex SQL Query Examples and Solutions
5 pages
Complex SQL Queries for Interviews
PDF
100% (3)
Complex SQL Queries for Interviews
7 pages
SQL Queries for Employee and Student Data
PDF
No ratings yet
SQL Queries for Employee and Student Data
21 pages
SQL Queries for Employee Management
PDF
No ratings yet
SQL Queries for Employee Management
6 pages
ServiceNow Developer Resume: Manasa Guduru
PDF
No ratings yet
ServiceNow Developer Resume: Manasa Guduru
4 pages
Mounika Bavireddy: Power Apps Developer Resume
PDF
No ratings yet
Mounika Bavireddy: Power Apps Developer Resume
4 pages
Data Analysis for Land Investments
PDF
No ratings yet
Data Analysis for Land Investments
1 page
Alteryx Workflow Optimization Insights
PDF
100% (1)
Alteryx Workflow Optimization Insights
9 pages
Overview of DAX Function Types
PDF
No ratings yet
Overview of DAX Function Types
8 pages
PyCharm Multiple Cursors in Python Dev
PDF
No ratings yet
PyCharm Multiple Cursors in Python Dev
3 pages