Skip to content
Snippets Groups Projects
Commit 808499d1 authored by keleher's avatar keleher
Browse files

auto

parent 86a90926
No related branches found
No related tags found
No related merge requests found
export GOPATH=/vagrant/go
export PATH="/usr/local/bin:/usr/local/go/bin:$GOPATH/bin:$PATH"
drop table if exists prereq;
drop table if exists time_slot;
drop table if exists advisor;
drop table if exists takes;
drop table if exists student;
drop table if exists teaches;
drop table if exists section;
drop table if exists instructor;
drop table if exists course;
drop table if exists department;
drop table if exists classroom;
create table classroom
(building varchar(15),
room_number varchar(7),
capacity numeric(4,0),
primary key (building, room_number)
);
create table department
(dept_name varchar(20),
building varchar(15),
budget numeric(12,2) check (budget > 0),
primary key (dept_name)
);
create table course
(course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0) check (credits > 0),
primary key (course_id),
foreign key (dept_name) references department
on delete set null
);
create table instructor
(ID varchar(5),
name varchar(20) not null,
dept_name varchar(20),
salary numeric(8,2) check (salary > 29000),
primary key (ID),
foreign key (dept_name) references department
on delete set null
);
create table section
(course_id varchar(8),
sec_id varchar(8),
semester varchar(6)
check (semester in ('Fall', 'Winter', 'Spring', 'Summer')),
year numeric(4,0) check (year > 1701 and year < 2100),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4),
primary key (course_id, sec_id, semester, year),
foreign key (course_id) references course
on delete cascade,
foreign key (building, room_number) references classroom
on delete set null
);
create table teaches
(ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
primary key (ID, course_id, sec_id, semester, year),
foreign key (course_id,sec_id, semester, year) references section
on delete cascade,
foreign key (ID) references instructor
on delete cascade
);
create table student
(ID varchar(5),
name varchar(20) not null,
dept_name varchar(20),
tot_cred numeric(3,0) check (tot_cred >= 0),
primary key (ID),
foreign key (dept_name) references department
on delete set null
);
create table takes
(ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2),
primary key (ID, course_id, sec_id, semester, year),
foreign key (course_id,sec_id, semester, year) references section
on delete cascade,
foreign key (ID) references student
on delete cascade
);
create table advisor
(s_ID varchar(5),
i_ID varchar(5),
primary key (s_ID),
foreign key (i_ID) references instructor (ID)
on delete set null,
foreign key (s_ID) references student (ID)
on delete cascade
);
create table time_slot
(time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2) check (start_hr >= 0 and start_hr < 24),
start_min numeric(2) check (start_min >= 0 and start_min < 60),
end_hr numeric(2) check (end_hr >= 0 and end_hr < 24),
end_min numeric(2) check (end_min >= 0 and end_min < 60),
primary key (time_slot_id, day, start_hr, start_min)
);
create table prereq
(course_id varchar(8),
prereq_id varchar(8),
primary key (course_id, prereq_id),
foreign key (course_id) references course
on delete cascade,
foreign key (prereq_id) references course
);
## Project 2: Advanced SQL, Python DB app, ORMs, CMSC424-0201, Fall 2017
### Due Oct. 1, 2017, 11:59PM
## Project 2: Advanced SQL, Python DB app, ORMs, CMSC424, Fall 2019
### Due Oct 6, 2019, 11:59PM
*The assignment is to be done by yourself.*
### Setup
As before we have created a VagrantFile for you. The main differences here are that we have loaded a skewed database (`flightsskewed`), and also installed Java. Start by doing `vagrant up` and `vagrant ssh` as usual.
However, this repository is hosted through *gitlab.cs.umd.edu*, not github, so the command
to clone it is:
Start by cloning the repository to create an all-new VM:
```
git clone https://gitlab.cs.umd.edu/keleher/p2.git
```
Ensure that the Vagrantfile has loaded
the `flightsskewed` database, together with tables populated from `large-skewed.sql`. Use
`flightsskewed` for all parts of this assignment.
Once inside the VM, you must run:
```
pip3 install peewee
pip3 install jupyter
pip3 install ipython-sql
```
Exit the VM, and then get back in again and everything should be set up correctly.
### Assignment Questions
**Question 1 (.5 pt)**: Consider the following query which finds the number of flights
---
**Question 1 (1 pt)**: Consider the following query which finds the number of flights
taken by users whose name starts with 'William'.
```
......@@ -64,28 +71,11 @@ The final answer should look like this:
```
Save your query in a file called `william.sql`.
Include your explanation as a comment in this file.
---
**Question 2 (1.5 pt)**: [Trigger]
Let's create a table `NumberOfFlightsTaken(customerid, customername, numflights)` to keep track of the total number of flights taken by each customer. Since this is a derived table (and not a view), it will not be kept up-to-date by the database system. Use the following command for doing this:
```
create table NumberOfFlightsTaken as
select c.customerid, c.name as customername, count(*) as numflights
from customers c join flewon fo on c.customerid = fo.customerid
group by c.customerid, c.name;
```
Write a `trigger` to keep this new table updated when a new entry is inserted into or a row is deleted from the `flewon` table. Remember the customerid corresponding to the new flewon update may not exist in the `NumberOfFlightsTaken` table at that time and it should be added to the table with a count of 1, in that case. Similarly, if a deletion of a row in `flewon` results in a user not having any flights, then the corresponding tuple for that user in `NumberOfFlightsTaken` should be deleted.
The trigger code should be submitted in `trigger.sql` file, as straight SQL. Running `psql
-f trigger.sql flightsskewed` should generate the trigger without errors.
The trigger
file you are given contains some (incorrect) code already, but must be corrected and expanded.
Save your explanation in a file called `william.txt`.
---
**Question 3 (2 pt)**: One of more prominent ways to use a database system is using an
**Question 2 (3 pts)**: One of more prominent ways to use a database system is using an
external client, using APIs such as ODBC and JDBC, or the
Python DB-API 2.0 specification.
......@@ -123,7 +113,7 @@ data into the database.
- Flight information, where information about the passengers in a flight is
provided. Create new rows in `flewon` for each customer, as well as the `customers`
table if the `customerid` does not already exist.
- In some cases the `customer_id` provided may not be present in the database (cust1000 as seen below). In this case, first update the `customers` table (all the info is guaranteed to be
- In some cases the `customerid` provided may not be present in the database (cust1000 as seen below). In this case, first update the `customers` table (all the info is guaranteed to be
there), and then add tuples to the `flewon` table.
```
......@@ -131,9 +121,9 @@ data into the database.
"flightid": "DL119",
"flightdate": "2015-09-25",
"customers": [
{"customer_id": "cust94"},
{"customer_id": "cust102"},
{"customer_id": "cust1000", "name": "XYZ", "birthdate": "1991-12-06", "frequentflieron": "DL"}
{"customerid": "cust94"},
{"customerid": "cust102"},
{"customerid": "cust1000", "name": "XYZ", "birthdate": "1991-12-06", "frequentflieron": "DL"}
]
}
}
......@@ -170,11 +160,63 @@ the commit, no data will be modified.
[json module](https://docs.python.org/3/library/json.html) from the
[Python standard library](https://docs.python.org/3/library/).
5. `./clean-example.py` will remove the tuples added from `example.py`
6. `./test-example.py pys.py` will run your code and print the results
6. `./test-example.py psy.py` will run your code and print the results
---
**Question 4 (2 pt)**: Another way to use a database is through an
**Question 3 (3 pts)**: [Function]
PostgreSQL functions, also known as PostgreSQL *stored procedures*,
are SQL and procedural statements (declarations, assignments, loops,
flow-of-control etc.) that can be invoked using the SQL interface.
Functions allow a single function call to carry out operations that
would normally take several queries and round trips.
Create function `updateFrequentFlierAirline`, taking a single `airlineid` parameter, that updates
`frequentflieron` for each customer that:
1) flies at least as much as on
`airlineid` any other carrier, but
2) doesn't already list `airlineid` as it's `frequentflieron`.
For example, assume the following initial `frequentflieron` assignments:
```
cust10 SW
cust11 SW
cust12 UA
cust13 SW
```
and the following actual flights (dates omitted):
```
cust10 SW22
cust10 UA23
cust10 UA11
cust11 SW22
cust11 SW23
cust11 UA11
cust12 SW23
cust12 UA11
cust12 UA22
cust13 AA22
cust13 AA23
cust13 SW11
cust13 UA22
cust13 UA23
```
Calling `updateFrequentFlierAirline('UA')` results in `cust10` and `cust13`
changing to `UA`. `cust11` doesn't change because she flies the most
on 'SW'. `cust13` doesn't change because she is already listing SW as
her `frequentflieron`.
Save your function to file `function.sql`.
--------------------
**Question 4 (3 pts)**: Another way to use a database is through an
object-relational-mapping (ORM), which maps table rows onto objects that are visible in a
programming language. The result is that you can write a database application without
using SQL at all.
......@@ -183,13 +225,13 @@ We will re-write the previous program with exactly the same semantics, but using
model approach instead. Notes:
1. There are many python ORMs, including [Django](https://www.djangoproject.com/), but we
will use the simpler [peewee](https://github.com/coleifer/peewee).
1. Peewee's distribution includes a tool called `pwiz`, which uses database
1. Peewee's includes a tool called `pwiz.py` (installed in the VM), which uses database
*introspection* to create python classes mirroring an existing postgres schema. You
should use this as follows:
pwiz.py -e postgresql -u ubuntu -P flightsskewed > orm.py
pwiz.py -e postgresql -u vagrant -P flightsskewed > orm.py
The password is `ubuntu`. This will create the scaffolding of your ORM program in `orm.py`.
The password is `vagrant`. This will create the scaffolding of your ORM program in `orm.py`.
1. Test this code by:
- add the following to the top of `orm.py`: `from datetime import date`
......@@ -221,6 +263,6 @@ database.
`clean-example.py` and `./test-example.py orm.py` work as in the last question.
## Submit Instructions
Submit `william.sql`, `trigger.sql`, `psy.py`, and `orm.py` files by creating a single
tarball, *tar cvfz p2.tgz william.sql trigger.sql psy.py orm.py*, and
uploading [here](https://myelms.umd.edu/courses/1218383/assignments/4378989).
Submit `william.sql`, `william.txt`, `psy.py`, `function.sql`, and `orm.py` files by creating a single
tarball, *tar cvfz p2.tgz william.sql william.txt function.sql psy.py orm.py*, and
uploading [here](https://umd.instructure.com/courses/1267269/assignments/4983014).
......@@ -12,7 +12,7 @@ Vagrant.configure("2") do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/xenial64"
config.vm.box = "hashicorp/bionic64"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
......@@ -68,24 +68,21 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y python-pip
pip install --upgrade pip
apt-get install -y postgresql postgresql-contrib python3-pip python3-psycopg2 emacs tcsh
sudo -u postgres createuser -s ubuntu
sudo -u postgres psql -c "ALTER ROLE ubuntu WITH PASSWORD 'ubuntu';"
apt-get install -y postgresql postgresql-contrib python3-pip python3-psycopg2 tcsh peewee
pip3 install peewee
pip3 install jupyter
pip3 install ipython-sql
sudo -u postgres createuser -s vagrant
sudo -u vagrant psql -c "alter user vagrant with password 'vagrant'"
sudo -u ubuntu createdb flightsskewed
sudo -u ubuntu psql flightsskewed -f /vagrant/large-skewed.sql
sudo -u vagrant ln -s /vagrant v
sudo -u vagrant cp -r /vagrant/{.bashrc,.cshrc,.jupyter} /home/vagrant/
sudo -u vagrant perl -pi -e 's/\r\n/\n/g' .cshrc
sudo -u vagrant perl -pi -e 's/\r\n/\n/g' .bashrc
chown -R vagrant ~vagrant/{.cshrc,.bashrc,.jupyter}
sudo -u vagrant createdb flightsskewed
sudo -u vagrant psql flightsskewed -f /vagrant/large-skewed.sql
cp /vagrant/.cshrc /home/ubuntu/
cp -r /vagrant/.jupyter /home/ubuntu/
chown -R ubuntu ~ubuntu/.jupyter
echo "PS1='424p2:\\w> '" >> ~ubuntu/.bashrc
SHELL
end
......
#!/usr/bin/python
#!/usr/bin/python3
import psycopg2
import os
import sys
import subprocess
conn = psycopg2.connect("dbname=flightsskewed user=ubuntu")
conn = psycopg2.connect("dbname=flightsskewed user=vagrant")
cur = conn.cursor()
# cleanup
......
alter role vagrant with password 'vagrant';
 
drop table flewon;
drop table flights;
drop table customers;
drop table airlines;
drop table airports;
drop table if exists flewon;
drop table if exists flights;
drop table if exists customers;
drop table if exists airlines;
drop table if exists airports;
 
create table airports (airportid char(3) primary key, city char(20), name char(100), total2011 int, total2012 int);
insert into airports(name, city, airportid, total2011, total2012) values('Metropolitan Oakland International','Oakland','OAK',10040864,9266570);
......
......@@ -11,10 +11,11 @@ if len(sys.argv) != 2:
print("USAGE: {:s} <JSON file>".format(sys.argv[0]))
exit()
conn = psycopg2.connect("dbname=flightsskewed user=ubuntu password=ubuntu")
conn = psycopg2.connect("dbname=flightsskewed user=vagrant password=vagrant")
curs = conn.cursor()
with open(sys.argv[1]) as f:
for line in f:
...
......
This diff is collapsed.
delete from prereq;
delete from time_slot;
delete from advisor;
delete from takes;
delete from student;
delete from teaches;
delete from section;
delete from instructor;
delete from course;
delete from department;
delete from classroom;
insert into classroom values ('Packard', '101', '500');
insert into classroom values ('Painter', '514', '10');
insert into classroom values ('Taylor', '3128', '70');
insert into classroom values ('Watson', '100', '30');
insert into classroom values ('Watson', '120', '50');
insert into department values ('Biology', 'Watson', '90000');
insert into department values ('Comp. Sci.', 'Taylor', '100000');
insert into department values ('Elec. Eng.', 'Taylor', '85000');
insert into department values ('Finance', 'Painter', '120000');
insert into department values ('History', 'Painter', '50000');
insert into department values ('Music', 'Packard', '80000');
insert into department values ('Physics', 'Watson', '70000');
insert into course values ('BIO-101', 'Intro. to Biology', 'Biology', '4');
insert into course values ('BIO-301', 'Genetics', 'Biology', '4');
insert into course values ('BIO-399', 'Computational Biology', 'Biology', '3');
insert into course values ('CS-101', 'Intro. to Computer Science', 'Comp. Sci.', '4');
insert into course values ('CS-190', 'Game Design', 'Comp. Sci.', '4');
insert into course values ('CS-315', 'Robotics', 'Comp. Sci.', '3');
insert into course values ('CS-319', 'Image Processing', 'Comp. Sci.', '3');
insert into course values ('CS-347', 'Database System Concepts', 'Comp. Sci.', '3');
insert into course values ('EE-181', 'Intro. to Digital Systems', 'Elec. Eng.', '3');
insert into course values ('FIN-201', 'Investment Banking', 'Finance', '3');
insert into course values ('HIS-351', 'World History', 'History', '3');
insert into course values ('MU-199', 'Music Video Production', 'Music', '3');
insert into course values ('PHY-101', 'Physical Principles', 'Physics', '4');
insert into instructor values ('10101', 'Srinivasan', 'Comp. Sci.', '65000');
insert into instructor values ('12121', 'Wu', 'Finance', '90000');
insert into instructor values ('15151', 'Mozart', 'Music', '40000');
insert into instructor values ('22222', 'Einstein', 'Physics', '95000');
insert into instructor values ('32343', 'El Said', 'History', '60000');
insert into instructor values ('33456', 'Gold', 'Physics', '87000');
insert into instructor values ('45565', 'Katz', 'Comp. Sci.', '75000');
insert into instructor values ('58583', 'Califieri', 'History', '62000');
insert into instructor values ('76543', 'Singh', 'Finance', '80000');
insert into instructor values ('76766', 'Crick', 'Biology', '72000');
insert into instructor values ('83821', 'Brandt', 'Comp. Sci.', '92000');
insert into instructor values ('98345', 'Kim', 'Elec. Eng.', '80000');
insert into section values ('BIO-101', '1', 'Summer', '2009', 'Painter', '514', 'B');
insert into section values ('BIO-301', '1', 'Summer', '2010', 'Painter', '514', 'A');
insert into section values ('CS-101', '1', 'Fall', '2009', 'Packard', '101', 'H');
insert into section values ('CS-101', '1', 'Spring', '2010', 'Packard', '101', 'F');
insert into section values ('CS-190', '1', 'Spring', '2009', 'Taylor', '3128', 'E');
insert into section values ('CS-190', '2', 'Spring', '2009', 'Taylor', '3128', 'A');
insert into section values ('CS-315', '1', 'Spring', '2010', 'Watson', '120', 'D');
insert into section values ('CS-319', '1', 'Spring', '2010', 'Watson', '100', 'B');
insert into section values ('CS-319', '2', 'Spring', '2010', 'Taylor', '3128', 'C');
insert into section values ('CS-347', '1', 'Fall', '2009', 'Taylor', '3128', 'A');
insert into section values ('EE-181', '1', 'Spring', '2009', 'Taylor', '3128', 'C');
insert into section values ('FIN-201', '1', 'Spring', '2010', 'Packard', '101', 'B');
insert into section values ('HIS-351', '1', 'Spring', '2010', 'Painter', '514', 'C');
insert into section values ('MU-199', '1', 'Spring', '2010', 'Packard', '101', 'D');
insert into section values ('PHY-101', '1', 'Fall', '2009', 'Watson', '100', 'A');
insert into teaches values ('10101', 'CS-101', '1', 'Fall', '2009');
insert into teaches values ('10101', 'CS-315', '1', 'Spring', '2010');
insert into teaches values ('10101', 'CS-347', '1', 'Fall', '2009');
insert into teaches values ('12121', 'FIN-201', '1', 'Spring', '2010');
insert into teaches values ('15151', 'MU-199', '1', 'Spring', '2010');
insert into teaches values ('22222', 'PHY-101', '1', 'Fall', '2009');
insert into teaches values ('32343', 'HIS-351', '1', 'Spring', '2010');
insert into teaches values ('45565', 'CS-101', '1', 'Spring', '2010');
insert into teaches values ('45565', 'CS-319', '1', 'Spring', '2010');
insert into teaches values ('76766', 'BIO-101', '1', 'Summer', '2009');
insert into teaches values ('76766', 'BIO-301', '1', 'Summer', '2010');
insert into teaches values ('83821', 'CS-190', '1', 'Spring', '2009');
insert into teaches values ('83821', 'CS-190', '2', 'Spring', '2009');
insert into teaches values ('83821', 'CS-319', '2', 'Spring', '2010');
insert into teaches values ('98345', 'EE-181', '1', 'Spring', '2009');
insert into student values ('00128', 'Zhang', 'Comp. Sci.', '102');
insert into student values ('12345', 'Shankar', 'Comp. Sci.', '32');
insert into student values ('19991', 'Brandt', 'History', '80');
insert into student values ('23121', 'Chavez', 'Finance', '110');
insert into student values ('44553', 'Peltier', 'Physics', '56');
insert into student values ('45678', 'Levy', 'Physics', '46');
insert into student values ('54321', 'Williams', 'Comp. Sci.', '54');
insert into student values ('55739', 'Sanchez', 'Music', '38');
insert into student values ('70557', 'Snow', 'Physics', '0');
insert into student values ('76543', 'Brown', 'Comp. Sci.', '58');
insert into student values ('76653', 'Aoi', 'Elec. Eng.', '60');
insert into student values ('98765', 'Bourikas', 'Elec. Eng.', '98');
insert into student values ('98988', 'Tanaka', 'Biology', '120');
insert into takes values ('00128', 'CS-101', '1', 'Fall', '2009', 'A');
insert into takes values ('00128', 'CS-347', '1', 'Fall', '2009', 'A-');
insert into takes values ('12345', 'CS-101', '1', 'Fall', '2009', 'C');
insert into takes values ('12345', 'CS-190', '2', 'Spring', '2009', 'A');
insert into takes values ('12345', 'CS-315', '1', 'Spring', '2010', 'A');
insert into takes values ('12345', 'CS-347', '1', 'Fall', '2009', 'A');
insert into takes values ('19991', 'HIS-351', '1', 'Spring', '2010', 'B');
insert into takes values ('23121', 'FIN-201', '1', 'Spring', '2010', 'C+');
insert into takes values ('44553', 'PHY-101', '1', 'Fall', '2009', 'B-');
insert into takes values ('45678', 'CS-101', '1', 'Fall', '2009', 'F');
insert into takes values ('45678', 'CS-101', '1', 'Spring', '2010', 'B+');
insert into takes values ('45678', 'CS-319', '1', 'Spring', '2010', 'B');
insert into takes values ('54321', 'CS-101', '1', 'Fall', '2009', 'A-');
insert into takes values ('54321', 'CS-190', '2', 'Spring', '2009', 'B+');
insert into takes values ('55739', 'MU-199', '1', 'Spring', '2010', 'A-');
insert into takes values ('76543', 'CS-101', '1', 'Fall', '2009', 'A');
insert into takes values ('76543', 'CS-319', '2', 'Spring', '2010', 'A');
insert into takes values ('76653', 'EE-181', '1', 'Spring', '2009', 'C');
insert into takes values ('98765', 'CS-101', '1', 'Fall', '2009', 'C-');
insert into takes values ('98765', 'CS-315', '1', 'Spring', '2010', 'B');
insert into takes values ('98988', 'BIO-101', '1', 'Summer', '2009', 'A');
insert into takes values ('98988', 'BIO-301', '1', 'Summer', '2010', null);
insert into advisor values ('00128', '45565');
insert into advisor values ('12345', '10101');
insert into advisor values ('23121', '76543');
insert into advisor values ('44553', '22222');
insert into advisor values ('45678', '22222');
insert into advisor values ('76543', '45565');
insert into advisor values ('76653', '98345');
insert into advisor values ('98765', '98345');
insert into advisor values ('98988', '76766');
insert into time_slot values ('A', 'M', '8', '0', '8', '50');
insert into time_slot values ('A', 'W', '8', '0', '8', '50');
insert into time_slot values ('A', 'F', '8', '0', '8', '50');
insert into time_slot values ('B', 'M', '9', '0', '9', '50');
insert into time_slot values ('B', 'W', '9', '0', '9', '50');
insert into time_slot values ('B', 'F', '9', '0', '9', '50');
insert into time_slot values ('C', 'M', '11', '0', '11', '50');
insert into time_slot values ('C', 'W', '11', '0', '11', '50');
insert into time_slot values ('C', 'F', '11', '0', '11', '50');
insert into time_slot values ('D', 'M', '13', '0', '13', '50');
insert into time_slot values ('D', 'W', '13', '0', '13', '50');
insert into time_slot values ('D', 'F', '13', '0', '13', '50');
insert into time_slot values ('E', 'T', '10', '30', '11', '45 ');
insert into time_slot values ('E', 'R', '10', '30', '11', '45 ');
insert into time_slot values ('F', 'T', '14', '30', '15', '45 ');
insert into time_slot values ('F', 'R', '14', '30', '15', '45 ');
insert into time_slot values ('G', 'M', '16', '0', '16', '50');
insert into time_slot values ('G', 'W', '16', '0', '16', '50');
insert into time_slot values ('G', 'F', '16', '0', '16', '50');
insert into time_slot values ('H', 'W', '10', '0', '12', '30');
insert into prereq values ('BIO-301', 'BIO-101');
insert into prereq values ('BIO-399', 'BIO-101');
insert into prereq values ('CS-190', 'CS-101');
insert into prereq values ('CS-315', 'CS-101');
insert into prereq values ('CS-319', 'CS-101');
insert into prereq values ('CS-347', 'CS-101');
insert into prereq values ('EE-181', 'PHY-101');
......@@ -11,7 +11,7 @@ def executePrint(s):
cur.execute(s)
print(cur.fetchall())
conn = psycopg2.connect("dbname=flightsskewed user=ubuntu")
conn = psycopg2.connect("dbname=flightsskewed user=vagrant")
cur = conn.cursor()
# run code
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment