Module 5 - Exercise SQL - ZunigaFM181
Module 5 - Exercise SQL - ZunigaFM181
Module 5 - Exercise SQL - ZunigaFM181
Read the problem carefully and write the answer on the spaces
provided for below.
#1:
Based on the employees table below, select all fields from
the employees table whose salary is less than or equal to $52,500 (no
sorting is required):
CREATE TABLE employees
( employee_number int NOT NULL,
last_name char(50) NOT NULL,
first_name char(50) NOT NULL,
salary int,
dept_id int,
CONSTRAINT employees_pk PRIMARY KEY (employee_number)
);
Answer:
______________________________________________
#2:
Based on the suppliers table below, select the unique city values that
reside in the state of California and order the results in descending
order by city:
CREATE TABLE suppliers
( supplier_id int NOT NULL,
supplier_name char(50) NOT NULL,
city char(50),
state char(25),
CONSTRAINT suppliers_pk PRIMARY KEY (supplier_id)
);
Answer:
city
Westlake Village
Redwood City
Mountain View
______________________________________________
#3:
Write a query to display the department number, department name,
department phone number, employee number, and last name of each
department manager. Sort the output by department name (Figure
P7.42).
The result is as follows:
Answer:
#4:
Based on the employees table, delete all employee records
whose salary is greater than $60,000:
Answer:
______________________________________________