sql-assignment-generator 0.0.16__tar.gz → 0.0.17__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/PKG-INFO +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/pyproject.toml +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_004.py +6 -2
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_010.py +9 -4
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_011.py +7 -3
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_012.py +10 -4
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_015.py +7 -4
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_019.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_021.py +7 -3
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_026.py +7 -4
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_035.py +7 -3
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_039.py +11 -5
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_040.py +8 -3
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_041.py +14 -6
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_042.py +9 -4
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_043.py +7 -3
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_044.py +9 -6
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_045.py +7 -4
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_046.py +12 -5
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_049.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_052.py +7 -3
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_053.py +6 -2
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_054.py +7 -3
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_055.py +7 -4
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_057.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_058.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_059.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_060.py +12 -6
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_062.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_063.py +6 -7
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_064.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_066.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_067.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_068.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_069.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_070.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_071.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_072.py +12 -5
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_073.py +7 -3
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_074.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_075.py +7 -4
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_076.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_077.py +7 -3
- sql_assignment_generator-0.0.17/src/sql_assignment_generator/error_requirements/err_078.py +58 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_079.py +19 -9
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_080.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_081.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_083.py +7 -3
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_084.py +12 -5
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_086.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_088.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_089.py +12 -5
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_091.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_093.py +7 -3
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_095.py +12 -5
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_096.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_097.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_098.py +7 -3
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_099.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_102.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_104.py +1 -1
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_105.py +7 -3
- sql_assignment_generator-0.0.16/docs/autoapi/index.rst +0 -11
- sql_assignment_generator-0.0.16/docs/autoapi/sql_assignment_generator/assignments/index.rst +0 -173
- sql_assignment_generator-0.0.16/docs/autoapi/sql_assignment_generator/constraints/index.rst +0 -104
- sql_assignment_generator-0.0.16/docs/autoapi/sql_assignment_generator/constraints/query/index.rst +0 -43
- sql_assignment_generator-0.0.16/docs/autoapi/sql_assignment_generator/constraints/schema/index.rst +0 -66
- sql_assignment_generator-0.0.16/docs/autoapi/sql_assignment_generator/index.rst +0 -373
- sql_assignment_generator-0.0.16/docs/autoapi/sql_assignment_generator/llm/index.rst +0 -36
- sql_assignment_generator-0.0.16/docs/autoapi/sql_assignment_generator/llm/models/index.rst +0 -48
- sql_assignment_generator-0.0.16/src/sql_assignment_generator/error_requirements/err_078.py +0 -46
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/.env.template +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/.gitattributes +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/.gitignore +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/.readthedocs.yaml +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/LICENSE +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/Makefile +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/README.md +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/docs/Makefile +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/docs/conf.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/docs/index.rst +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/docs/make.bat +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/docs/requirements.txt +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/requirements.txt +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/__init__.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/assignments/__init__.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/assignments/assignment.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/assignments/dataset/__init__.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/assignments/dataset/dataset.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/assignments/dataset/strings.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/assignments/exercise/__init__.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/assignments/exercise/exercise.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/assignments/exercise/strings.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/__init__.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/base.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/__init__.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/aggregation.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/base.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/clause_from.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/clause_group_by.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/clause_having.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/clause_order_by.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/clause_select.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/clause_where.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/rows.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/set_operations.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/query/subquery.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/schema/__init__.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/schema/base.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/schema/tables.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/constraints/schema/values.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/difficulty_level.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/domains.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/__init__.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/base.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_002.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_007.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/error_requirements/err_009.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/exceptions.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/llm/__init__.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/llm/chatgpt.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/llm/message.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/llm/models.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/src/sql_assignment_generator/translatable_text.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/test.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/query/test_aggregation.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/query/test_clause_from.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/query/test_clause_group_by.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/query/test_clause_having.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/query/test_clause_order_by.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/query/test_clause_select.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/query/test_clause_where.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/query/test_rows.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/query/test_set_operation.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/query/test_subquery.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/schema/__init__.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/schema/test_tables.py +0 -0
- {sql_assignment_generator-0.0.16 → sql_assignment_generator-0.0.17}/tests/constraints/schema/test_values.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sql_assignment_generator
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.17
|
|
4
4
|
Summary: This project generates SQL assignments based on common mistakes made by learners.
|
|
5
5
|
Project-URL: Repository, https://github.com/DavidePonzini/sql_assignment_generator
|
|
6
6
|
Project-URL: Documentation, https://sql-assignment-generator.readthedocs.io/en/latest/index.html
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
2
|
from ..constraints import schema as schema_constraints, query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err004_UndefinedColumn(SqlErrorRequirements):
|
|
6
7
|
def dataset_constraints(self, difficulty: DifficultyLevel) -> list[schema_constraints.SchemaConstraint]:
|
|
@@ -49,5 +50,8 @@ class Err004_UndefinedColumn(SqlErrorRequirements):
|
|
|
49
50
|
query_constraints.aggregation.Aggregation()
|
|
50
51
|
]
|
|
51
52
|
|
|
52
|
-
def exercise_extra_details(self) ->
|
|
53
|
-
return
|
|
53
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
54
|
+
return TranslatableText(
|
|
55
|
+
'This exercise should require students to reference a large number of columns in solution.',
|
|
56
|
+
it='Questo esercizio dovrebbe richiedere agli studenti di fare riferimento a un gran numero di colonne nella soluzione.'
|
|
57
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err010_Synonyms(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -30,6 +31,10 @@ class Err010_Synonyms(SqlErrorRequirements):
|
|
|
30
31
|
query_constraints.aggregation.Aggregation()
|
|
31
32
|
]
|
|
32
33
|
|
|
33
|
-
def dataset_extra_details(self) ->
|
|
34
|
-
return
|
|
35
|
-
|
|
34
|
+
def dataset_extra_details(self) -> TranslatableText:
|
|
35
|
+
return TranslatableText(
|
|
36
|
+
'The identifier column name must NOT be <entity>_id; pick a plausible synonym instead (e.g., <entity>_code, <entity>_key, <entity>_ref, <entity>_number, etc). ' \
|
|
37
|
+
'Additionally, I want naming conventions NOT to be consistent across tables; different tables must have different naming conventions for similar concepts: e.g. if Table1 uses (first_name, last_name), Table2 uses (name, surname)',
|
|
38
|
+
it='Il nome della colonna identificatore non deve essere <entità>_id; scegliere un sinonimo plausibile invece (es. <entità>_codice, <entità>_chiave, <entità>_rif, <entità>_numero, ecc). ' \
|
|
39
|
+
'Inoltre, voglio che le convenzioni di denominazione NON siano coerenti tra tabelle; diverse tabelle devono avere convenzioni di denominazione diverse per concetti simili: es. se Tabella1 usa (first_name, last_name), Tabella2 usa (name, surname)'
|
|
40
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err011_OmittingQuotesAroundCharacterData(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -30,5 +31,8 @@ class Err011_OmittingQuotesAroundCharacterData(SqlErrorRequirements):
|
|
|
30
31
|
query_constraints.aggregation.Aggregation()
|
|
31
32
|
]
|
|
32
33
|
|
|
33
|
-
def dataset_extra_details(self) ->
|
|
34
|
-
return
|
|
34
|
+
def dataset_extra_details(self) -> TranslatableText:
|
|
35
|
+
return TranslatableText(
|
|
36
|
+
'All the dataset tables must have at least one string attribute.',
|
|
37
|
+
it='Tutte le tabelle del dataset devono avere almeno un attributo di tipo stringa.'
|
|
38
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err012_FailureToSpecifyColumnNameTwice(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -30,7 +31,12 @@ class Err012_FailureToSpecifyColumnNameTwice(SqlErrorRequirements):
|
|
|
30
31
|
query_constraints.aggregation.Aggregation()
|
|
31
32
|
]
|
|
32
33
|
|
|
33
|
-
def exercise_extra_details(self) ->
|
|
34
|
-
return
|
|
34
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
35
|
+
return TranslatableText(
|
|
36
|
+
"Solution query must have multiple simple conditions on the SAME COLUMN (e.g. p.film='Alien' OR p.film='Superman'. This represents one column with MULTIPLE CONDITION). " \
|
|
35
37
|
"Solution must not have IN formatted like 'position IN ('Manager', 'Supervisor')' but I want this formatted as 'position ='Manager' OR position = 'Supervisor''" \
|
|
36
|
-
"exercise should naturally tempts student to make a mistake that can cause 'miss column name' errors (e.g. WHERE city='Boston' OR 'Chicago')."
|
|
38
|
+
"exercise should naturally tempts student to make a mistake that can cause 'miss column name' errors (e.g. WHERE city='Boston' OR 'Chicago').",
|
|
39
|
+
it="La query soluzione deve avere più condizioni semplici sulla STESSA COLONNA (es. p.film='Alien' OR p.film='Superman'. Questo rappresenta una colonna con CONDIZIONI MULTIPLE). " \
|
|
40
|
+
"La soluzione non deve usare IN formattato come 'position IN ('Manager', 'Supervisor')', ma voglio che sia formattato come 'position ='Manager' OR position = 'Supervisor''" \
|
|
41
|
+
"l'esercizio dovrebbe naturalmente tentare lo studente a commettere un errore che può causare errori di tipo 'colonna mancante' (es. WHERE city='Boston' OR 'Chicago')."
|
|
42
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err015_AggregateFunctionsCannotBeNested(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -30,6 +31,8 @@ class Err015_AggregateFunctionsCannotBeNested(SqlErrorRequirements):
|
|
|
30
31
|
query_constraints.aggregation.Aggregation(2)
|
|
31
32
|
]
|
|
32
33
|
|
|
33
|
-
def exercise_extra_details(self) ->
|
|
34
|
-
return
|
|
35
|
-
|
|
34
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
35
|
+
return TranslatableText(
|
|
36
|
+
"Generate a query in natural language that seems to involve one AGGREGATION inside another (e.g. 'the book that has the maximum number of sales' -- and the database doesn't store the sales count).",
|
|
37
|
+
it="Genera una query in linguaggio naturale che sembra coinvolgere un AGGREGATO dentro un altro (es. 'il libro che ha il massimo numero di vendite' -- e il database non memorizza il conteggio delle vendite)."
|
|
38
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
4
|
|
|
5
5
|
class Err019_UsingWhereTwice(SqlErrorRequirements):
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err021_ComparisonWithNull(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -30,5 +31,8 @@ class Err021_ComparisonWithNull(SqlErrorRequirements):
|
|
|
30
31
|
query_constraints.aggregation.Aggregation(2)
|
|
31
32
|
]
|
|
32
33
|
|
|
33
|
-
def dataset_extra_details(self) ->
|
|
34
|
-
return
|
|
34
|
+
def dataset_extra_details(self) -> TranslatableText:
|
|
35
|
+
return TranslatableText(
|
|
36
|
+
"Some non-key columns in the dataset must have NULL values.",
|
|
37
|
+
it="Alcune colonne non chiave nel dataset devono avere valori NULL."
|
|
38
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err026_TooManyColumnsInSubquery(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -30,6 +31,8 @@ class Err026_TooManyColumnsInSubquery(SqlErrorRequirements):
|
|
|
30
31
|
query_constraints.aggregation.Aggregation(2)
|
|
31
32
|
]
|
|
32
33
|
|
|
33
|
-
def exercise_extra_details(self) ->
|
|
34
|
-
return
|
|
35
|
-
|
|
34
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
35
|
+
return TranslatableText(
|
|
36
|
+
"The exercise should require comparing each row with a value from the same row or subset of rows (e.g. 'WHERE balance <comparison operator> (SELECT balance ... WHERE name = 'John')')",
|
|
37
|
+
it="L'esercizio dovrebbe richiedere il confronto di ogni riga con un valore della stessa riga o di un sottoinsieme di righe (es. 'WHERE bilancio <operatore di confronto> (SELECT bilancio ... WHERE nome = 'Mario')')"
|
|
38
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err035_IsWhereNotApplicable(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -30,5 +31,8 @@ class Err035_IsWhereNotApplicable(SqlErrorRequirements):
|
|
|
30
31
|
query_constraints.subquery.Subqueries()
|
|
31
32
|
]
|
|
32
33
|
|
|
33
|
-
def exercise_extra_details(self) ->
|
|
34
|
-
return
|
|
34
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
35
|
+
return TranslatableText(
|
|
36
|
+
"The exercise must require equality comparisons (i.e. '=') in WHERE conditions",
|
|
37
|
+
it="L'esercizio deve richiedere confronti di uguaglianza (cioè '=') nelle condizioni WHERE"
|
|
38
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err039_AndInsteadOfOr(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -30,7 +31,12 @@ class Err039_AndInsteadOfOr(SqlErrorRequirements):
|
|
|
30
31
|
query_constraints.subquery.Subqueries()
|
|
31
32
|
]
|
|
32
33
|
|
|
33
|
-
def exercise_extra_details(self) ->
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
35
|
+
return TranslatableText(
|
|
36
|
+
"The exercise must require multiple OR conditions on the same column " \
|
|
37
|
+
"(e.g. p.bornCity='Rome' OR p.bornCity='Genoa'. This represent one column with multiple conditions). " \
|
|
38
|
+
"It is mandatory use the parentesis to give precedence to a separate condition. ",
|
|
39
|
+
it="L'esercizio deve richiedere condizioni OR multiple sulla stessa colonna " \
|
|
40
|
+
"(es. p.cittàNascita='Roma' OR p.cittàNascita='Genova'. Questo rappresenta una colonna con più condizioni). " \
|
|
41
|
+
"E' obbligatorio usare le parentesi per dare precedenza a una condizione separata."
|
|
42
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
2
|
from ..constraints import schema as schema_constraints, query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err040_ImpliedTautologicalOrInconsistentExpressions(SqlErrorRequirements):
|
|
6
7
|
def dataset_constraints(self, difficulty: DifficultyLevel) -> list[schema_constraints.SchemaConstraint]:
|
|
@@ -50,6 +51,10 @@ class Err040_ImpliedTautologicalOrInconsistentExpressions(SqlErrorRequirements):
|
|
|
50
51
|
query_constraints.subquery.Subqueries()
|
|
51
52
|
]
|
|
52
53
|
|
|
53
|
-
def exercise_extra_details(self) ->
|
|
54
|
-
return
|
|
55
|
-
|
|
54
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
55
|
+
return TranslatableText(
|
|
56
|
+
"Exercise should require multiple conditions on the same column " \
|
|
57
|
+
"(e.g. p.age < 18 AND p.age >= 0 this represent one column with multiple conditions).",
|
|
58
|
+
it="L'esercizio deve richiedere condizioni multiple sulla stessa colonna " \
|
|
59
|
+
"(es. p.età < 18 AND p.età >= 0 questo rappresenta una colonna con più condizioni)."
|
|
60
|
+
)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import random
|
|
2
2
|
from .base import SqlErrorRequirements
|
|
3
|
-
from ..constraints import
|
|
3
|
+
from ..constraints import query as query_constraints
|
|
4
4
|
from ..difficulty_level import DifficultyLevel
|
|
5
|
+
from ..translatable_text import TranslatableText
|
|
5
6
|
|
|
6
7
|
class Err041_DistinctInSumOrAvg(SqlErrorRequirements):
|
|
7
8
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -42,9 +43,16 @@ class Err041_DistinctInSumOrAvg(SqlErrorRequirements):
|
|
|
42
43
|
query_constraints.rows.Duplicates()
|
|
43
44
|
]
|
|
44
45
|
|
|
45
|
-
def exercise_extra_details(self) ->
|
|
46
|
-
return
|
|
47
|
-
|
|
46
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
47
|
+
return TranslatableText(
|
|
48
|
+
"The natural language request must contain the word 'distinct' " \
|
|
49
|
+
"but the DISTINCT keyword should not be used in the SQL query.",
|
|
50
|
+
it="La richiesta in linguaggio naturale deve contenere la parola 'distinti' " \
|
|
51
|
+
"ma la parola chiave DISTINCT non deve essere usata nella query SQL."
|
|
52
|
+
)
|
|
48
53
|
|
|
49
|
-
def dataset_extra_details(self) ->
|
|
50
|
-
return
|
|
54
|
+
def dataset_extra_details(self) -> TranslatableText:
|
|
55
|
+
return TranslatableText(
|
|
56
|
+
'The table must have non-key numeric attributes',
|
|
57
|
+
it='La tabella deve avere attributi numerici non chiave'
|
|
58
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err042_DistinctThatMightRemoveImportantDuplicates(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -38,6 +39,10 @@ class Err042_DistinctThatMightRemoveImportantDuplicates(SqlErrorRequirements):
|
|
|
38
39
|
|
|
39
40
|
]
|
|
40
41
|
|
|
41
|
-
def exercise_extra_details(self) ->
|
|
42
|
-
return
|
|
43
|
-
|
|
42
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
43
|
+
return TranslatableText(
|
|
44
|
+
"The exercise must require selecting attributes that can cause duplicates such as cities, names, etc." \
|
|
45
|
+
"Attributes that can identify a record (i.e. primary keys or unique attributes) MUST NOT be selected (e.g. phone number, address, etc.).",
|
|
46
|
+
it="L'esercizio deve richiedere la selezione di attributi che possono causare duplicati come città, nomi, ecc." \
|
|
47
|
+
"Attributi che possono identificare un record (i.e. chiavi primarie o attributi univoci) NON DEVONO essere selezionati (es. numero di telefono, indirizzo, ecc.)."
|
|
48
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err043_WildcardsWithoutLike(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -31,5 +32,8 @@ class Err043_WildcardsWithoutLike(SqlErrorRequirements):
|
|
|
31
32
|
query_constraints.subquery.Subqueries()
|
|
32
33
|
]
|
|
33
34
|
|
|
34
|
-
def exercise_extra_details(self) ->
|
|
35
|
-
return
|
|
35
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
36
|
+
return TranslatableText(
|
|
37
|
+
'In the exercise there are WILDCARD with whole words longer than 5 characters.',
|
|
38
|
+
it='Nell\'esercizio ci sono WILDCARD con parole intere più lunghe di 5 caratteri.'
|
|
39
|
+
)
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import random
|
|
2
2
|
from .base import SqlErrorRequirements
|
|
3
|
-
from ..constraints import
|
|
3
|
+
from ..constraints import query as query_constraints
|
|
4
4
|
from ..difficulty_level import DifficultyLevel
|
|
5
|
+
from ..translatable_text import TranslatableText
|
|
5
6
|
|
|
6
7
|
class Err044_IncorrectWildcard(SqlErrorRequirements):
|
|
7
|
-
def __init__(self):
|
|
8
|
-
super().__init__()
|
|
8
|
+
def __init__(self, language: str):
|
|
9
|
+
super().__init__(language=language)
|
|
9
10
|
self._selected_symbols = ''
|
|
10
11
|
|
|
11
12
|
def _prepare_symbols(self, difficulty: DifficultyLevel):
|
|
@@ -53,6 +54,8 @@ class Err044_IncorrectWildcard(SqlErrorRequirements):
|
|
|
53
54
|
query_constraints.subquery.Subqueries()
|
|
54
55
|
]
|
|
55
56
|
|
|
56
|
-
def exercise_extra_details(self) ->
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
58
|
+
return TranslatableText(
|
|
59
|
+
f'Creates queries that must include the following symbols in LIKE wildcard: {" and ".join(self._selected_symbols)}',
|
|
60
|
+
it=f'Crea query che devono includere i seguenti simboli nei wildcard di LIKE: {" e ".join(self._selected_symbols)}'
|
|
61
|
+
)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import random
|
|
2
2
|
from .base import SqlErrorRequirements
|
|
3
|
-
from ..constraints import
|
|
3
|
+
from ..constraints import query as query_constraints
|
|
4
4
|
from ..difficulty_level import DifficultyLevel
|
|
5
|
-
|
|
5
|
+
from ..translatable_text import TranslatableText
|
|
6
6
|
class Err045_MixingGT0WithIsNotNullOrEmptyStringWithNull(SqlErrorRequirements):
|
|
7
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
8
8
|
constraints = super().exercise_constraints(difficulty)
|
|
@@ -38,5 +38,8 @@ class Err045_MixingGT0WithIsNotNullOrEmptyStringWithNull(SqlErrorRequirements):
|
|
|
38
38
|
]
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def dataset_extra_details(self) ->
|
|
42
|
-
return
|
|
41
|
+
def dataset_extra_details(self) -> TranslatableText:
|
|
42
|
+
return TranslatableText(
|
|
43
|
+
'Table must have some NULL, non-NULL, and NUMERIC attributes. Some string values must also be empty strings.',
|
|
44
|
+
it='La tabella deve avere alcuni valori NULL, non NULL e NUMERIC. Alcuni valori stringa devono essere anche stringhe vuote.'
|
|
45
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err046_NullInInAnyAllSubquery(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -27,8 +28,14 @@ class Err046_NullInInAnyAllSubquery(SqlErrorRequirements):
|
|
|
27
28
|
query_constraints.aggregation.Aggregation()
|
|
28
29
|
]
|
|
29
30
|
|
|
30
|
-
def exercise_extra_details(self) ->
|
|
31
|
-
return
|
|
31
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
32
|
+
return TranslatableText(
|
|
33
|
+
'The exercise must involve a subquery that returns at least one nullable value.',
|
|
34
|
+
it='L\'esercizio deve coinvolgere una subquery che restituisce almeno un valore NULL.'
|
|
35
|
+
)
|
|
32
36
|
|
|
33
|
-
def dataset_extra_details(self) ->
|
|
34
|
-
return
|
|
37
|
+
def dataset_extra_details(self) -> TranslatableText:
|
|
38
|
+
return TranslatableText(
|
|
39
|
+
'Dataset must contain NULL values.',
|
|
40
|
+
it='Il dataset deve contenere valori NULL.'
|
|
41
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
4
|
|
|
5
5
|
class Err049_ManyDuplicates(SqlErrorRequirements):
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err052_OrInsteadOfAnd(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -30,5 +31,8 @@ class Err052_OrInsteadOfAnd(SqlErrorRequirements):
|
|
|
30
31
|
query_constraints.aggregation.Aggregation()
|
|
31
32
|
]
|
|
32
33
|
|
|
33
|
-
def exercise_extra_details(self) ->
|
|
34
|
-
return
|
|
34
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
35
|
+
return TranslatableText(
|
|
36
|
+
"Solution query must have multiple AND conditions (e.g. p.film='Eragon' AND p.type='Fantasy').",
|
|
37
|
+
it="La query soluzione deve avere più condizioni AND (es. p.film='Eragon' AND p.type='Fantasy')."
|
|
38
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
2
|
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err053_ExtraneousNot(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -30,5 +31,8 @@ class Err053_ExtraneousNot(SqlErrorRequirements):
|
|
|
30
31
|
query_constraints.aggregation.Aggregation(2)
|
|
31
32
|
]
|
|
32
33
|
|
|
33
|
-
def exercise_extra_details(self) ->
|
|
34
|
-
return
|
|
34
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
35
|
+
return TranslatableText(
|
|
36
|
+
'The exercise must require at least one WHERE condition without NOT.',
|
|
37
|
+
it='L\'esercizio deve richiedere almeno una condizione WHERE senza NOT.'
|
|
38
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err054_MissingNot(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -33,5 +34,8 @@ class Err054_MissingNot(SqlErrorRequirements):
|
|
|
33
34
|
query_constraints.aggregation.Aggregation()
|
|
34
35
|
]
|
|
35
36
|
|
|
36
|
-
def exercise_extra_details(self) ->
|
|
37
|
-
return
|
|
37
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
38
|
+
return TranslatableText(
|
|
39
|
+
'The exercise should require multiple NOT conditions in WHERE clauses',
|
|
40
|
+
it='L\'esercizio deve richiedere più condizioni NOT nelle clausole WHERE'
|
|
41
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err055_SubstitutingExistanceNegation(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -31,6 +32,8 @@ class Err055_SubstitutingExistanceNegation(SqlErrorRequirements):
|
|
|
31
32
|
query_constraints.aggregation.Aggregation(2),
|
|
32
33
|
]
|
|
33
34
|
|
|
34
|
-
def exercise_extra_details(self) ->
|
|
35
|
-
return
|
|
36
|
-
|
|
35
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
36
|
+
return TranslatableText(
|
|
37
|
+
"The exercise must require selecting all Xs that are associated with all Ys (e.g. customers who bought all products in category C, customer who bought all products that cost more than 50, etc.).",
|
|
38
|
+
it="L'esercizio deve richiedere la selezione di tutti gli X associati a tutti gli Y (es. clienti che hanno comprato tutti i prodotti nella categoria C, cliente che ha comprato tutti i prodotti che costano più di 50, ecc.)."
|
|
39
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
4
|
|
|
5
5
|
class Err057_IncorrectComparisonOperatorOrIncorrectValueCompared(SqlErrorRequirements):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
4
|
|
|
5
5
|
class Err058_JoinOnIncorrectTable(SqlErrorRequirements):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
4
|
|
|
5
5
|
class Err059_JoinWhenJoinNeedsToBeOmitted(SqlErrorRequirements):
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err060_JoinOnIncorrectColumn(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -32,9 +33,14 @@ class Err060_JoinOnIncorrectColumn(SqlErrorRequirements):
|
|
|
32
33
|
query_constraints.clause_from.TableReferences(3)
|
|
33
34
|
]
|
|
34
35
|
|
|
35
|
-
def exercise_extra_details(self) ->
|
|
36
|
-
return
|
|
37
|
-
|
|
36
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
37
|
+
return TranslatableText(
|
|
38
|
+
"Solution MUST USE composite FOREIGN KEY in join (e.g. column1 a JOIN column2 b ON (a.col1= b.col1) AND (a.col2 = b.col2))",
|
|
39
|
+
it="La soluzione DEVE USARE una chiave esterna composta in un join (es. column1 a JOIN column2 b ON (a.col1= b.col1) AND (a.col2 = b.col2))"
|
|
40
|
+
)
|
|
38
41
|
|
|
39
|
-
def dataset_extra_details(self) ->
|
|
40
|
-
return
|
|
42
|
+
def dataset_extra_details(self) -> TranslatableText:
|
|
43
|
+
return TranslatableText(
|
|
44
|
+
'Composite foreign keys must be used in CREATE TABLE statements',
|
|
45
|
+
it='Le chiavi esterne composte devono essere usate nelle istruzioni CREATE TABLE'
|
|
46
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
4
|
|
|
5
5
|
class Err062_MissingJoin(SqlErrorRequirements):
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
|
+
from ..translatable_text import TranslatableText
|
|
4
5
|
|
|
5
6
|
class Err063_ImproperNestingOfExpressions(SqlErrorRequirements):
|
|
6
7
|
def exercise_constraints(self, difficulty: DifficultyLevel) -> list[query_constraints.QueryConstraint]:
|
|
@@ -29,11 +30,9 @@ class Err063_ImproperNestingOfExpressions(SqlErrorRequirements):
|
|
|
29
30
|
query_constraints.aggregation.Aggregation()
|
|
30
31
|
]
|
|
31
32
|
|
|
32
|
-
def exercise_extra_details(self) ->
|
|
33
|
-
return (
|
|
34
|
-
"The WHERE clause must require nested logical expressions where parentheses are mandatory "
|
|
35
|
-
"
|
|
36
|
-
"The logic must be realistic and the parentheses must be essential for the query's "
|
|
37
|
-
"correctness, not redundant."
|
|
33
|
+
def exercise_extra_details(self) -> TranslatableText:
|
|
34
|
+
return TranslatableText(
|
|
35
|
+
"The WHERE clause must require nested logical expressions where parentheses are mandatory to ensure correct operator precedence (e.g., '(condition1 OR condition2) AND condition3'). The logic must be realistic and the parentheses must be essential for the query's correctness, not redundant.",
|
|
36
|
+
it="La clausola WHERE deve richiedere espressioni logiche annidate dove le parentesi sono obbligatorie per garantire la corretta precedenza degli operatori (es. '(condizione1 OR condizione2) AND condizione3'). La logica deve essere realistica e le parentesi devono essere essenziali per la correttezza della query, non ridondanti."
|
|
38
37
|
)
|
|
39
38
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
4
|
|
|
5
5
|
class Err064_ImproperNestingOfSubqueries(SqlErrorRequirements):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
4
|
|
|
5
5
|
class Err066_MissingExpression(SqlErrorRequirements):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .base import SqlErrorRequirements
|
|
2
|
-
from ..constraints import
|
|
2
|
+
from ..constraints import query as query_constraints
|
|
3
3
|
from ..difficulty_level import DifficultyLevel
|
|
4
4
|
|
|
5
5
|
class Err067_ExpressionOnIncorrectColumn(SqlErrorRequirements):
|