Textbook Notes (270,000)
CA (160,000)
Ryerson (10,000)
ITM (800)
Chapter

week2


Department
Information Technology Management
Course Code
ITM 500
Professor
Raymond Moss

This preview shows half of the first page. to view the full 3 pages of the document.
WEEK 2
--Example 1. List all details for all students
--(i.e. Write a query that will display the data in
--all the columns for all the rows in the Student table.)
SELECT * FROM Student;
--Example 2. List the SSN, Name and Major for all students
--(i.e. Write a query that will display the data in
--StdSSN, StdName and StdMajor columns for all the rows in
--the Student table.)
SELECT StdSSN, StdName ,StdMajor FROM Student;
--Example 3. List all the details for student 234567890
--(i.e. Write a query that will display the data in
--all the columns for the student with the SSN 234567890.)
SELECT * FROM Student
WHERE StdSSN = '234567890'
--Example 4. List all the details for student James
--(i.e. Write a query that will display the data in
--all the columns for the student with the name James.)
SELECT * FROM Student WHERE StdName = 'James'
--Example 5. List the SSN and Name for all students in the
--Finance major
SELECT StdSSN, StdName FROM Student
WHERE StdMajor = 'FIN'
--Example 5 Debugging
SELECT StdSSN, StdName, StdMajor FROM Student
WHERE StdMajor = 'FIN'
--Example 6. List the SSN, Name and Major for all students
--with a GPA over 3
SELECT StdSSN, StdName, StdMajor FROM Student
WHERE StdGPA > 3
--Example 6a Debugging
SELECT StdSSN, StdName, StdMajor, StdGPA FROM Student
WHERE StdGPA > 3
--Example 7. List the SSN, Name, GPA and Major for all
-- students with a GPA of at least 3
SELECT StdSSN, StdName, StdMajor, StdGPA FROM Student
WHERE StdGPA >= 3
--Example 8. List all details for the students not in
--the Finance major
You're Reading a Preview

Unlock to view full version