Editor

Delete enrollments that have no marks

Easy · School database · DELETE, NULL values

Some enrollments have no marks yet: their marks is NULL. They were entered by mistake.

Delete those rows from the enrollments table and leave every other row as it is.

After your SQL, this query shows

SELECT * FROM enrollments ORDER BY id;
idstudent_idcourse_idmarksenrolled_on
111882025-04-07
213882025-04-07
322912025-04-08
424862025-04-08
531722025-04-09
633672025-04-09
742852025-04-10
844922025-04-10
953582025-04-11
1059902025-05-02
1162682025-04-11
1265752025-04-14
1371972025-04-14
1473822025-04-14
1584782025-04-15
1687732025-05-06
1791642025-04-16
1893952025-04-16
1996982025-05-06
20104782025-04-17
21105932025-04-17
22181812025-05-12
23206662025-05-13
24236872025-05-14
25237912025-05-14
26115742025-06-02
27113952025-06-02
28125842025-06-03
29127802025-06-03
30133712025-06-04

First 30 of 37 rows.

The school tables

courses: 10 rows, first 5 shown

idnameteacher_idcredits
1Physics14
2Chemistry24
3Mathematics35
4English43
5Biology54

enrollments: 40 rows, first 5 shown

idstudent_idcourse_idmarksenrolled_on
111882025-04-07
213882025-04-07
322912025-04-08
424862025-04-08
531722025-04-09

students: 24 rows, first 5 shown

idnamegenderclasssectioncitydobemail
1Aarav SharmaM12ADelhi2008-05-14aarav.sharma@example.com
2Priya NairF12AKochi2008-09-02priya.nair@example.com
3Rohan GuptaM12BDelhi2008-01-23NULL
4Ananya IyerF12BChennai2008-11-30ananya.iyer@example.com
5Kabir SinghM12CChandigarh2007-12-19kabir.singh@example.com

teachers: 8 rows, first 5 shown

idnamesubjectcityjoined_on
1Sunita MehraPhysicsDelhi2012-06-01
2Rajesh KumarChemistryDelhi2015-07-15
3Lakshmi KrishnanMathematicsChennai2010-04-01
4David ThomasEnglishKochi2018-06-20
5Farah QureshiBiologyMumbai2016-08-01
-- Write your SQL here