SlideShare una empresa de Scribd logo
1 de 4
1. Prepare the below tables in database in the given format (H21_Employee_Empid)
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
.1246
16/11/9
9
ST_M
AN
5800 0.5 100 50
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.

Más contenido relacionado

La actualidad más candente (20)

Sql queires
Sql queiresSql queires
Sql queires
 
SQL BASIC QUERIES SOLUTION ~hmftj
SQL BASIC QUERIES SOLUTION ~hmftjSQL BASIC QUERIES SOLUTION ~hmftj
SQL BASIC QUERIES SOLUTION ~hmftj
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentation
 
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 Commands
Sql CommandsSql Commands
Sql Commands
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answers
 
Mysql joins
Mysql joinsMysql joins
Mysql joins
 
SQL commands
SQL commandsSQL commands
SQL commands
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
Aggregate function
Aggregate functionAggregate function
Aggregate function
 
Basic Sql Handouts
Basic Sql HandoutsBasic Sql Handouts
Basic Sql Handouts
 
Sql task
Sql taskSql task
Sql task
 
Top 40 sql queries for testers
Top 40 sql queries for testersTop 40 sql queries for testers
Top 40 sql queries for testers
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
 
Sql
SqlSql
Sql
 
Sql commands
Sql commandsSql commands
Sql commands
 
Plsql task
Plsql taskPlsql task
Plsql task
 

Similar a SQL practice questions - set 3

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
 
Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015dezyneecole
 
Nikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd YearNikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd Yeardezyneecole
 
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
 
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
 
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
 
Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015dezyneecole
 

Similar a SQL practice questions - set 3 (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
 
Case study
Case studyCase study
Case study
 
12th information practices mysql practice questions
12th information practices mysql practice questions12th information practices mysql practice questions
12th information practices mysql practice questions
 
Vijay Kumar
Vijay KumarVijay Kumar
Vijay Kumar
 
Sql lab experiments
Sql lab experimentsSql lab experiments
Sql lab experiments
 
Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015Priyanka Bhatia.BCA Final year 2015
Priyanka Bhatia.BCA Final year 2015
 
Nikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd YearNikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd Year
 
Pooja Jain
Pooja JainPooja Jain
Pooja Jain
 
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
 
Sql assignment 4
Sql assignment 4Sql assignment 4
Sql assignment 4
 
Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015
 
sql qn.docx
sql qn.docxsql qn.docx
sql qn.docx
 
Dump Answers
Dump AnswersDump Answers
Dump Answers
 
Ravi querys 425
Ravi querys  425Ravi querys  425
Ravi querys 425
 
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
 
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
 
ADV DB SCREENSHOTS
ADV DB SCREENSHOTSADV DB SCREENSHOTS
ADV DB SCREENSHOTS
 
Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015Vishwajeet Sikhwal ,BCA,Final Year 2015
Vishwajeet Sikhwal ,BCA,Final Year 2015
 

Más de 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
 

Más de 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
 

Último

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Último (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

SQL practice questions - set 3

  • 1. 1. Prepare the below tables in database in the given format (H21_Employee_Empid) 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 .1246 16/11/9 9 ST_M AN 5800 0.5 100 50 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
  • 2. 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
  • 3. 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
  • 4. 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.