Added missing sql for tables