Skip to content

Commit f45b47a

Browse files
author
sudheer
authored
Update README.md
1 parent 6da5f46 commit f45b47a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
11
# SQL-Engine
22

33
- ***Mini-SQL*** engine in ***Python*** which will run a subset of SQL Queries using command line interface.
4+
- ## **Dataset**
5+
- all elements in the fields would be ***integers*** only
6+
- file is named ***File1.csv***, the database table name would be ***File1***
7+
- ***metadat.txt*** file will be given for schema of corresponding database tables
8+
```
9+
<begin_table>
10+
<table_name>
11+
<attribute1>
12+
....
13+
<attributeN>
14+
<end_table>
15+
```
16+
- ## **Queries**
17+
- **Select** all records: ``` SELECT * FROM table_name; ```
18+
- **Aggregate** functions: ***sum, average, min, max*** ``` SELECT MAX(col) FROM table_name; ```
19+
- **Project** coloumns: ``` SELECT col FROM table_name; ```
20+
- Project with **distinct**: ``` SELECT DISTINCT col FROM table_name; ```
21+
- Select from **one or more tables**: ``` SELECT col1, col2 FROM table1, table2 WHERE col1=10 AND col2=20; ```
22+
- Projection from one or more from two tables with **one join condition**:
23+
```
24+
a. SELECT * FROM table1, table2 WHERE table1.col1=table2.col2;
25+
b. SELECT col1, col2 FROM table1, table2 WHERE table1.col1=table2.col2;
26+
```
27+
- Basic Error Handling is done
28+
- ## **Execute**
29+
- run SQL-Engine from **python file** ``` python sql_engine.py <query> ```
30+
- run SQL-Engine from **bash script** ``` bash run.sh ```

0 commit comments

Comments
 (0)