Skip to main content

DBIS SQL Exercise Generator

pypi PyPI Status

Installation

Install via pip:

# Not yet available on PyPI
pip install dbis-sql-exercise-generator

Most notably, following required packages are also installed:

Usage

from rc_exercise_generator import generate_exercise

# set the solution as SQLite query (string)
solution_sql_query = "SELECT a, c FROM R;"

from excmanager.Task import Exercise, Task, SubTask
exercise1 = Exercise(1)
task1 = Task(exercise1, "1.1")
subtask1 = SubTask(task1, "a", points=2)
# task description
description = "Select the attributes a and c from the relation R."

generated_cells = generate_exercise(
	subtask1,
	description,
	solution_sql_query,
	correct_attributes_score_perc=0.1,
)

# generated_cells is a dictionary of cells, which can be used to generate a Jupyter Notebook
# format:
# filename (str) -> cell content (str)

⚠️ Guidelines

In order to directly use the generated cells in an exercise Jupyter notebook, one should follow the following guidelines:

  • tasks should be named task1, task2, ...
  • The SQLite Connection has to be made beforehand. This connection should be stored in the variable sql_con.

View the templates and this test for more information on what cells are generated and how one can incorporate them into an exercise Jupyter notebook.

Metadata

Release files for dbis-sql-exercise-generator 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbis-sql-exercise-generator 0.0.1
File Size Uploaded
dbis-sql-exercise-generator-0.0.1.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dbis-sql-exercise-generator 0.0.1
File Interpreter ABI Platform
dbis_sql_exercise_generator-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.7 kB

Release files / dbis-sql-exercise-generator-0.0.1.tar.gz

Download URL dbis-sql-exercise-generator-0.0.1.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
348f013693055a2fed3cb8f2adf8c25985dca94409b6e9e1e6c2ed03cd6ade3a
BLAKE2b-256 checksum
How to use checksums
b12849d4a3b1ee8f24815bec5b8d47518452de2788c938978d0b5c0d66a20f57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / dbis_sql_exercise_generator-0.0.1-py3-none-any.whl

Download URL dbis_sql_exercise_generator-0.0.1-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
711d5347652f33614ebb3bb2905bfe74daf71f855708ad5dfdf68f8b7811de63
BLAKE2b-256 checksum
How to use checksums
0fd2360edff3ad67c5cbfbf2f65b0e81eb4a7f0f1a7bb0751b94eabe8775d41b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page