Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The mock_enrollments table consists of an individual enrollment record for each enrollment in Washington Middle School throughout the 2018-2019 school year. A student can have

The mock_enrollments table consists of an individual enrollment record for each enrollment in Washington Middle School throughout the 2018-2019 school year. A student can have more than one enrollment in a school year. The table consists of 5 columns: unique_id: This is a unique id that represents an individual student. It is unique to the student not to the table. In other words, a student can enroll in the school then subsequently withdraw from the school and then re-enroll later in the year. school_name: This is the name of the school for which these enrollment records pertain. grade: This is the grade level the student is enrolled in. An entry of 6 represents an enrollment in the 6th grade. start_date: (YYYY-MM-DD) This is the start of the enrollment for the student. end_date: (YYYY-MM-DD) This is the end of the enrollment for the student. If the value is empty that means the student was enrolled until the end of the school year. Dates The mock_dates table enumerates all dates and indicates if they are a school day. The table consists of 2 columns: date: The date is_school_day: This is a binary flag that indicates if the day is a school day. A value of 0 indicates the date is not a school day. A value of 1 indicates the day is a school day. Background information: The first day of school for the school year was August 13, 2018. The last day of school for the school year was May 23, 2019. Test Results The mock_test_results table has a record for every enrolled student whether they have a valid test result or not (i.e. some students have no result in the passed column). The table consists of four columns: unique_id: This is a unique id that represents an individual student. It is unique to the student not to the table. In other words, a student can take the science test multiple times. subject: This is the test subject. passed: This is a binary flag that indicates if the student passed the test. A value of 0 indicates the student did not pass the test. A value of 1 indicates the student did pass the test. And a null value indicates the student did not have a valid test result. test_date: (YYYY-MM-DD) This is the date the student took the test. Directions/Questions There are four questions that can be answered by writing a SQL query. For each question, you will submit both the text of the query and the results in .txt format. Question 1 | Question 2 | Question 3 | Question 4 Question 1 Which 5 days had the most students enroll? The result set should include two columns: start_date: This is the start date of the enrollment. enrollment_count: This is the count of students enrolling on that start date. Question 2 How many students were enrolled on February 1, 2019 in 8th grade? The result set should include one column: enrollment_count: This is the number of students enrolled in 8th grade on February 1, 2019. Question 3 Create a running total of of passed assessments by school day starting March 1, 2019. The result set should include two columns: date: The date of the school day. cumulative_passed_assessments: The count of cumulative passed assessments. Question 4 List all of the students with all of their test scores that have valid test dates, format the test_date in a month/day/year format (e.g., 04/10/2022) reformat the Science subject to say "Biology", and the results of the test (if the student passed the test return the text "Passed" or "Not Passed"). The result set should include four columns: unique_id: The student's unique identifier. test_date: The date for the student's test subject: The subject for the test. result: The result of the test ("Passed" or "Not Passed").

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions