The program returns for each query whether it is valid or not (valid, Invalid) only.
For example, two schemas are attached to the file:
Customers(Name:STRING, Age:INTEGER)
Orders(CustomerName:STRING, Product:STRING, Price: INTEGRER)
If the query is invalid, it is necessary to report where it failed. The program shoud return one of the following four options:
- Parsing <o_d> failed
- Parsing <attribute_list> failed
- Parsing <table_list> failed
- Parsing failed
Sample valid input queries:
SELECT Customers.Name FROM Customers WHERE Customer.Age=25;
SELECT Customers.Name FROM Customers WHERE Customer.Name=”Mike”;
SELECT DISTINCT Customers.Name FROM Customers WHERE Customer.Age=25;
SELECT Customers.Name,Orders.Price FROM Customers,Orders WHERE Customer.Name=Orders.CustomerName;
SELECT Customers.CustomerName,Orders.Price FROM Customers,Orders WHERE Customer.Name=Orders.CustomerName AND Orders.Price>1000;
SELECT Customers.Name,Orders.Price FROM Customers,Orders WHERE (Customer.Name=Orders.CustomerName) AND Orders.Price>1000;
SELECT Customers.Name,Orders.Price FROM Customers,Orders WHERE (Customer.Name=Orders.CustomerName) OR (Orders.Price>59);