-
Notifications
You must be signed in to change notification settings - Fork 0
/
TeamInfo.txt
27 lines (25 loc) · 1.02 KB
/
TeamInfo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
* SQL queries are implemented in `app.py` file in root directory. You can easily find them as `query` variables in FLASK View functions.
Example in `category_report` View function:
----------------
query = \
"""
SELECT G.category_name as cat_name,
Count(*) as count,
Min(G.regular_price) as min,
cast(Avg(G.regular_price) as DECIMAL(9,2)) as avg,
Max(G.regular_price) as max
FROM (SELECT T.category_name,
P.regular_price
FROM (SELECT C.category_name,
I.productid
FROM category AS C
LEFT JOIN incategory AS I
ON C.category_name = I.category_name) AS T
LEFT JOIN product AS P
ON T.productid = P.productid) AS G
GROUP BY category_name
ORDER BY G.category_name ASC;
"""
----------------
* SQL script containing table creations and demo data insertions can be found in `SchemaAndDemoData.sql` file in root directory.
* Demo data can be found in data folder.