Finished diagnosis.sql