18 lines
612 B
Python
18 lines
612 B
Python
import oracledb
|
|
conn = oracledb.connect(user='sisvietnam', password='sisvietnam', dsn='localhost:1521/sisvietnam')
|
|
cursor = conn.cursor()
|
|
|
|
cursor.execute("SELECT count(*) FROM sis_post WHERE category_id IS NOT NULL")
|
|
print(f"Posts with category: {cursor.fetchone()[0]}")
|
|
|
|
cursor.execute("SELECT count(*) FROM sis_post WHERE category_id IS NULL")
|
|
print(f"Posts without category: {cursor.fetchone()[0]}")
|
|
|
|
cursor.execute("SELECT count(*) FROM sis_tag")
|
|
print(f"Total tags: {cursor.fetchone()[0]}")
|
|
|
|
cursor.execute("SELECT count(*) FROM sis_post_tag")
|
|
print(f"Post-Tag links: {cursor.fetchone()[0]}")
|
|
|
|
conn.close()
|