This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 1)List the names of all courses, their departments, and the number of credits for each? SELECT course_name, department, num_credits FROM courses; 2) List the names, hometowns, and home states of all students. SELECT student_name, city, state FROM students 3) List all values in the COURSES table. SELECT *FROM courses 4) List all values in the TEACHERS table. SELECT * FROM teachers 5) List the course name, department, and number of credits for all three-credit courses. SELECT course_name, department, num_credits FROM courses WHERE num_credits=3 6) List the names and salaries of teachers earning more than $30,000.00. SELECT teacher_name, salary FROM teachers WHERE salary > 30000 7) Who are all the male students? SELECT student_name FROM studentsWHERE sex= “m” 8) List the names and addresses of all female students from Chicago. SELECT student_name, address, city, state, zip FROM students WHERE sex = “f” AND city=”Chicago” 9) Which math courses have 3 or more credits? SELECT course_name, department, num_credits FROM courses WHERE department= “Math” AND num_credits >=3 10) List the name, sex, city, and state for all students who are either from Connecticut, or from a city called Erie. SELECT student_name, sex, city, state FROM studentsWHERE state= “CT” OR City= “Erie” 11) List the names, cities, states, and zip codes of all students whose zip codes are between 20000 and 29999 or who live in a city called Erie SELECT student_name, city, state, zip FROM students WHERE (zip >= “20000” AND zip <=“29999”) OR city= “Erie” 12) List the names and states of all students who are not from Illinois. SELECT student_name, state FROM studentsWHERE NOT (state= “IL”) 13) List the names and salaries of teachers who make between $30,000 and $35,000 a year SELECT teacher_name, salary FROM teachers WHERE salary BETWEEN 30000 AND 35000 14) List the names, cities, states, and zip codes of students whose zip codes are not between 20000 and 29999 SELECT student_name, city, state, zip FROM students WHERE zip NOT BETWEEN “20000” AND “29999” 15) List the name and sex of every student whose name begins with “Jo” SELECT student_name, sex FROM students WHERE student_name LIKE “Jo*” 16) List the name and home states of all students from states that begin with the letter ‘C’...
View Full Document
This note was uploaded on 03/09/2012 for the course MIS 101 taught by Professor Mirchandani during the Fall '11 term at Rutgers.
- Fall '11