diff --git a/README.md b/README.md index b49d470..b187866 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ SQL test === +Nathan's SQL answers. Tests past in `test/test_example.py` + ### Prerequisistes ```bash diff --git a/test/test_example.py b/test/test_example.py index 43720a2..3904377 100644 --- a/test/test_example.py +++ b/test/test_example.py @@ -43,6 +43,14 @@ class TestExample(DbTest): ) sql = """ + SELECT + COUNT(customers.*) AS "subordinates_count", + organizations.id AS "id" + FROM organizations + LEFT OUTER JOIN enterprise_sales_enterprise_customers customers ON customers.sales_organization_id = organizations.id + GROUP BY organizations.id + ORDER BY organizations.id ASC + ; """ with conn.cursor(cursor_factory=RealDictCursor) as cur: cur.execute(sql)