from sqlalchemy import create_engine
import pymysql
import pandas as pd
import numpy as np

pymysql.install_as_MySQLdb()
engine = create_engine("mysql+mysqldb://root:"+"swhacademy!"+"@dev-swh.ga/market", encoding='utf-8')
conn = engine.connect()

df = pd.read_sql_query("select * from stock_trade where 종목코드 = '000660'", conn)
print(df)
df.to_csv("skhynix.csv", mode='w', header=None, index = False)