Database schema:
CREATE TABLE Employee (
  EmployeeID NUMBER PRIMARY KEY,
  Name TEXT,
  Position TEXT,
  Salary NUMBER,
  Remarks TEXT
);
CREATE TABLE Planet (
  PlanetID NUMBER PRIMARY KEY,
  Name TEXT,
  Coordinates NUMBER
);
CREATE TABLE Shipment (
  ShipmentID NUMBER PRIMARY KEY,
  Date TIME,
  Manager NUMBER,
  Planet NUMBER,
  FOREIGN KEY (Planet) REFERENCES Planet(PlanetID),
  FOREIGN KEY (Manager) REFERENCES Employee(EmployeeID)
);
CREATE TABLE Has_Clearance (
  Employee NUMBER PRIMARY KEY,
  Planet NUMBER,
  Level NUMBER,
  FOREIGN KEY (Planet) REFERENCES Planet(PlanetID),
  FOREIGN KEY (Employee) REFERENCES Employee(EmployeeID)
);
CREATE TABLE Client (
  AccountNumber NUMBER PRIMARY KEY,
  Name TEXT
);
CREATE TABLE Package (
  Shipment NUMBER PRIMARY KEY,
  PackageNumber NUMBER,
  Contents TEXT,
  Weight NUMBER,
  Sender NUMBER,
  Recipient NUMBER,
  FOREIGN KEY (Recipient) REFERENCES Client(AccountNumber),
  FOREIGN KEY (Sender) REFERENCES Client(AccountNumber),
  FOREIGN KEY (Shipment) REFERENCES Shipment(ShipmentID)
);

Question: What are the ids of all shipments on the planet Mars that are managed by Turanga Leela?
SQL: SELECT T1.ShipmentID FROM Shipment AS T1 JOIN Planet AS T2 ON T1.Planet = T2.PlanetID JOIN Employee AS T3 ON T3.EmployeeID = T1.Manager WHERE T2.Name = "Mars" AND T3.Name = "Turanga Leela";

Question: List package number of package shipped in planet Omicron Persei 8 and sent by Zapp Brannigan.
SQL: SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON  T1.Sender = T2.AccountNumber JOIN Shipment AS T3 ON T1.Shipment = T3.ShipmentID JOIN Planet AS T4 ON T3.Planet = T4.PlanetID WHERE T2.Name = "Zapp Brannigan" AND T4.Name = "Omicron Persei 8";

Question: Which employees have clearance in Omega III? List employees' name.
SQL: SELECT T2.Name FROM Has_Clearance AS T1 JOIN Employee AS T2 ON T1.Employee = T2.EmployeeID JOIN Planet AS T3 ON T1.Planet = T3.PlanetID WHERE T3.Name  =  "Omega III";

Question: what is the total weight of all packages shipped on Mars?
SQL: SELECT sum(T1.Weight) FROM PACKAGE AS T1 JOIN Shipment AS T2 ON T1.Shipment = T2.ShipmentID JOIN Planet AS T3 ON T2.Planet = T3.PlanetID WHERE T3.Name = "Mars";

Question: What is the name of the client who received the heaviest package?
SQL: SELECT T2.Name FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Recipient  =  T2.AccountNumber ORDER BY T1.Weight DESC LIMIT 1

Question: Which employees do not have clearance in Mars? List employee's name.
SQL: SELECT Name FROM Employee EXCEPT SELECT T2.Name FROM Has_Clearance AS T1 JOIN Employee AS T2 ON T1.Employee = T2.EmployeeID JOIN Planet AS T3 ON T1.Planet = T3.PlanetID WHERE T3.Name = "Mars";

Question: List all shipment ids on the planet Mars or under the management of Turanga Leela.
SQL: SELECT T1.ShipmentID FROM Shipment AS T1 JOIN Planet AS T2 ON T1.Planet = T2.PlanetID JOIN Employee AS T3 ON T3.EmployeeID = T1.Manager WHERE T2.Name = "Mars" OR T3.Name = "Turanga Leela";

Question: List package number of packages shipped in Omicron Persei 8 planet or sent by Zapp Brannigan.
SQL: SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON  T1.Sender = T2.AccountNumber JOIN Shipment AS T3 ON T1.Shipment = T3.ShipmentID JOIN Planet AS T4 ON T3.Planet = T4.PlanetID WHERE T2.Name  =  "Zapp Brannigan" OR T4.Name  =  "Omicron Persei 8";

Question: List Package Number of all package sent by Leo Wong?
SQL: SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Sender  =  T2.AccountNumber WHERE T2.Name  =  "Leo Wong";

Question: What is the number of all packages that Leo Wong sent?
SQL: SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Sender  =  T2.AccountNumber WHERE T2.Name  =  "Leo Wong";

Question: What level is Physician?
SQL: SELECT T1.Level FROM Has_Clearance AS T1 JOIN Employee AS T2 ON T1.Employee = T2.EmployeeID WHERE T2.position  =  "Physician";

Question: Calculate total weight of package shipped on Mars.
SQL: SELECT sum(T1.Weight) FROM PACKAGE AS T1 JOIN Shipment AS T2 ON T1.Shipment = T2.ShipmentID JOIN Planet AS T3 ON T2.Planet = T3.PlanetID WHERE T3.Name = "Mars";

Question: Who received least number of packages ? List client name and number of packages received by that client .
SQL: select t2.name ,  count(*) from package as t1 join client as t2 on t1.recipient  =  t2.accountnumber group by t1.recipient order by count(*) limit 1;

Question: Which employees have salaries between 5000 and 10000? List employees' name.
SQL: SELECT Name FROM Employee WHERE Salary BETWEEN 5000 AND 10000

Question: What is the package number and weight of the 3 lightest packages?
SQL: SELECT PackageNumber ,  Weight FROM PACKAGE ORDER BY Weight ASC LIMIT 3;

Question: List all Planets' names and coordinates in alphabetical order of name.
SQL: SELECT Name ,  Coordinates FROM Planet ORDER BY Name

Question: Find the number of employees who do not have clearance in Mars .
SQL: select count(*) from employee where employeeid not in ( select t2.employeeid from has_clearance as t1 join employee as t2 on t1.employee = t2.employeeid join planet as t3 on t1.planet = t3.planetid where t3.name = "mars" );

Question: List all shipment id under Phillip J. Fry's management.
SQL: SELECT T1.ShipmentID FROM Shipment AS T1 JOIN Employee AS T2 ON T1.Manager = T2.EmployeeID WHERE T2.Name = "Phillip J. Fry";

Question: What are the number of packages shipped on Omicron Persei 8 planet or sent by Zapp Brannigan?
SQL: SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON  T1.Sender = T2.AccountNumber JOIN Shipment AS T3 ON T1.Shipment = T3.ShipmentID JOIN Planet AS T4 ON T3.Planet = T4.PlanetID WHERE T2.Name  =  "Zapp Brannigan" OR T4.Name  =  "Omicron Persei 8";

Question: What is the position of Amy Wong?
SQL: SELECT POSITION FROM Employee WHERE Name  =  "Amy Wong";

Question: How many packages sent by Ogden Wernstrom and received by Leo Wong?
SQL: SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Sender  =  T2.AccountNumber WHERE T2.Name = "Ogden Wernstrom" INTERSECT SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Recipient  =  T2.AccountNumber WHERE T2.Name = "Leo Wong"

Question: What are the package numbers and weights that are between 10 and 30?
SQL: SELECT PackageNumber ,  Weight FROM PACKAGE WHERE Weight BETWEEN 10 AND 30;

Question: What are all of the package numbers received by Leo Wong?
SQL: SELECT T1.PackageNumber FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Recipient  =  T2.AccountNumber WHERE T2.Name = "Leo Wong";

Question: What is the name of the client who sent the most packages and how many were there?
SQL: SELECT T2.Name ,  count(*) FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Sender  =  T2.AccountNumber GROUP BY T1.Sender ORDER BY count(*) DESC LIMIT 1;

Question: What is the number of employees that do not have clearance on Mars ?
SQL: select count(*) from employee where employeeid not in ( select t2.employeeid from has_clearance as t1 join employee as t2 on t1.employee = t2.employeeid join planet as t3 on t1.planet = t3.planetid where t3.name = "mars" );