I’ll try to explain it to the best of my ability. (my wording might be a bit off, but I will try to make it understandable)
Firstly the ; separates the statements, so there are 2 in your example.
The first statement:
DELETE FROM active_patients
WHERE Name IN (
This block will
FROM the active_patients table
WHERE the Name value comes forth in the results of the following statement:
What the above statement does is
SELECT the Name column for all of the records in the active_patients table and
LIMIT it to the first applicable row. So in other words, this will return only 1 record (or the first row).
The second statement:
WHERE ID = (
When this is executed it will
SELECT all of the columns (That is what the “*” indicates) for the rows in the active_patients table
WHERE the ID value of the row is equal to the result of the following statement:
max (maximum or biggest) value in the ID column
FROM all of the rows in the active_patients table.