Using the sql tables write a query to display all the courses for a particular s
ID: 3731465 • Letter: U
Question
Using the sql tables write a query to display all the courses for a particular student and a query to display all students with more than 6 credits. If additional data is needed please explain.
Id_number;"first_name";"last_name";"middle_intial";"major_id"
2907;"Jacob";"Smith";"R";"MAT"
4019;"Patterson";"Jane";"K";"PHI"
5145;"Norris";"Neeld";"B";"EGL"
6132;"Xavier";"Morrison";"Q";"MUS"
7810;"Brown";"Richard";"E";"EGL"
Id_number;"major_id"
2907;"MAT"
4019;"PHI"
5145;"EGL"
6132;"MUS"
7810;"EGL"
Id_number;"course_number";"course_comp_date"
2907;"MAT0011";"2012-08-01"
4019;"PHI0010";"2012-04-30"
5145;"SOC0102";"2012-08-01"
6132;"MUS0002";"2012-08-01"
7810;"EGL0010";"2012-04-30"
course_number;"course_name";"credits"
MAT0011;"Discrete Math";"3"
PHI0010;"Intro to Philosophy";"3"
SOC0102;"Ascent of Man";"3"
MUS0002;"Origin of Jazz";"3"
EGL0010;"English Classics I";"3"
Explanation / Answer
SQL query to display all the courses for a particular student :
select course_table.id, courses_table.course_name
from courses_table, course_table
where courses_table.course_number = course_table.course_number;
SQL query to display all students with more than 6 credits:
select course_table.id
from courses_table, course_table
where courses_table.credits >= 6;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.