Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
100%
(1)
100% found this document useful (1 vote)
80 views
SQL Query Question
SQL question
Uploaded by
Shreya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save SQL Query Question For Later
Download
Save
Save SQL Query Question For Later
100%
100% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
100%
(1)
100% found this document useful (1 vote)
80 views
SQL Query Question
SQL question
Uploaded by
Shreya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save SQL Query Question For Later
Carousel Previous
Carousel Next
Save
Save SQL Query Question For Later
100%
100% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 9
Search
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 A.ID,A.FNAME,A.LNAME, ISNULL(A.SALARY,@) 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 - '.B.Teamname) 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
Sql Mastery set 1 (110 questions)
PDF
No ratings yet
Sql Mastery set 1 (110 questions)
7 pages
HAVING Clause Practice Problems
PDF
No ratings yet
HAVING Clause Practice Problems
3 pages
Alteryx Imp Ques by Abhishek
PDF
100% (1)
Alteryx Imp Ques by Abhishek
9 pages
Power Apps Developer-Mounika Ravuri
PDF
No ratings yet
Power Apps Developer-Mounika Ravuri
4 pages
Select As From: Firstname (First Name) Employeedetail
PDF
100% (1)
Select As From: Firstname (First Name) Employeedetail
7 pages
SQL Practice Queries
PDF
No ratings yet
SQL Practice Queries
4 pages
EMP & DEPT Table Related Queries
PDF
No ratings yet
EMP & DEPT Table Related Queries
2 pages
Oracle HR Schema Practise Queries
PDF
No ratings yet
Oracle HR Schema Practise Queries
10 pages
ADD Add Constraint Alter: Keyword Description
PDF
No ratings yet
ADD Add Constraint Alter: Keyword Description
5 pages
Oracle SQL Sat PDF
PDF
No ratings yet
Oracle SQL Sat PDF
89 pages
SQL PLSQL Document
PDF
No ratings yet
SQL PLSQL Document
319 pages
Oracle Material
PDF
No ratings yet
Oracle Material
90 pages
SQL Queries: Prepared by VSL PRASAAD
PDF
No ratings yet
SQL Queries: Prepared by VSL PRASAAD
15 pages
Oracle Gen Queries
PDF
No ratings yet
Oracle Gen Queries
15 pages
Oracle Interview Preparation
PDF
No ratings yet
Oracle Interview Preparation
2 pages
Int SQL PLSQL
PDF
No ratings yet
Int SQL PLSQL
32 pages
Oracle Practice 2
PDF
No ratings yet
Oracle Practice 2
13 pages
CTE in SQL Server - CodeProject
PDF
100% (1)
CTE in SQL Server - CodeProject
8 pages
SQL Practice Questions
PDF
No ratings yet
SQL Practice Questions
5 pages
SQL Project 1
PDF
100% (1)
SQL Project 1
40 pages
SQL Queries
PDF
No ratings yet
SQL Queries
8 pages
#SQL #Queries #Interview
PDF
No ratings yet
#SQL #Queries #Interview
11 pages
Subqueries
PDF
No ratings yet
Subqueries
4 pages
IT 450 Oracle SQL Assignment 1
PDF
No ratings yet
IT 450 Oracle SQL Assignment 1
1 page
Advanced SQL Functions
PDF
No ratings yet
Advanced SQL Functions
12 pages
Oracle Queries
PDF
No ratings yet
Oracle Queries
27 pages
SQL Lab Assignment
PDF
No ratings yet
SQL Lab Assignment
6 pages
Answers To Exercises Given in 9-DEC-2011 Batch Related To HR Schema in Oracle Database 11g
PDF
100% (1)
Answers To Exercises Given in 9-DEC-2011 Batch Related To HR Schema in Oracle Database 11g
5 pages
SQL Assignment 1
PDF
No ratings yet
SQL Assignment 1
4 pages
SQL Practice
PDF
No ratings yet
SQL Practice
3 pages
Airline Management System - Q-A-O
PDF
No ratings yet
Airline Management System - Q-A-O
12 pages
SQL Assignment
PDF
No ratings yet
SQL Assignment
4 pages
SQL Exercise
PDF
No ratings yet
SQL Exercise
11 pages
SQL Sub Queries
PDF
75% (4)
SQL Sub Queries
5 pages
Correlated SubQuery
PDF
No ratings yet
Correlated SubQuery
3 pages
Create Int Varchar Date Varchar State Varchar: Emp - Piyush Employeeid Empname 30 Dob City 20 20
PDF
100% (1)
Create Int Varchar Date Varchar State Varchar: Emp - Piyush Employeeid Empname 30 Dob City 20 20
10 pages
SQL Iq Questions
PDF
No ratings yet
SQL Iq Questions
18 pages
SQL Query Practice Solution
PDF
100% (2)
SQL Query Practice Solution
7 pages
SQL Exercise
PDF
No ratings yet
SQL Exercise
14 pages
3. Solutions of SQL
PDF
No ratings yet
3. Solutions of SQL
38 pages
Topicos 1Z0-071 Oracle
PDF
No ratings yet
Topicos 1Z0-071 Oracle
3 pages
Lab 9 Tasks Subqueries - Solved
PDF
No ratings yet
Lab 9 Tasks Subqueries - Solved
9 pages
Exceptions in PL/SQL
PDF
No ratings yet
Exceptions in PL/SQL
4 pages
PL SQL Assignments
PDF
No ratings yet
PL SQL Assignments
64 pages
Oracle SQL Queries On Sales Table
PDF
100% (3)
Oracle SQL Queries On Sales Table
17 pages
SQL - Subqueries
PDF
No ratings yet
SQL - Subqueries
15 pages
OBIEE 11G Row Level Security
PDF
No ratings yet
OBIEE 11G Row Level Security
10 pages
Best2 Toppers SQL-interview-Question
PDF
No ratings yet
Best2 Toppers SQL-interview-Question
47 pages
SQL Assignment
PDF
No ratings yet
SQL Assignment
9 pages
SQL
PDF
No ratings yet
SQL
27 pages
Murali Sir Oracle 11g Notes PDF
PDF
100% (1)
Murali Sir Oracle 11g Notes PDF
372 pages
WWW Srikanthtechnologies Com Oracle Dec9 Hrqueries HTML
PDF
No ratings yet
WWW Srikanthtechnologies Com Oracle Dec9 Hrqueries HTML
14 pages
SQL Views:-: CREATE VIEW View - Name AS SELECT Column - List FROM Table - Name (WHERE Condition)
PDF
No ratings yet
SQL Views:-: CREATE VIEW View - Name AS SELECT Column - List FROM Table - Name (WHERE Condition)
19 pages
SQL Functions
PDF
No ratings yet
SQL Functions
17 pages
Joins: Inner Join
PDF
No ratings yet
Joins: Inner Join
9 pages
Mysql
PDF
No ratings yet
Mysql
7 pages
Oracle Forms Reports Besant Technologies Course Syllabus
PDF
No ratings yet
Oracle Forms Reports Besant Technologies Course Syllabus
6 pages
Top 60 SQL Queries
PDF
100% (1)
Top 60 SQL Queries
34 pages
SQL Scenario Based Questions
PDF
No ratings yet
SQL Scenario Based Questions
20 pages
SQL Interview Questions Sheet
PDF
No ratings yet
SQL Interview Questions Sheet
16 pages
Top 50 SQL Questions
PDF
No ratings yet
Top 50 SQL Questions
15 pages
(Udit Narayan Mukhiya) DBMS SQL PDF
PDF
No ratings yet
(Udit Narayan Mukhiya) DBMS SQL PDF
12 pages
Manasa Resume
PDF
No ratings yet
Manasa Resume
4 pages
Data Analyst - C - DataA - Inst
PDF
No ratings yet
Data Analyst - C - DataA - Inst
1 page
Kapil (Python)
PDF
No ratings yet
Kapil (Python)
3 pages
Jr. Data Scientist-Case Study
PDF
No ratings yet
Jr. Data Scientist-Case Study
162 pages
Daxquest
PDF
No ratings yet
Daxquest
8 pages
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
Sql Mastery set 1 (110 questions)
PDF
Sql Mastery set 1 (110 questions)
HAVING Clause Practice Problems
PDF
HAVING Clause Practice Problems
Alteryx Imp Ques by Abhishek
PDF
Alteryx Imp Ques by Abhishek
Power Apps Developer-Mounika Ravuri
PDF
Power Apps Developer-Mounika Ravuri
Select As From: Firstname (First Name) Employeedetail
PDF
Select As From: Firstname (First Name) Employeedetail
SQL Practice Queries
PDF
SQL Practice Queries
EMP & DEPT Table Related Queries
PDF
EMP & DEPT Table Related Queries
Oracle HR Schema Practise Queries
PDF
Oracle HR Schema Practise Queries
ADD Add Constraint Alter: Keyword Description
PDF
ADD Add Constraint Alter: Keyword Description
Oracle SQL Sat PDF
PDF
Oracle SQL Sat PDF
SQL PLSQL Document
PDF
SQL PLSQL Document
Oracle Material
PDF
Oracle Material
SQL Queries: Prepared by VSL PRASAAD
PDF
SQL Queries: Prepared by VSL PRASAAD
Oracle Gen Queries
PDF
Oracle Gen Queries
Oracle Interview Preparation
PDF
Oracle Interview Preparation
Int SQL PLSQL
PDF
Int SQL PLSQL
Oracle Practice 2
PDF
Oracle Practice 2
CTE in SQL Server - CodeProject
PDF
CTE in SQL Server - CodeProject
SQL Practice Questions
PDF
SQL Practice Questions
SQL Project 1
PDF
SQL Project 1
SQL Queries
PDF
SQL Queries
#SQL #Queries #Interview
PDF
#SQL #Queries #Interview
Subqueries
PDF
Subqueries
IT 450 Oracle SQL Assignment 1
PDF
IT 450 Oracle SQL Assignment 1
Advanced SQL Functions
PDF
Advanced SQL Functions
Oracle Queries
PDF
Oracle Queries
SQL Lab Assignment
PDF
SQL Lab Assignment
Answers To Exercises Given in 9-DEC-2011 Batch Related To HR Schema in Oracle Database 11g
PDF
Answers To Exercises Given in 9-DEC-2011 Batch Related To HR Schema in Oracle Database 11g
SQL Assignment 1
PDF
SQL Assignment 1
SQL Practice
PDF
SQL Practice
Airline Management System - Q-A-O
PDF
Airline Management System - Q-A-O
SQL Assignment
PDF
SQL Assignment
SQL Exercise
PDF
SQL Exercise
SQL Sub Queries
PDF
SQL Sub Queries
Correlated SubQuery
PDF
Correlated SubQuery
Create Int Varchar Date Varchar State Varchar: Emp - Piyush Employeeid Empname 30 Dob City 20 20
PDF
Create Int Varchar Date Varchar State Varchar: Emp - Piyush Employeeid Empname 30 Dob City 20 20
SQL Iq Questions
PDF
SQL Iq Questions
SQL Query Practice Solution
PDF
SQL Query Practice Solution
SQL Exercise
PDF
SQL Exercise
3. Solutions of SQL
PDF
3. Solutions of SQL
Topicos 1Z0-071 Oracle
PDF
Topicos 1Z0-071 Oracle
Lab 9 Tasks Subqueries - Solved
PDF
Lab 9 Tasks Subqueries - Solved
Exceptions in PL/SQL
PDF
Exceptions in PL/SQL
PL SQL Assignments
PDF
PL SQL Assignments
Oracle SQL Queries On Sales Table
PDF
Oracle SQL Queries On Sales Table
SQL - Subqueries
PDF
SQL - Subqueries
OBIEE 11G Row Level Security
PDF
OBIEE 11G Row Level Security
Best2 Toppers SQL-interview-Question
PDF
Best2 Toppers SQL-interview-Question
SQL Assignment
PDF
SQL Assignment
SQL
PDF
SQL
Murali Sir Oracle 11g Notes PDF
PDF
Murali Sir Oracle 11g Notes PDF
WWW Srikanthtechnologies Com Oracle Dec9 Hrqueries HTML
PDF
WWW Srikanthtechnologies Com Oracle Dec9 Hrqueries HTML
SQL Views:-: CREATE VIEW View - Name AS SELECT Column - List FROM Table - Name (WHERE Condition)
PDF
SQL Views:-: CREATE VIEW View - Name AS SELECT Column - List FROM Table - Name (WHERE Condition)
SQL Functions
PDF
SQL Functions
Joins: Inner Join
PDF
Joins: Inner Join
Mysql
PDF
Mysql
Oracle Forms Reports Besant Technologies Course Syllabus
PDF
Oracle Forms Reports Besant Technologies Course Syllabus
Top 60 SQL Queries
PDF
Top 60 SQL Queries
SQL Scenario Based Questions
PDF
SQL Scenario Based Questions
SQL Interview Questions Sheet
PDF
SQL Interview Questions Sheet
Top 50 SQL Questions
PDF
Top 50 SQL Questions
(Udit Narayan Mukhiya) DBMS SQL PDF
PDF
(Udit Narayan Mukhiya) DBMS SQL PDF
Manasa Resume
PDF
Manasa Resume
Data Analyst - C - DataA - Inst
PDF
Data Analyst - C - DataA - Inst
Kapil (Python)
PDF
Kapil (Python)
Jr. Data Scientist-Case Study
PDF
Jr. Data Scientist-Case Study
Daxquest
PDF
Daxquest