Updated database SQL. Added database connection feature.