Fixed code about SQL