Assignment #1
Simple Queries
1. Write a SELECT statement to list course data sorted by course number. (30 rows)
2. Write a SELECT statement to list zipcodes and their cities in New York State sorted by
zipcode. (123 rows)
3. Write a SELECT statement to list first and last names of all instructors sorted by last name.
(10 rows)
4. Write a SELECT statement to list courses that have the course number 20 as a prerequisite.
(5 rows)
5. Write a SELECT statement to list the last and first names in last name order of students that
are currently employed by the firm Electronic Engineers and have last names starting with
“G”. (2 rows)
SELECT last_name, first_name, employer
FROM student
6. Write the same SELECT statement as #5 but include students who are Electronic Engineers
employees with the last name beginning with S or B. (Hint: Use parentheses in the WHERE
clause to isolate the OR logic). (2 rows)
7. Write a SELECT statement to list students that live either in zip code 11433, 11434, or
11435. (5 rows)
8. Write a SELECT statement to list the courses that cost $1095 or less. (3 rows)
9. Write a SELECT statement to list the first and last name of students that do not have the
salutation of “Dr.”. (267 rows)
10. Write a SELECT statement to list courses that do not have a prerequisite. (4 rows)