Can someone PLEASE help me with the three problems below:
1. Write a simple subquery and display the course_no, description, cost for the course with the lowest course cost.
2. Write a correlated subquery and display the student_id, last_name,first_name of students enrolled in three or more classes.
a. Use the EXISTS or NOT EXISTs operator Hint: The HAVING clause can be used as well
b. Use the IN operator in a subquery
3. Write a correlated subquery and display the instructor_id, first_name, last_name, zip columns from the instructor table where the zip code is NULL.
a. Use the NOT EXISTs operator
b. Use the NOT IN operator
SQL Problems
Page 1 of 19 Replies - 1658 Views - Last Post: 05 August 2006 - 06:11 PM
Replies To: SQL Problems
#2
Re: SQL Problems
Posted 05 August 2006 - 10:57 AM
can you show us what you've done so far?
#3
Re: SQL Problems
Posted 05 August 2006 - 11:38 AM
Nova Dragoon, on 5 Aug, 2006 - 10:57 AM, said:
can you show us what you've done so far?
For problem #1 I have:
SELECT course_no, description
FROM COURSE
WHERE cost < ANY
(SELECT cost
FROM COURSE);
For problem #2 and #3 I don't have anything. I am not sure how to execute these two problems. I am a beginner using SQL.
#4
Re: SQL Problems
Posted 05 August 2006 - 11:40 AM
Can you post the table schema as well? (A list of the fields in the database table, and their field types).
#5
Re: SQL Problems
Posted 05 August 2006 - 12:23 PM
Amadeus, on 5 Aug, 2006 - 11:40 AM, said:
Can you post the table schema as well? (A list of the fields in the database table, and their field types).
I think the attached file is the table schema.
Attached File(s)
-
schemaDiagramV04.zip (49.08K)
Number of downloads: 86
#8
Re: SQL Problems
Posted 05 August 2006 - 03:53 PM
Did you look at the link I gave you, it gives examples?
But would look like this:
But would look like this:
SELECT course_no, description, cost FROM COURSE WHERE cost = (SELECT MIN(cost) FROM COURSE);
This post has been edited by jayman9: 05 August 2006 - 03:54 PM
#9
Re: SQL Problems
Posted 05 August 2006 - 06:06 PM
#10
Re: SQL Problems
Posted 05 August 2006 - 06:11 PM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|