Skip to content

Commit 6852866

Browse files
committed
Change product table to store 🐻
1 parent 6ad2f8c commit 6852866

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

postgres/python/main.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,26 @@
1818
f"dbname={dbname} user={user} password={password} host={host}",
1919
port=port
2020
)
21-
query = "SELECT * FROM store;"
21+
query = """
22+
SELECT * FROM store
23+
"""
2224
cursor = conn.cursor()
2325
cursor.execute(query)
2426
results = cursor.fetchall()
2527
print(results)
2628

27-
with open("products.csv", "w") as f:
29+
with open("stores.csv", "w") as f:
2830
writer = csv.writer(f)
2931
columns = [(
30-
"UPC",
31-
"DESCRIPTION",
32-
"MANUFACTURER",
33-
"CATEGORY",
34-
"SUB_CATEGORY",
35-
"PRODUCT_SIZE",
32+
"STORE_ID",
33+
"STORE_NAME",
34+
"ADDRESS_CITY_NAME",
35+
"ADDRESS_STATE_PROV_CODE",
36+
"MSA_CODE",
37+
"SEG_VALUE_NAME",
38+
"PARKING_SPACE_QTY",
39+
"SALES_AREA_SIZE_NUM",
40+
"AVG_WEEKLY_BASKETS",
3641
)]
3742
writer.writerows(columns)
3843
writer.writerows(results)

0 commit comments

Comments
 (0)