Upload dataset_base.jsonl with huggingface_hub
Browse files- dataset_base.jsonl +6 -5
dataset_base.jsonl
CHANGED
|
@@ -139,13 +139,14 @@
|
|
| 139 |
{"id":"base_python_14","dataset_type":"base","language":"Python","task_category":"refactoring","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
|
| 140 |
{"id":"base_python_15","dataset_type":"base","language":"Python","task_category":"refactoring","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
|
| 141 |
|
| 142 |
-
{"id":"base_sql_01","dataset_type":"base","language":"SQL","task_category":"queries",
|
| 143 |
"prompt_en":"I am calculating and retrieving data for a tableau chart using an MSSQL query. Above the chart is AGG (average number of customer hours cost center), which is SUM([Direct Time In Hours])/[numberofclients].[Sum unique clients cost center]. Sum unique clients cost center is in Tableau with the following calculation: SUM({FIXED [Year], [Month], [Cost Center Name]: COUNTD([Client])}) I want the tableau to have a row per cost center per month, and all the data comes from the numberofclients table. Can you convert this to an MSSQL database query?",
|
| 144 |
-
"prompt_nl":"Ik bereken en haal gegevens op voor een tableau chart met behulp van een MSSQL query. Boven de chart staat AGG (average number of customer hours cost center), wat SUM([Direct Time In Hours])/[numberofclients].[Sum unique clients cost center]. Som unieke klanten kostenplaats staat in Tableau met de volgende berekening: SUM({FIXED [Year], [Month], [Cost Center Name]: COUNTD([Client])}) Ik wil dat het tableau één rij per kostenplaats per maand heeft en dat alle gegevens afkomstig zijn uit de tabel
|
| 145 |
-
"code_snippet_input":"",
|
| 146 |
"canonical_solution":"SELECT \n[Year],\n[Month],\n[Cost Center Name],\nSUM([Direct Time In Hours]) AS TotalHours,\nCOUNT(DISTINCT [Client]) AS UniqueClientsPerMonth,\nSUM([Direct Time In Hours]) / NULLIF(CAST(COUNT(DISTINCT [Client]) AS FLOAT), 0) AS AvgCustomerHours\nFROM \nnumberofclients\nGROUP BY \n[Year], \n[Month], \n[Cost Center Name];",
|
| 147 |
-
"unit_test_setup":"",
|
| 148 |
-
"unit_test_assertion":""
|
|
|
|
| 149 |
}
|
| 150 |
{"id":"base_sql_02","dataset_type":"base","language":"SQL","task_category":"queries",
|
| 151 |
"prompt_en":"write an update statement in MySQL to set a column value based on a join with another table. update the field valedictorian to true if and only if the student appears in the valedictorians table.",
|
|
|
|
| 139 |
{"id":"base_python_14","dataset_type":"base","language":"Python","task_category":"refactoring","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
|
| 140 |
{"id":"base_python_15","dataset_type":"base","language":"Python","task_category":"refactoring","prompt_en":"","prompt_nl":"","code_snippet_input":"","canonical_solution":"","unit_test_setup":"","unit_test_assertion":""}
|
| 141 |
|
| 142 |
+
{"id":"base_sql_01","dataset_type":"base","language":"SQL","dialect": "mssql","task_category":"queries",
|
| 143 |
"prompt_en":"I am calculating and retrieving data for a tableau chart using an MSSQL query. Above the chart is AGG (average number of customer hours cost center), which is SUM([Direct Time In Hours])/[numberofclients].[Sum unique clients cost center]. Sum unique clients cost center is in Tableau with the following calculation: SUM({FIXED [Year], [Month], [Cost Center Name]: COUNTD([Client])}) I want the tableau to have a row per cost center per month, and all the data comes from the numberofclients table. Can you convert this to an MSSQL database query?",
|
| 144 |
+
"prompt_nl":"Ik bereken en haal gegevens op voor een tableau chart met behulp van een MSSQL query. Boven de chart staat AGG (average number of customer hours cost center), wat SUM([Direct Time In Hours])/[numberofclients].[Sum unique clients cost center]. Som unieke klanten kostenplaats staat in Tableau met de volgende berekening: SUM({FIXED [Year], [Month], [Cost Center Name]: COUNTD([Client])}) Ik wil dat het tableau één rij per kostenplaats per maand heeft en dat alle gegevens afkomstig zijn uit de tabel numberofclients. Kunt u dit omzetten naar een MSSQL databasequery?",
|
| 145 |
+
"code_snippet_input":"-- Context: Table Schema\n-- CREATE TABLE numberofclients (\n-- [Year] int,\n-- [Month] int,\n-- [Cost Center Name] varchar(100),\n-- [Client] varchar(100),\n-- [Direct Time In Hours] float\n-- );\n\n-- Write your query below:\n",
|
| 146 |
"canonical_solution":"SELECT \n[Year],\n[Month],\n[Cost Center Name],\nSUM([Direct Time In Hours]) AS TotalHours,\nCOUNT(DISTINCT [Client]) AS UniqueClientsPerMonth,\nSUM([Direct Time In Hours]) / NULLIF(CAST(COUNT(DISTINCT [Client]) AS FLOAT), 0) AS AvgCustomerHours\nFROM \nnumberofclients\nGROUP BY \n[Year], \n[Month], \n[Cost Center Name];",
|
| 147 |
+
"unit_test_setup":"CREATE TABLE numberofclients (\n [Year] INT,\n [Month] INT,\n [Cost Center Name] VARCHAR(255),\n [Client] VARCHAR(255),\n [Direct Time In Hours] FLOAT\n);\n\n-- Test Data: IT Dept, Jan 2023\nINSERT INTO numberofclients VALUES (2023, 1, 'IT', 'ClientA', 10.0);\nINSERT INTO numberofclients VALUES (2023, 1, 'IT', 'ClientA', 20.0); -- Same client, different hours (Total hours=30, Unique Clients=1)\nINSERT INTO numberofclients VALUES (2023, 1, 'IT', 'ClientB', 30.0); -- New client (Total IT hours=60, Unique Clients=2, Avg=30)",
|
| 148 |
+
"unit_test_assertion":" @Test\n public void testSqlLogic(Connection conn) throws SQLException {\n try (Statement stmt = conn.createStatement();\n ResultSet rs = stmt.executeQuery(studentSqlQuery)) {\n \n assertTrue(rs.next(), \"Result set should have at least one row\");\n \n assertEquals(\"IT\", rs.getString(\"Cost Center Name\"));\n assertEquals(60.0, rs.getDouble(\"TotalHours\"), 0.01, \"Total hours sum failed\");\n assertEquals(2, rs.getInt(\"UniqueClientsPerMonth\"), \"Distinct client count failed\");\n \n assertEquals(30.0, rs.getDouble(\"AvgCustomerHours\"), 0.01, \"Average calculation failed\");\n }\n }",
|
| 149 |
+
"comment":"the solution MUST group by year month and cost center name while summing direct hours and counting distinct clients to replicate the tableau logic, and MUST use valid MSSQL syntax."
|
| 150 |
}
|
| 151 |
{"id":"base_sql_02","dataset_type":"base","language":"SQL","task_category":"queries",
|
| 152 |
"prompt_en":"write an update statement in MySQL to set a column value based on a join with another table. update the field valedictorian to true if and only if the student appears in the valedictorians table.",
|