updated sql file and order management