rajaykumar12959 commited on
Commit
e999a53
·
verified ·
1 Parent(s): 4b9a558

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -74
README.md CHANGED
@@ -176,80 +176,6 @@ WHERE department = 'Engineering'
176
  AND salary > 75000;
177
  ```
178
 
179
- #### Example 2: Multi-Table JOIN Query
180
-
181
- ```python
182
- # E-commerce Database Schema
183
- complex_schema = """
184
- CREATE TABLE users (
185
- user_id INT PRIMARY KEY,
186
- username TEXT,
187
- email TEXT
188
- );
189
-
190
- CREATE TABLE orders (
191
- order_id INT PRIMARY KEY,
192
- user_id INT,
193
- order_date DATE,
194
- FOREIGN KEY (user_id) REFERENCES users(user_id)
195
- );
196
-
197
- CREATE TABLE products (
198
- product_id INT PRIMARY KEY,
199
- product_name TEXT,
200
- category TEXT,
201
- price DECIMAL
202
- );
203
-
204
- CREATE TABLE order_items (
205
- item_id INT PRIMARY KEY,
206
- order_id INT,
207
- product_id INT,
208
- quantity INT,
209
- FOREIGN KEY (order_id) REFERENCES orders(order_id),
210
- FOREIGN KEY (product_id) REFERENCES products(product_id)
211
- );
212
- """
213
-
214
- # Complex Question requiring 4-table JOIN
215
- complex_question = """
216
- List the usernames and emails of users who have spent more than $500 in total on products
217
- in the 'Electronics' category.
218
- """
219
-
220
- sql_result = inference_text_to_sql(model, tokenizer, complex_schema, complex_question)
221
- print(f"Generated SQL:\n{sql_result}")
222
- ```
223
-
224
- **Expected Output:**
225
- ```sql
226
- SELECT u.username, u.email
227
- FROM users u
228
- JOIN orders o ON u.user_id = o.user_id
229
- JOIN order_items oi ON o.order_id = oi.order_id
230
- JOIN products p ON oi.product_id = p.product_id
231
- WHERE p.category = 'Electronics'
232
- GROUP BY u.user_id, u.username, u.email
233
- HAVING SUM(oi.quantity * p.price) > 500;
234
- ```
235
-
236
- #### Example 3: Aggregation with GROUP BY
237
-
238
- ```python
239
- agg_question = "Find the average salary by department for departments with more than 5 employees"
240
-
241
- sql_result = inference_text_to_sql(model, tokenizer, simple_schema, agg_question)
242
- print(f"Generated SQL:\n{sql_result}")
243
- ```
244
-
245
- **Expected Output:**
246
- ```sql
247
- SELECT department, AVG(salary) as avg_salary
248
- FROM employees
249
- GROUP BY department
250
- HAVING COUNT(*) > 5;
251
- ```
252
-
253
  ## Training Details
254
 
255
  ### Dataset
 
176
  AND salary > 75000;
177
  ```
178
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  ## Training Details
180
 
181
  ### Dataset