lab2

docx

School

Governors State University *

*We aren’t endorsed by this school

Course

8820

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

1

Uploaded by KidEmu3045

Report
LAB 2 Name : Sheik Kurshid 1) Write a SELECT statement to list the first and last names of all students. SELECT first_name, last_name from STUDENT; 2) Why are the result sets of each of the following SQL statements the same? SELECT letter_grade FROM grade_conversion SELECT DISTINCT letter_grade FROM grade_conversion Both result sets will give the same output because the "letter_grade" column in the "grade_conversion" table does not contain any duplicate values. We use DISTINCT keyword in SQL to retrieve unique values from a column, and in this case, since there are no duplicates the result sets will be same. 3) Write a SELECT statement to list the last names of students living either in zip code 10048, 11102, or 11209. select LAST_NAME FROM STUDENT WHERE zip IN ('10048', '11102', '11209'); 4) Write a SELECT statement to list the first and last names of instructors with the letter “i” (either upper case or lower case) in their last name, living in the zip code 10025. SELECT first_name, last_name FROM instructor WHERE zip = '10025' AND (last_name LIKE '%i%' or last_name LIKE '%I%'); 5) Write a SELECT statement to list descriptions of courses with prerequisites, and cost less than 1100. SELECT description from course WHERE prerequisite IS NOT NULL AND cost < 1100; 1
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help