Question: rider_student Column Data Type Description student_id integer the primary key first_name varchar(25) student first name last_name varchar(25) student lats name major_id integer the ID of
rider_student
| Column | Data Type | Description |
| student_id | integer | the primary key |
| first_name | varchar(25) | student first name |
| last_name | varchar(25) | student lats name |
| major_id | integer | the ID of the student's major; a foreign key for the major_id in the rider_major table |
rider_major
| Column | Data Type | Description |
| major_id | integer | the primary key |
| major_name | varchar(50) | student first name |
| major_description | varchar(100) | student last name |
| graduate_only | varchar | indicates whether or not this is a graduate only major (true/false) |
1. Write a SQL statement which joins the rider_student table with the rider_major table and lists the rider student name and the name of the major (major_name) and the description of the major for which they are currently assigned. (You may use the SQL 'join' subclause, or simply express the join as part of the 'where' clause by indicating that you only want records where the primary key of the child table, rider_major, equals the corresponding foreign key of the joined table, rider_student.)
2. Write a SQL statement which joins the rider_student table with the rider_major table and lists the rider student name and the name of the major (major_name) and the description of the major for which they are currently assigned. The SQL statement should only select records for students who are majoring in Accounting.
3. Write a SQL statement which joins the rider_student table with the rider_major table and lists the rider student name and the name of the major (major_name) and the description of the major for which they are currently assigned. The SQL statement should only select records for majors for graduates (graduate_only = 'TRUE').
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
