Skip to content

Add files via upload #65

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions lab_sql_basics_.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "code",
"source": [
"SELECT client_id\n",
"FROM client\n",
"WHERE district_id = 1\n",
"ORDER BY client_id\n",
"LIMIT 5;\n",
"\n",
"SELECT client_id\n",
"FROM client\n",
"WHERE district_id = 72\n",
"ORDER BY client_id DESC\n",
"LIMIT 1;\n",
"\n",
"SELECT amount\n",
"FROM loan\n",
"ORDER BY amount\n",
"LIMIT 3;\n",
"\n",
"SELECT DISTINCT status\n",
"FROM loan\n",
"ORDER BY status;\n",
"\n",
"SELECT loan_id\n",
"FROM loan\n",
"ORDER BY payments DESC\n",
"LIMIT 1;\n",
"\n",
"SELECT account_id, amount\n",
"FROM loan\n",
"ORDER BY account_id\n",
"LIMIT 5;\n",
"\n",
"SELECT account_id\n",
"FROM loan\n",
"WHERE duration = 60\n",
"ORDER BY amount\n",
"LIMIT 1;\n",
"\n",
"SELECT DISTINCT k_symbol\n",
"FROM \"order\"\n",
"ORDER BY k_symbol;\n",
"\n",
"SELECT order_id\n",
"FROM \"order\"\n",
"WHERE account_id = 34;\n",
"\n",
"SELECT account_id\n",
"FROM \"order\"\n",
"WHERE order_id BETWEEN 29540 AND 29560;\n",
"\n",
"SELECT amount\n",
"FROM \"order\"\n",
"WHERE account_to = 30067122;\n",
"\n",
"SELECT trans_id, date, type, amount\n",
"FROM trans\n",
"WHERE account_id = 793\n",
"ORDER BY date DESC\n",
"LIMIT 10;\n",
"\n",
"SELECT district_id, COUNT(*)\n",
"FROM client\n",
"WHERE district_id < 10\n",
"GROUP BY district_id\n",
"ORDER BY district_id;\n",
"\n",
"SELECT type, COUNT(*)\n",
"FROM card\n",
"GROUP BY type\n",
"ORDER BY COUNT(*) DESC;\n",
"\n",
"SELECT account_id, SUM(amount)\n",
"FROM loan\n",
"GROUP BY account_id\n",
"ORDER BY SUM(amount) DESC\n",
"LIMIT 10;\n",
"\n",
"SELECT date, COUNT(*)\n",
"FROM loan\n",
"WHERE date < 930907\n",
"GROUP BY date\n",
"ORDER BY date DESC;\n",
"\n",
"SELECT date, duration, COUNT(*)\n",
"FROM loan\n",
"WHERE date BETWEEN 971201 AND 971231\n",
"GROUP BY date, duration\n",
"ORDER BY date, duration;\n",
"\n",
"SELECT account_id, type, SUM(amount) AS total_amount\n",
"FROM trans\n",
"WHERE account_id = 396\n",
"GROUP BY type\n",
"ORDER BY type;\n"
],
"metadata": {
"id": "gmEJZI63_CKv"
},
"execution_count": null,
"outputs": []
}
]
}