Skip to main content

Pip installable database schema that attempts to mimic the Fandango database

Reason this release was yanked:

Application relies on config file for its main function which should be part of the package.

Project description

SQL-BUDDY

Sql-buddy is a study aid for SQL fundamentals that you can run on the terminal. You can think of it as the command-line version of index cards you would normally use for studying a subject.

Installation

You can install sql-buddy with pip: PYPI

pip install sql-buddy

sql-buddy is supported by Python 3.7 and above.

How to use

sql-buddy is a command line application. There are two components:

  1. The first component emulates a simple collection of object that represent SQL concepts like GROUP BY:

$ python -m sql_buddy

Welcome to sql-buddy. Populating In-memory Database...

Press Esc + ENTER to enter sql_buddy commands. Press CTRL-D to quit

Type 'commands' and press Esc + ENTER to get a list of sql_buddy commands

As the instructions state you can type 'commands' and hit Esc + ENTER (RETURN):

commands * list all: lists all the SQL concepts and queries * list some: list the first 10 concepts in the SQL concepts database * search=>{concept_name} gives you the definition, syntax, and usage of a specific SQL concept like group_by * i.e. search=>group_by * i.e. search=>order_by * i.e. search=>where * all SQL concept names must be in lowercase and have underscores in place of spaces

> list all

group_by:

Divide the rows returned from the select statement into groups. For each group, you can apply an aggregate function like sum(), min(), max(), avg().

group_by_with_having:

We use having in place of the where clause because aggregations like sum() do not work with the where clause.

To search the definition, syntax, usage, and related concepts of a specific SQL concept:

> search=>group_by

group_by:

Divide the rows returned from the select statement into groups. For each group, you can apply an aggregate function like sum(), min(), max(), avg().

syntax: select col_1, col_2 from table_name group by col_1, col2

usage: select staff_id, count(staff_id) from payment group by staff_id

related concepts: ['group_by_with_having', 'where', 'having', 'order by', 'aggregation', 'sum', 'min', 'max', 'avg']

The syntax for any individual SQL concept is:

> search=>{concept_name}

Like Python variables concept names cannot have spaces and must be lowercase.

  1. The second component is an SQL REPL straight from the prompt-toolkit documentation example tutorial:

prompt-toolkit

Run sql_buddy like before but with the -o flag:

$ python -m sql_buddy -o

And simply type SQLite queries:

select last_name, first_name, execution_date from deathrow limit 3;

('Brooks, Jr.', 'Charlie', '1982-12-07')

('Autry', 'James', '1984-03-14')

("O'Bryan", 'Ronald', '1984-03-31')

Sql-buddy comes with a csv data called tx_deathrow_full.csv that contains information about Texas deathrow inmates: selectstarsql.com.

The ideal setting for sql-buddy is two have two terminals open at the same time. One to utilize the first component to look up SQL concepts, and the other to run queries against an actual SQLite database table.

All data makes use of in-memory-only databases created through sqlite3 and sqlalchemy methods.

For help:

$ python -m sql_buddy -h

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydango-1.0.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydango-1.0.0-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

Details for the file pydango-1.0.0.tar.gz.

File metadata

  • Download URL: pydango-1.0.0.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for pydango-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3d6d27c602e7a413d8c26bce3d047b2e138250441210df55ab9f2e77ef19a422
MD5 3d1f19614bc029d12bf0dd06f62de1f8
BLAKE2b-256 2fc04c6d8be3a1c8a9d23e6a8676a54aaff0abe93b809d81e78dd88a17e6dad6

See more details on using hashes here.

File details

Details for the file pydango-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pydango-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for pydango-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 703d3e00b9ceb23085ef5cbb2141f411d603da33f2fbc698d29048156d37412d
MD5 ad244e0e13b895d5656b9e459f6533fc
BLAKE2b-256 eb8c9c43d11e650325b8d49f1d9862bc515d072441d13b38510e575da03720ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page