π©π»βπ»π€ SQL Interview Helper App

Summary
Back in Fall 2022 at UC San Diego, my classmates and I built a Data Science Interview helper leveraging GPT 3.5 for the final project of the course Deep Learning for Natural Language Understanding. This was right around the time ChatGPT first released, and we couldnβt have predicted what was to come. You can see the final paper we submitted here for all the details.
My portion was the SQL practice portion. Iβve taken that code and revamped it to use GPT-5 nano, and I also built a simple user interface leveraging Streamlit for users to more easily interact with the tool (an improvement from the Jupyter notebook I had submitted in 2022). Please see below for instructions on how to use my SQL Interview Helper. Iβve also uploaded a version that removes any OpenAI API usage thatβs available to check out live on Streamlit linked here and below. I hope this tool helps you hone your SQL skills and prepare for any interviews!
π©π»βπ» Skills Used
- Data wrangling (web scraping)
- Prompt engineering
- LLM integration
- Web app building
- Object-oriented programming
βοΈ Technologies Used
BeautifulSoupandrequestfor web scrapingOpenAI SDKfor LLM inferencingStreamlitfor building the web app user interface
Links
On this page
Set Up
First clone this repository. Youβll also need to have python3 installed on your local machine.
[Optional] Add Your OpenAI API Key
If you want to leverage OpenAI to provide feedback for your SQL queries, locate the folder in your file manager and create a file called .env. Ensure this file name is exactly .env. In this file, add your OpenAI API key following this format:
API_KEY=<YOUR OPENAI API KEY HERE>.
An OpenAI key is not necessary to use this helper. Instead of custom feedback for your SQL queries, youβll simply see an example solution with detailed comments.
Set Up Your Virtual Environment
Once youβre in the directory of this repository, run the following commands in your terminal:
python3 -m venv env
source env/bin/activate
Install Necessary Packages
Run the commands below to install the necessary packages. If at any point you get a ` No module named β
env/bin/python -m pip install streamlit
env/bin/python -m pip install openai
env/bin/python -m pip install bs4
env/bin/python -m pip install dotenv
env/bin/python -m pip install streamlit_code_editor
Run the SQL Interview Helper
Once set up, use the command below to run the SQL Interview Helper:
env/bin/python -m streamlit run app.py
Sources
SQL exercises are sourced from w3resource.


