Solutions to SQL and some corrections