-- 7. Using Boolean operators (AND, OR) and comparison operators (=, >, <, >=, <=, !=), write a query to display details for employees -- That work in the Sales or Marketing departments (DEPARTMENT_IDs 20 and 80) -- AND have a salary greatee tham or equal to $5,000 and less than or equal to $10,000. -- Sort the results by salary (descending) and employees’ last names and first names.

Database Systems: Design, Implementation, & Management
12th Edition
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Carlos Coronel, Steven Morris
Chapter1: Database Systems
Section: Chapter Questions
Problem 11P: Using your schools student information system, print your class schedule. The schedule probably...
icon
Related questions
icon
Concept explainers
Question

Hello,

 

Can you please assist me with this?

 

-- 7. Using Boolean operators (AND, OR) and comparison operators (=, >, <, >=, <=,
!=), write a query to display details for employees
-- That work in the Sales or Marketing departments (DEPARTMENT_IDs 20 and
80)
-- AND have a salary greatee tham or equal to $5,000 and less than or
equal to $10,000.
-- Sort the results by salary (descending) and employees’ last names and first
names.
-- 8. Rewrite the query in the previous question using the operators IN and
BETWEEN.
-- 9. Using IN, write a query to display
-- The names and job IDs of the employees
-- In the sales and marketing departments (DEPARTMENT_IDs 20 and 80).
-- Sort the results by department and the employees’ last and first names.
-- 10. Rewrite the query in the previous question to find the employees in the
other departments by adding JUST ONE WORD to that query

HOL_REGIONS
PK Region ID
HOL_JOBS
PK JOD ID
HOL_CUSTOMERS
PK Customer ID
FK Location_ID
#
To HOL_LOCATIONS
HOL_COUNTRIES
PK Country ID
FK Region ID
HOL JOB HISTORY
PK
FK
FK JOD_ID
FK Department ID
Job History ID
Employee ID
HOL_ORDERS
PK Order Number
FK Customer_ID
HOL_LOCATIONS
PK Location ID
FK Country ID
HOL EMPLOYEES
PK Employee ID
FK
Department ID
JOD ID
FK
HOL_ORDER_ITEMS
PK Order_item_ID
FK Order Number
FK ISSN
HOL_DEPARTMENTS
PK Department ID
FK Location ID
HOL_BOOKS
PK ISEN
FK Book_Category_ID
HOL_BOOK_CATEGORY
PK Book_Category_ID
Transcribed Image Text:HOL_REGIONS PK Region ID HOL_JOBS PK JOD ID HOL_CUSTOMERS PK Customer ID FK Location_ID # To HOL_LOCATIONS HOL_COUNTRIES PK Country ID FK Region ID HOL JOB HISTORY PK FK FK JOD_ID FK Department ID Job History ID Employee ID HOL_ORDERS PK Order Number FK Customer_ID HOL_LOCATIONS PK Location ID FK Country ID HOL EMPLOYEES PK Employee ID FK Department ID JOD ID FK HOL_ORDER_ITEMS PK Order_item_ID FK Order Number FK ISSN HOL_DEPARTMENTS PK Department ID FK Location ID HOL_BOOKS PK ISEN FK Book_Category_ID HOL_BOOK_CATEGORY PK Book_Category_ID
FK
FK
FK Country Code
Country Name
Region ID
PK
FK
FK
FX
FK
FK
U
FK
FK
FK
FK
Legend
Tables provided
Tables you complete
FK
Region ID
Region Name
Location ID
Street
City
State Province
Postal Code
Country 10
Manager ID
Location ID
Customer ID
First Name
Middle Name
Last Name
Email
Phone
Department ID
Department Name
Birth Date
Gender
Location ID
Order Number
Order Date
Order Total
Customer_ID
Sales Person ID
Order Item ID
Unit Price
Quantity
Order Number
FK
FK ISBN
HOL_REGIONS
INTEGER
VARCHAR2(250)
HOL_COUNTRIES
CHAR(2)
|VARCHAR2(250)
INTEGER
HOL_LOCATIONS
INTEGER
VARCHAR2(250)
VARCHAR2(250)
CHAR(3)
|VARCHAR2(30)
INTEGER
HOL DEPARTMENTS
INTEGER
VARCHAR2(250)
INTEGER
INTEGER
HOL_CUSTOMERS
INTEGER
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2 250
VARCHAR2(30)
DATE
VARCHAR2(30)
INTEGER
HOL ORDERS
INTEGER
DATE
NUMBER 18,2)
INTEGER
INTEGER
HOL_ORDER_ITEMS
INTEGER
NUMBER 12,2)
INTEGER
INTEGER
INTEGER
PK
FK
NN
U
FK
NN
NN
FK
FK
FK
FK
NN
FK
FK
FK
FK
FK
PRIMARY KEY
FOREIGN KEY
FK
NN
NOT NULL
UNIQUE
Employee ID
First Name
Middle Name
Last Name
Email
Phone
Hire Date
Current Salary
Commision Pet
Bonus
Job ID
Manager D
Department ID
Job ID
Job Title
Max Salary
Min Salary
FK
ISBN
NN Book Title
Job History ID
Employee D
Start Date
End Date
Job ID
Department ID
HOL EMPLOYEES
Book Description
Book Price
Book Reviews
User Rating
Book_Category ID
INTEGER
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2 250)
VARCHAR2(250)
VARCHAR2(30)
DATE
NUMBER 12,2)
NUMBER(2,2)
NUMBER 12,2)
INTEGER
INTEGER
INTEGER
HOL JOBS
HOL_JOB HISTORY
Book Category ID
Book_Category_Neme
INTEGER
VARCHAR2(250)
NUMBER 12,2)
NUMBER 12,2)
IDENTITY
INTEGER
DATE
DATE
INTEGER
INTEGER
HOL BOOKS
INTEGER
VARCHAR2(250)
VARCHAR2(4000)
NUMBER 12,2)
INTEGER
NUMBER (4,2)
INTEGER
HOL_BOOK_CATEGORY
INTEGER
VARCHAR2(250)
Book_Category_Description VARCHAR2(4000)
Transcribed Image Text:FK FK FK Country Code Country Name Region ID PK FK FK FX FK FK U FK FK FK FK Legend Tables provided Tables you complete FK Region ID Region Name Location ID Street City State Province Postal Code Country 10 Manager ID Location ID Customer ID First Name Middle Name Last Name Email Phone Department ID Department Name Birth Date Gender Location ID Order Number Order Date Order Total Customer_ID Sales Person ID Order Item ID Unit Price Quantity Order Number FK FK ISBN HOL_REGIONS INTEGER VARCHAR2(250) HOL_COUNTRIES CHAR(2) |VARCHAR2(250) INTEGER HOL_LOCATIONS INTEGER VARCHAR2(250) VARCHAR2(250) CHAR(3) |VARCHAR2(30) INTEGER HOL DEPARTMENTS INTEGER VARCHAR2(250) INTEGER INTEGER HOL_CUSTOMERS INTEGER VARCHAR2(250) VARCHAR2(250) VARCHAR2(250) VARCHAR2 250 VARCHAR2(30) DATE VARCHAR2(30) INTEGER HOL ORDERS INTEGER DATE NUMBER 18,2) INTEGER INTEGER HOL_ORDER_ITEMS INTEGER NUMBER 12,2) INTEGER INTEGER INTEGER PK FK NN U FK NN NN FK FK FK FK NN FK FK FK FK FK PRIMARY KEY FOREIGN KEY FK NN NOT NULL UNIQUE Employee ID First Name Middle Name Last Name Email Phone Hire Date Current Salary Commision Pet Bonus Job ID Manager D Department ID Job ID Job Title Max Salary Min Salary FK ISBN NN Book Title Job History ID Employee D Start Date End Date Job ID Department ID HOL EMPLOYEES Book Description Book Price Book Reviews User Rating Book_Category ID INTEGER VARCHAR2(250) VARCHAR2(250) VARCHAR2 250) VARCHAR2(250) VARCHAR2(30) DATE NUMBER 12,2) NUMBER(2,2) NUMBER 12,2) INTEGER INTEGER INTEGER HOL JOBS HOL_JOB HISTORY Book Category ID Book_Category_Neme INTEGER VARCHAR2(250) NUMBER 12,2) NUMBER 12,2) IDENTITY INTEGER DATE DATE INTEGER INTEGER HOL BOOKS INTEGER VARCHAR2(250) VARCHAR2(4000) NUMBER 12,2) INTEGER NUMBER (4,2) INTEGER HOL_BOOK_CATEGORY INTEGER VARCHAR2(250) Book_Category_Description VARCHAR2(4000)
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning