Quoted table and column names.

Used identifier quoting to prevent SQL issues and also cahnged case of SQL syntax to uppercase to match rails.