# -*- coding: utf-8 -*-
import sqlite3

conn = sqlite3.connect('db/orders.db')

# 테이블 목록
tables = conn.execute("SELECT name FROM sqlite_master WHERE type='table'").fetchall()
print('=== orders.db 테이블 ===')
for t in tables:
    count = conn.execute(f'SELECT COUNT(*) FROM {t[0]}').fetchone()[0]
    print(f'  {t[0]}: {count}개 레코드')

conn.close()
