|
@ -134,15 +134,14 @@ conn = psycopg2.connect(database="dev", user="username", password="password", ho |
|
|
cur = conn.cursor() |
|
|
cur = conn.cursor() |
|
|
cur.execute("SELECT id, name, address, salary from COMPANY order by id") |
|
|
cur.execute("SELECT id, name, address, salary from COMPANY order by id") |
|
|
rows = cur.fetchall() |
|
|
rows = cur.fetchall() |
|
|
print ("ID\tNAME\tADDRESS\tSALARY") |
|
|
|
|
|
|
|
|
print ("ID NAME ADDRESS SALARY") |
|
|
for row in rows: |
|
|
for row in rows: |
|
|
print (row[0], "\t", row[1], "\t", row[2], "\t", row[3]) |
|
|
print (row[0], "\t", row[1], "\t", row[2], "\t", row[3]) |
|
|
conn.close() |
|
|
conn.close() |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<kbd> |
|
|
<kbd> |
|
|
<img src="img/assignment4/mysqlins.jpeg"> |
|
|
|
|
|
|
|
|
<img src="img/assignment5/ass5-pyselect.jpg"> |
|
|
</kbd> |
|
|
</kbd> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|