Skip to content

shayei/SQL_Query_Valdiation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL Query Validation Checker

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:

  1. Parsing <o_d> failed
  2. Parsing <attribute_list> failed
  3. Parsing <table_list> failed
  4. 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);

ENJOY

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages