SlideShare une entreprise Scribd logo
1  sur  1
Write a SELECT statement that returns the LastName and JobTitle of each employee with a
jobtitle other than ‘Engineer’ that has a SalaryWage greater than that of the lowest paid
employee with a JobTitle of engineer.
This question is from Murachs SQL Server 2012 for developers (chapter 6 How to code
subqueries).
The only answer posted on this site previously included results that were < that of the lowest
paid engineer.
Solution
Hi, You have not mentioned Tables Name and thier schema.
So, i assumed here.
SELECT LastName, JobTitle
FROM Employe as e, Job as j
where (j.JobTitle not like 'Engineer'
or j.SalaryWage < (select min(j1.SalaryWage)
From Job j1))
and e.id = j.id

Contenu connexe

Plus de drosa1

Write a program to throw the InputMismatchException-Solutionimport jav.docx
Write a program to throw the InputMismatchException-Solutionimport jav.docxWrite a program to throw the InputMismatchException-Solutionimport jav.docx
Write a program to throw the InputMismatchException-Solutionimport jav.docxdrosa1
 
You are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docxYou are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docxdrosa1
 
You are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docxYou are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docxdrosa1
 
You are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docxYou are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docxdrosa1
 
You are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docxYou are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docxdrosa1
 
You and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docxYou and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docxdrosa1
 
Write a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docxWrite a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docxdrosa1
 
Write a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docxWrite a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docxdrosa1
 
writing formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docxwriting formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docxdrosa1
 
Write the expression as the logarithm of a single quantity- 1.docx
Write the expression as the logarithm of a single quantity-      1.docxWrite the expression as the logarithm of a single quantity-      1.docx
Write the expression as the logarithm of a single quantity- 1.docxdrosa1
 
Write and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docxWrite and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docxdrosa1
 
write a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docxwrite a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docxdrosa1
 
Write a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docxWrite a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docxdrosa1
 
Write the equation in the slope-intercept form- Solution.docx
Write the equation in the slope-intercept form-       Solution.docxWrite the equation in the slope-intercept form-       Solution.docx
Write the equation in the slope-intercept form- Solution.docxdrosa1
 
Write the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docxWrite the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docxdrosa1
 
Write an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docxWrite an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docxdrosa1
 
write a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docxwrite a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docxdrosa1
 
Write a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docxWrite a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docxdrosa1
 
Write a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docxWrite a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docxdrosa1
 

Plus de drosa1 (19)

Write a program to throw the InputMismatchException-Solutionimport jav.docx
Write a program to throw the InputMismatchException-Solutionimport jav.docxWrite a program to throw the InputMismatchException-Solutionimport jav.docx
Write a program to throw the InputMismatchException-Solutionimport jav.docx
 
You are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docxYou are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docx
 
You are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docxYou are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docx
 
You are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docxYou are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docx
 
You are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docxYou are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docx
 
You and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docxYou and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docx
 
Write a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docxWrite a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docx
 
Write a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docxWrite a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docx
 
writing formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docxwriting formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docx
 
Write the expression as the logarithm of a single quantity- 1.docx
Write the expression as the logarithm of a single quantity-      1.docxWrite the expression as the logarithm of a single quantity-      1.docx
Write the expression as the logarithm of a single quantity- 1.docx
 
Write and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docxWrite and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docx
 
write a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docxwrite a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docx
 
Write a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docxWrite a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docx
 
Write the equation in the slope-intercept form- Solution.docx
Write the equation in the slope-intercept form-       Solution.docxWrite the equation in the slope-intercept form-       Solution.docx
Write the equation in the slope-intercept form- Solution.docx
 
Write the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docxWrite the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docx
 
Write an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docxWrite an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docx
 
write a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docxwrite a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docx
 
Write a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docxWrite a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docx
 
Write a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docxWrite a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docx
 

Dernier

Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 

Dernier (20)

Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 

Write a SELECT statement that returns the LastName and JobTitle of eac.docx

  • 1. Write a SELECT statement that returns the LastName and JobTitle of each employee with a jobtitle other than ‘Engineer’ that has a SalaryWage greater than that of the lowest paid employee with a JobTitle of engineer. This question is from Murachs SQL Server 2012 for developers (chapter 6 How to code subqueries). The only answer posted on this site previously included results that were < that of the lowest paid engineer. Solution Hi, You have not mentioned Tables Name and thier schema. So, i assumed here. SELECT LastName, JobTitle FROM Employe as e, Job as j where (j.JobTitle not like 'Engineer' or j.SalaryWage < (select min(j1.SalaryWage) From Job j1)) and e.id = j.id