Write a SQL query that retrieves the names and email addresses of all students who are enrolled in at least one course in the "Computer Science" department and have a graduation year of 2022 or later. Include the course name and instructor name for each enrollment in the output. Schemas of the tables are below. "students" table: student_id: unique identifier for the student name: name of the student email: email address of the student major: field of study for the student graduation_year: expected year of graduation for the student "courses" table: course_id: unique identifier for the course course_name: name of the course instructor_name: name of the instructor teaching the course. department: department offering the course. course_description: description of the course "enrollments" table: enrollment_id: unique identifier for the enrollment student_id: identifier for the student enrolled in the course. course_id: identifier for the course the student is enrolled in enrollment_date: date the student enrolled in the course grade: grade the student received in the course (Please type answer no write by hend)
Write a SQL query that retrieves the names and email addresses of all students who are enrolled in at least one course in the "Computer Science" department and have a graduation year of 2022 or later. Include the course name and instructor name for each enrollment in the output. Schemas of the tables are below.
"students" table:
student_id: unique identifier for the student
name: name of the student
email: email address of the student
major: field of study for the student
graduation_year: expected year of graduation for the student
"courses" table:
course_id: unique identifier for the course
course_name: name of the course
instructor_name: name of the instructor teaching the course.
department: department offering the course.
course_description: description of the course
"enrollments" table:
enrollment_id: unique identifier for the enrollment
student_id: identifier for the student enrolled in the course.
course_id: identifier for the course the student is enrolled in
enrollment_date: date the student enrolled in the course
grade: grade the student received in the course
Step by step
Solved in 3 steps with 7 images