{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ee2e7c5d-5716-4c35-acde-0f82e8c2fac3",
   "metadata": {},
   "outputs": [],
   "source": [
    "from DATA225utils import make_connection, dataframe_query"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1ef3f72c-0486-481d-a754-c29038a069d9",
   "metadata": {},
   "outputs": [],
   "source": [
    "conn = make_connection(config_file = 'school.ini')\n",
    "cursor = conn.cursor()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5c481bfe-6e14-4d76-a30b-6e1e0ac4bd0d",
   "metadata": {},
   "outputs": [],
   "source": [
    "_, df = dataframe_query(conn, 'SELECT first, last FROM student')\n",
    "\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "37dc5c61-0c65-4061-ae4d-d6e010f6588f",
   "metadata": {},
   "outputs": [],
   "source": [
    "_, df = dataframe_query(conn, \"\"\"\n",
    "    SELECT concat(first, ' ', last) AS name\n",
    "    FROM student\n",
    "    \"\"\"\n",
    "                       )\n",
    "\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "470614bf-0202-4e8f-9491-8eeb0d47fefe",
   "metadata": {},
   "outputs": [],
   "source": [
    "cursor.close()\n",
    "conn.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6aacf506-fc82-4e39-8355-d3fbc30af2ad",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
