SlideShare a Scribd company logo
1 of 4
Download to read offline
Practice Set – 2 (SQL)
Mohd Tousif
1. Prepare the below tables in database in the given format (Employee)
A) Employee
Column Name Data Type Size
Employee_Id Number 6
First_Name Varchar2 20
Last_Name Varchar2 25
Email_Id Varchar2 14
Phone_Number Varchar2 20
Hire_Date Date
Job_Id Varchar2 10
Salary Number 8,2
Commission_Percent Number 2,2
Manager_Id Number 6
Department_Id Number 4
Insert into the above table below values
Emplo
yee_Id
First_N
ame
Last_N
ame
Email_
Id
Phone_
Numbe
r
Hire_D
ate
Job_Id Salary Commi
ssion_P
ercent
Manag
er_Id
Depart
ment_I
d
100 Sailaja Balgeri sb 515.123
.1421
06/17/8
7
AD_PR
ES
24000 0.9 90
101 Neelim
a
Atmuri na 515.124
.1431
09/21/8
9
AD_VP 17000 0.9 100 90
102 Nitin Agarw
al
nag 514.123
.1543
01/13/9
3
AD_VP 17000 0.9 100 90
103 Prasan
th
Rathor
e
pr 515.124
.1421
01/03/9
0
IT_PR
OG
9000 0.6 102 60
104 Santos
h
Devun
uri
sd 514.152
.1278
21/05/9
1
IT_PR
OG
6000 0.6 103 60
107 Ravi ra 512.123
.1234
07/02/9
9
IT_PR
OG
4200 0.6 103 60
124 Vijay vi 513.235 16/11/9 ST_M 5800 0.5 100 50
.1246 9 AN
141 Naveen nav 512.124
.1234
17/10/9
5
ST_CL
ERK
3500 0.5 124 50
142 Amrith
a
am 512.124
.2345
29/01/9
7
ST_CL
ERK
3100 0.5 124 50
143 Srikant
h
G sg 512.123
.1245
15/03/9
8
ST_CL
ERK
2600 0.5 124 50
144 Amol Singh as 09/07/9
8
ST_CL
ERK
2500 0.5 124 50
B) Department
Column Name Data Type Size
Department_Id Number 4
Department_Name Varchar2 30
Manager_Id Number 6
Location_Id Number 4
Insert into the above table below values
Department_Id Department_Name Manager_Id Location_Id
10 Administration 200 1700
20 Marketing 201 1800
50 Shipping 124 1500
60 IT 103 1400
80 Sales 149 2500
90 Executive 100 1700
110 Accounting 205 1700
190 Contracting 1700
C) Salgrade
Column Name Data Type Size
Grade_Level Varcahr2 3
Lowest_Sal Number 6
Highest_Sal Number 6
Insert into the above table below values
Grade_Level Lowest_Sal Highest_Sal
A 1000 2999
B 3000 5999
C 6000 9999
D 10000 14999
E 15000 24999
F 25000 40000
2. Create an Emp table with the following criteria:
Eno number(6)
Ename varchar2(30)
Sal number(8,2)
3. Add a column deptno with the datatype number of size 4
4. Change the name of the column Sal to Salary
5. Change the size of a column Ename to 40 character long
6. Create a Dept table with the following criteria:
Dno number(6)
Dname varchar2(40)
loc_id number(4)
7. remove a column loc_id from dept table
8. change the name of the Dept to Departments
9. insert into emp table the below values
Eno Ename Salary Deptno
1 ANIL 20000 1001
2 ATUL 25000 2002
3 ARUL 30000 1001
4 AMIT 27000 3003
5 ANUP 35000 2002
6 ANIR 30000 1001
10. Insert into departments table the below information
Dno Dname
1001 MARKETING
2002 SALES
3003 EXECUTIVE
4004 IT
5005 PRODUCTION
11. Change the salary of all employees who belong to department number 1001 to 40000
12. Change the department number of ARUL to 2002
13. Remove the information of those employees who are earning 27000
14. Empty the table departments
15. Remove the table Departments from the database
16. Remove the table Emp from the database
17. Clear the recyclebin
18. Show the structure of the SALGRADE table.
19. Select all data from the DEPARTMENT table.
20. Show the structure of the EMPLOYEE table.
21. Write a query to display the last name,job code,hire date, and employee number for
each employee, with employee numbers appearing first. Provide an alias name
STARTDATE for the HIRE DATE column.
22. Write a query to display unique job codes from the EMPLOYEE table.
23. Write a query to display the last name concatenated with the job code, separated by a
comma and space
24. Create a query to display the last name and salary of employees earning more than
12,000.
25. Write a query to display the last name and department number for employee number
176.
26. Write a query to display the last name and salary of employees whose salary is not in
the range of 5,000 and 12,000.
27. Write a query to display the last name, job code and start date of employees hired
between February 20,1998 and May 1,1998. Order the query in the ascending order by
start date.
28. Write a query to display the last name and department number of all employees in
department number 20 and 50 in the alphabetical order by last name.
29. Write a query to display the last name and salary of employees who earn between
5,000 and 12,000 and are in the department 20 or 50. Label the columns as Employee
and Monthly Salary.
30. Write a query to display the last name and hire date of all employees who was hired in
1994.
31. Write a query to display the last name, salary and commission for all employees who
earn commission. Sort data in descending order of salary and commission.
32. Write a query to display the last names of all employees where the third letter of the
last name is an 'A'.
33. Write a query to display the last name of all employees who have an 'A' and 'E' in
their last name.
34. Write a query to display the last name,job and salary whose job is sales representative
or stock clerk and whose salary is not equal to 2500,3500,7000.
35. Write a query to display the current date
36. For each employee, display the employee number, last name and salary and the salary
increased by 15% ,rename it as New Salary
37. For the above query add a column called Increase which should contain the difference
between the old and new salaries.
38. Write a query that produces the following for each employee:
39. <employee last name> earns <salary> monthly but wants <3 times salary>. Label the
column as Dream Salaries.
40. Create a query to display the last name and salary for all employees. Format the salary
to be 15 character long, left-padded with $. label the column Salary.
41. Display each employee's last name,hire date, and salary review date, which is the first
Monday after six months of service. Label the column REVIEW. Format the dates to
appear in the format similar to “Monday, the Thirty-First of July, 2000”.
42. Display the last name, hire date, and day of the week on which the employee started.
Label the column DAY. Order the results by the day of the week.
43. Create a query that display's the employee's last names and indicates the amounts of
their annual salaries. Sort the data in the descending order of salary. Label the column
EMPLOYEE_AND_THEIR_SALARIES.

More Related Content

What's hot

SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3Mohd Tousif
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaMohammad Imam Hossain
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answersvijaybusu
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and OperatorsMohan Kumar.R
 
Writing Basic SQL SELECT Statements
Writing Basic SQL SELECT StatementsWriting Basic SQL SELECT Statements
Writing Basic SQL SELECT StatementsSalman Memon
 
Les07 (using the set operators)
Les07 (using the set operators)Les07 (using the set operators)
Les07 (using the set operators)Achmad Solichin
 
Basic Sql Handouts
Basic Sql HandoutsBasic Sql Handouts
Basic Sql Handoutsjhe04
 
A must Sql notes for beginners
A must Sql notes for beginnersA must Sql notes for beginners
A must Sql notes for beginnersRam Sagar Mourya
 
Aggregating Data Using Group Functions
Aggregating Data Using Group FunctionsAggregating Data Using Group Functions
Aggregating Data Using Group FunctionsSalman Memon
 
Plsql task answers
Plsql task answersPlsql task answers
Plsql task answersNawaz Sk
 
Top 40 sql queries for testers
Top 40 sql queries for testersTop 40 sql queries for testers
Top 40 sql queries for testerstlvd
 
DBMS 6 | MySQL Practice List - Rank Related Queries
DBMS 6 | MySQL Practice List - Rank Related QueriesDBMS 6 | MySQL Practice List - Rank Related Queries
DBMS 6 | MySQL Practice List - Rank Related QueriesMohammad Imam Hossain
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functionsfarwa waqar
 

What's hot (20)

All questions
All questionsAll questions
All questions
 
Q on subquery
Q on subqueryQ on subquery
Q on subquery
 
SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3
 
SQL BASIC QUERIES SOLUTION ~hmftj
SQL BASIC QUERIES SOLUTION ~hmftjSQL BASIC QUERIES SOLUTION ~hmftj
SQL BASIC QUERIES SOLUTION ~hmftj
 
Sql queires
Sql queiresSql queires
Sql queires
 
1 q on operators
1 q on operators1 q on operators
1 q on operators
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR Schema
 
Sql query [select, sub] 4
Sql query [select, sub] 4Sql query [select, sub] 4
Sql query [select, sub] 4
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answers
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
 
Writing Basic SQL SELECT Statements
Writing Basic SQL SELECT StatementsWriting Basic SQL SELECT Statements
Writing Basic SQL SELECT Statements
 
Les07 (using the set operators)
Les07 (using the set operators)Les07 (using the set operators)
Les07 (using the set operators)
 
Basic Sql Handouts
Basic Sql HandoutsBasic Sql Handouts
Basic Sql Handouts
 
A must Sql notes for beginners
A must Sql notes for beginnersA must Sql notes for beginners
A must Sql notes for beginners
 
Aggregating Data Using Group Functions
Aggregating Data Using Group FunctionsAggregating Data Using Group Functions
Aggregating Data Using Group Functions
 
Plsql task answers
Plsql task answersPlsql task answers
Plsql task answers
 
SQL commands
SQL commandsSQL commands
SQL commands
 
Top 40 sql queries for testers
Top 40 sql queries for testersTop 40 sql queries for testers
Top 40 sql queries for testers
 
DBMS 6 | MySQL Practice List - Rank Related Queries
DBMS 6 | MySQL Practice List - Rank Related QueriesDBMS 6 | MySQL Practice List - Rank Related Queries
DBMS 6 | MySQL Practice List - Rank Related Queries
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 

Similar to SQL practice questions set

Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Mohd Tousif
 
SQL Practice Question set
SQL Practice Question set SQL Practice Question set
SQL Practice Question set Mohd Tousif
 
Sql task answers
Sql task answersSql task answers
Sql task answersNawaz Sk
 
12th information practices mysql practice questions
12th information practices mysql practice questions12th information practices mysql practice questions
12th information practices mysql practice questionsHarish Gyanani
 
Nikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd YearNikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd Yeardezyneecole
 
Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015dezyneecole
 
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole CollegeDivyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole Collegedezyneecole
 
Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015dezyneecole
 
Pooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer ApplicationPooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer Applicationdezyneecole
 
Apurv Gupta, BCA ,Final year , Dezyne E'cole College
 Apurv Gupta, BCA ,Final year , Dezyne E'cole College Apurv Gupta, BCA ,Final year , Dezyne E'cole College
Apurv Gupta, BCA ,Final year , Dezyne E'cole Collegedezyneecole
 
Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015dezyneecole
 

Similar to SQL practice questions set (20)

Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1
 
SQL Practice Question set
SQL Practice Question set SQL Practice Question set
SQL Practice Question set
 
Sql task answers
Sql task answersSql task answers
Sql task answers
 
12th information practices mysql practice questions
12th information practices mysql practice questions12th information practices mysql practice questions
12th information practices mysql practice questions
 
Case study
Case studyCase study
Case study
 
Vijay Kumar
Vijay KumarVijay Kumar
Vijay Kumar
 
Sql lab experiments
Sql lab experimentsSql lab experiments
Sql lab experiments
 
Nikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd YearNikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd Year
 
Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015
 
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole CollegeDivyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
 
Pooja Jain
Pooja JainPooja Jain
Pooja Jain
 
Sql assignment 4
Sql assignment 4Sql assignment 4
Sql assignment 4
 
sql qn.docx
sql qn.docxsql qn.docx
sql qn.docx
 
Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015
 
Sql wksht-5
Sql wksht-5Sql wksht-5
Sql wksht-5
 
Dump Answers
Dump AnswersDump Answers
Dump Answers
 
Ravi querys 425
Ravi querys  425Ravi querys  425
Ravi querys 425
 
Pooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer ApplicationPooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer Application
 
Apurv Gupta, BCA ,Final year , Dezyne E'cole College
 Apurv Gupta, BCA ,Final year , Dezyne E'cole College Apurv Gupta, BCA ,Final year , Dezyne E'cole College
Apurv Gupta, BCA ,Final year , Dezyne E'cole College
 
Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015
 

More from Mohd Tousif

Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statementsMohd Tousif
 
Introduction to Databases
Introduction to DatabasesIntroduction to Databases
Introduction to DatabasesMohd Tousif
 
Entity Relationship Model - An Example
Entity Relationship Model - An ExampleEntity Relationship Model - An Example
Entity Relationship Model - An ExampleMohd Tousif
 
Entity Relationship (ER) Model Questions
Entity Relationship (ER) Model QuestionsEntity Relationship (ER) Model Questions
Entity Relationship (ER) Model QuestionsMohd Tousif
 
Entity Relationship (ER) Model
Entity Relationship (ER) ModelEntity Relationship (ER) Model
Entity Relationship (ER) ModelMohd Tousif
 
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL) Mohd Tousif
 
Data Warehouse Concepts and Architecture
Data Warehouse Concepts and ArchitectureData Warehouse Concepts and Architecture
Data Warehouse Concepts and ArchitectureMohd Tousif
 
SQL practice questions for beginners
SQL practice questions for beginnersSQL practice questions for beginners
SQL practice questions for beginnersMohd Tousif
 
Oracle sql tutorial
Oracle sql tutorialOracle sql tutorial
Oracle sql tutorialMohd Tousif
 
Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Mohd Tousif
 
System components of windows xp
System components of windows xpSystem components of windows xp
System components of windows xpMohd Tousif
 
Inter process communication
Inter process communicationInter process communication
Inter process communicationMohd Tousif
 
Producer consumer
Producer consumerProducer consumer
Producer consumerMohd Tousif
 

More from Mohd Tousif (19)

Sql commands
Sql commandsSql commands
Sql commands
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statements
 
Introduction to Databases
Introduction to DatabasesIntroduction to Databases
Introduction to Databases
 
Entity Relationship Model - An Example
Entity Relationship Model - An ExampleEntity Relationship Model - An Example
Entity Relationship Model - An Example
 
Entity Relationship (ER) Model Questions
Entity Relationship (ER) Model QuestionsEntity Relationship (ER) Model Questions
Entity Relationship (ER) Model Questions
 
Entity Relationship (ER) Model
Entity Relationship (ER) ModelEntity Relationship (ER) Model
Entity Relationship (ER) Model
 
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL)
 
Data Warehouse Concepts and Architecture
Data Warehouse Concepts and ArchitectureData Warehouse Concepts and Architecture
Data Warehouse Concepts and Architecture
 
SQL practice questions for beginners
SQL practice questions for beginnersSQL practice questions for beginners
SQL practice questions for beginners
 
Oracle sql tutorial
Oracle sql tutorialOracle sql tutorial
Oracle sql tutorial
 
Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)
 
Sql commands
Sql commandsSql commands
Sql commands
 
Virtual box
Virtual boxVirtual box
Virtual box
 
Deadlock
DeadlockDeadlock
Deadlock
 
Algorithm o.s.
Algorithm o.s.Algorithm o.s.
Algorithm o.s.
 
System components of windows xp
System components of windows xpSystem components of windows xp
System components of windows xp
 
Ipc
IpcIpc
Ipc
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Producer consumer
Producer consumerProducer consumer
Producer consumer
 

Recently uploaded

Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceSapana Sha
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改yuu sss
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...ThinkInnovation
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAbdelrhman abooda
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 

Recently uploaded (20)

Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts Service
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
专业一比一美国俄亥俄大学毕业证成绩单pdf电子版制作修改
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 

SQL practice questions set

  • 1. Practice Set – 2 (SQL) Mohd Tousif 1. Prepare the below tables in database in the given format (Employee) A) Employee Column Name Data Type Size Employee_Id Number 6 First_Name Varchar2 20 Last_Name Varchar2 25 Email_Id Varchar2 14 Phone_Number Varchar2 20 Hire_Date Date Job_Id Varchar2 10 Salary Number 8,2 Commission_Percent Number 2,2 Manager_Id Number 6 Department_Id Number 4 Insert into the above table below values Emplo yee_Id First_N ame Last_N ame Email_ Id Phone_ Numbe r Hire_D ate Job_Id Salary Commi ssion_P ercent Manag er_Id Depart ment_I d 100 Sailaja Balgeri sb 515.123 .1421 06/17/8 7 AD_PR ES 24000 0.9 90 101 Neelim a Atmuri na 515.124 .1431 09/21/8 9 AD_VP 17000 0.9 100 90 102 Nitin Agarw al nag 514.123 .1543 01/13/9 3 AD_VP 17000 0.9 100 90 103 Prasan th Rathor e pr 515.124 .1421 01/03/9 0 IT_PR OG 9000 0.6 102 60 104 Santos h Devun uri sd 514.152 .1278 21/05/9 1 IT_PR OG 6000 0.6 103 60 107 Ravi ra 512.123 .1234 07/02/9 9 IT_PR OG 4200 0.6 103 60 124 Vijay vi 513.235 16/11/9 ST_M 5800 0.5 100 50
  • 2. .1246 9 AN 141 Naveen nav 512.124 .1234 17/10/9 5 ST_CL ERK 3500 0.5 124 50 142 Amrith a am 512.124 .2345 29/01/9 7 ST_CL ERK 3100 0.5 124 50 143 Srikant h G sg 512.123 .1245 15/03/9 8 ST_CL ERK 2600 0.5 124 50 144 Amol Singh as 09/07/9 8 ST_CL ERK 2500 0.5 124 50 B) Department Column Name Data Type Size Department_Id Number 4 Department_Name Varchar2 30 Manager_Id Number 6 Location_Id Number 4 Insert into the above table below values Department_Id Department_Name Manager_Id Location_Id 10 Administration 200 1700 20 Marketing 201 1800 50 Shipping 124 1500 60 IT 103 1400 80 Sales 149 2500 90 Executive 100 1700 110 Accounting 205 1700 190 Contracting 1700 C) Salgrade Column Name Data Type Size Grade_Level Varcahr2 3 Lowest_Sal Number 6 Highest_Sal Number 6 Insert into the above table below values Grade_Level Lowest_Sal Highest_Sal A 1000 2999 B 3000 5999 C 6000 9999 D 10000 14999
  • 3. E 15000 24999 F 25000 40000 2. Create an Emp table with the following criteria: Eno number(6) Ename varchar2(30) Sal number(8,2) 3. Add a column deptno with the datatype number of size 4 4. Change the name of the column Sal to Salary 5. Change the size of a column Ename to 40 character long 6. Create a Dept table with the following criteria: Dno number(6) Dname varchar2(40) loc_id number(4) 7. remove a column loc_id from dept table 8. change the name of the Dept to Departments 9. insert into emp table the below values Eno Ename Salary Deptno 1 ANIL 20000 1001 2 ATUL 25000 2002 3 ARUL 30000 1001 4 AMIT 27000 3003 5 ANUP 35000 2002 6 ANIR 30000 1001 10. Insert into departments table the below information Dno Dname 1001 MARKETING 2002 SALES 3003 EXECUTIVE 4004 IT 5005 PRODUCTION 11. Change the salary of all employees who belong to department number 1001 to 40000 12. Change the department number of ARUL to 2002 13. Remove the information of those employees who are earning 27000 14. Empty the table departments 15. Remove the table Departments from the database 16. Remove the table Emp from the database 17. Clear the recyclebin 18. Show the structure of the SALGRADE table. 19. Select all data from the DEPARTMENT table. 20. Show the structure of the EMPLOYEE table. 21. Write a query to display the last name,job code,hire date, and employee number for each employee, with employee numbers appearing first. Provide an alias name
  • 4. STARTDATE for the HIRE DATE column. 22. Write a query to display unique job codes from the EMPLOYEE table. 23. Write a query to display the last name concatenated with the job code, separated by a comma and space 24. Create a query to display the last name and salary of employees earning more than 12,000. 25. Write a query to display the last name and department number for employee number 176. 26. Write a query to display the last name and salary of employees whose salary is not in the range of 5,000 and 12,000. 27. Write a query to display the last name, job code and start date of employees hired between February 20,1998 and May 1,1998. Order the query in the ascending order by start date. 28. Write a query to display the last name and department number of all employees in department number 20 and 50 in the alphabetical order by last name. 29. Write a query to display the last name and salary of employees who earn between 5,000 and 12,000 and are in the department 20 or 50. Label the columns as Employee and Monthly Salary. 30. Write a query to display the last name and hire date of all employees who was hired in 1994. 31. Write a query to display the last name, salary and commission for all employees who earn commission. Sort data in descending order of salary and commission. 32. Write a query to display the last names of all employees where the third letter of the last name is an 'A'. 33. Write a query to display the last name of all employees who have an 'A' and 'E' in their last name. 34. Write a query to display the last name,job and salary whose job is sales representative or stock clerk and whose salary is not equal to 2500,3500,7000. 35. Write a query to display the current date 36. For each employee, display the employee number, last name and salary and the salary increased by 15% ,rename it as New Salary 37. For the above query add a column called Increase which should contain the difference between the old and new salaries. 38. Write a query that produces the following for each employee: 39. <employee last name> earns <salary> monthly but wants <3 times salary>. Label the column as Dream Salaries. 40. Create a query to display the last name and salary for all employees. Format the salary to be 15 character long, left-padded with $. label the column Salary. 41. Display each employee's last name,hire date, and salary review date, which is the first Monday after six months of service. Label the column REVIEW. Format the dates to appear in the format similar to “Monday, the Thirty-First of July, 2000”. 42. Display the last name, hire date, and day of the week on which the employee started. Label the column DAY. Order the results by the day of the week. 43. Create a query that display's the employee's last names and indicates the amounts of their annual salaries. Sort the data in the descending order of salary. Label the column EMPLOYEE_AND_THEIR_SALARIES.