correction of sql

wrapping data integrity around my head ^^