from my_functions import open_basiccrud_db
from my_functions import close_database

conn, cursor = open_basiccrud_db()
sql = '''CREATE TABLE IF NOT EXISTS invoices
       (
           id INTEGER PRIMARY KEY,
           name TEXT,        
           date TEXT,
           total INTEGER            
       )'''
cursor.execute(sql)
conn.commit()

params = [
    ('Miura Naoya', '2022/5/8', '580'),
    ('Noda Yurika', '2022/5/8', '580'),
    ('Noda Yurika', '2022/5/30', '5250'),
    ('Noda Yurika', '2022/6/18', '2500'),
    ('Noda Yurika', '2022/6/29', '880'),
    ('Miura Naoya', '2022/6/30', '1160'),
]
sql = '''
    INSERT INTO invoices(name,date,total) 
    VALUES(?,?,?)
'''
cursor.executemany(sql, params)
conn.commit()
close_database(cursor,conn)