Initial commit: 商品售卖网站
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import sqlite3
|
||||
conn = sqlite3.connect('backend/sale.db')
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("SELECT id, name FROM categories")
|
||||
print("Categories in database:")
|
||||
for row in cursor.fetchall():
|
||||
print(f" ID: {row[0]}, Name: {row[1]}")
|
||||
|
||||
cursor.execute("SELECT product_id, category_id FROM product_categories")
|
||||
print("\nProduct-Category relations:")
|
||||
for row in cursor.fetchall():
|
||||
print(f" Product ID: {row[0]}, Category ID: {row[1]}")
|
||||
Reference in New Issue
Block a user