I get the error ERROR 1066 (42000): Not unique table/alias: 'STUDENT_TBL'
select STUDENT,DATE,MARK from Assessments inner join STUDENT_TBL on Assessments,ID_STUDENT=STUDENT_TBL,STD_ID inner join Visit_log,ID_STUDENT=STUDENT_TBL,STD_ID where STUDENT_TBL,STD_ID IN (select ID_STUDENT FROM Assessments group by ID_STUDENT having avg(MARK)>3.7);
How to fix it ?
You should use
'.'instead of','to accessTable_Name.column_name.Also use alias like
Assessments.ID_STUDENTwhile selecting columns in select clause if those are present in more than one table