#!/usr/bin/env python3
"""
Check database information for restaurant scraping
"""

from sqlalchemy import create_engine, text
from urllib.parse import quote_plus

def check_db_info():
    """Check existing companies and currencies"""
    DATABASE_URL = f"postgresql://postgres:{quote_plus('F@f@k0s!!')}@localhost:5432/bookbeach"
    engine = create_engine(DATABASE_URL)
    
    with engine.connect() as db:
        # Check companies
        companies = db.execute(text('SELECT company_id, company_name FROM companies LIMIT 10')).fetchall()
        print('Companies:')
        for company in companies:
            print(f'  {company[0]} - {company[1]}')
        
        # Check currencies
        currencies = db.execute(text('SELECT currency_id, currency_code, currency_symbol FROM currencies')).fetchall()
        print('\nCurrencies:')
        for currency in currencies:
            print(f'  {currency[0]} - {currency[1]} ({currency[2]})')
        
        # Check Athens beach places
        athens_beaches = db.execute(text("SELECT beach_place_id, beach_name FROM beach_places WHERE city ILIKE '%athens%' LIMIT 5")).fetchall()
        print('\nAthens Beach Places:')
        for beach in athens_beaches:
            print(f'  {beach[0]} - {beach[1]}')

if __name__ == '__main__':
    check_db_info()