SQL code stuff done.