You can use below query to get the result
Select REPLACE(T1.subject,'(theory)','') subject,
T1.max theorymax,
T1.min theorymin,
T1.date theorydate ,
T2.max practicalmax,
T2.min practicalmin,
T2.date practicaldate
FROM YourTable T1 LEFT JOIN
YourTable T2 ON REPLACE(T1.subject,'(theory)','') = REPLACE(T2.subject,'(practical)','')
WHERE T2.subject IS NOT NULL