#!/usr/bin/env python3
"""
지황 관련 약재 찾기
"""

import sqlite3

conn = sqlite3.connect('database/kdrug.db')
cursor = conn.cursor()

# 지황 관련 약재 검색
cursor.execute("""
    SELECT ingredient_code, herb_name, herb_name_hanja
    FROM herb_masters
    WHERE herb_name LIKE '%지황%'
       OR herb_name LIKE '%생지%'
       OR herb_name LIKE '%건지%'
       OR herb_name LIKE '%숙지%'
    ORDER BY herb_name
""")

results = cursor.fetchall()

print("🌿 지황 관련 약재 검색 결과:")
print("="*60)
for code, name, hanja in results:
    print(f"{code}: {name} ({hanja})")

conn.close()