Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix solution errors and add test to validate solutions #4

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

evrys
Copy link

@evrys evrys commented Jan 17, 2023

Hallo Alexander!

My friend is a CS student at Hochschule Bonn-Rhein-Sieg, and I've been helping him study for his databases exam using the sql-trainer. However, we've found that some of the tasks can't be answered, often because the provided solution uses invalid SQLite syntax.

This PR adds a jest test which validates the solutionQuery for every task, so it's easy to find which ones are broken. The test structure follows the recommendations for testing given by create-react-app. Tests can be run with npm run test

I've also gone through and fixed 39 queries which were caught by the test. There was however one task (DML 27) where the solutionQuery uses a non-standard Oracle SQL syntax CONNECT BY PRIOR to find all the descendants of a tree structure. I couldn't figure out how to do this in SQLite without an unresonably complex query, so I commented out the task.

Also fixes #2

Thanks for your cool project!

evrys added 2 commits January 18, 2023 05:20
Currently, 40/351 of the provided solutions to tasks error out, so
the user can't validate their answer for these tasks. This test
helps find which solutions need to be fixed.
@evrys evrys changed the title Fix solution errors Fix solution errors and add test to validate solutions Jan 17, 2023
@evrys evrys mentioned this pull request Jan 17, 2023
@aahajj
Copy link

aahajj commented Feb 1, 2024

Hey Evan, I am preparing for the same exam and I found a mistake that is not mentioned in your pull request.
This solutionQuery:

"CREATE VIEW Inspektion AS SELECT am, fahrzeug_id FROM Inspektionen WHERE firma = 'VeServ';",

should be:

      "CREATE VIEW v_inspektion AS SELECT am, fahrzeug_id FROM Inspektionen WHERE firma = 'VeServ';",

Thank you :))

@evrys
Copy link
Author

evrys commented Feb 2, 2024

Added to the PR, thanks! Hopefully someone gets time to maintain this project since it's in active use by universities,,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fehlerhafte Lösung bei DQL Frage
2 participants