context = '''
Index,Customer Id,First Name,Last Name,Company,City,Country,Phone 1,Phone 2,Email,Subscription Date,Website
1,D37CF93EacA6D0,Sheryl,Baxter,Rasmussen Group,East Leonard,Chile,229.077.5154,397.884.0519x718,[email protected],2020-08-24,http://www.stephenson.com/
2,1EF7b824ACAD10,Preston,Lozano,Vega-Gentry,East Jimmychester,Djibouti,5153435776,686-620-1820x944,[email protected],2021-04-23,http://www.hobbs.com/
3,6F94879bdAfE5a6,Roy,Berry,Murillo-Perry,Isabelborough,Antigua and Barbuda,+1-539-402-0259,(496)978-3969x58947,[email protected],2020-03-25,http://www.lawrence.com/
4,5CFE8FAB1E56e3c,Linda,Olsen,"Dominguez, Mcmillan and Donovan",Bensonview,Dominican Republic,001-808-617-6467x12895,+1-813-324-8756,[email protected],2020-06-02,http://www.good-lyons.com/
5,053d5B5Ab61359,Joanna,Bender,"Martin, Lang and Andrade",West Priscilla,Slovakia (Slovak Republic),001-234-203-0635x76146,001-199-4460-3860x3486,[email protected],2021-04-17,https://goodwin-ingram.com/
6,2d08F817E2E73F4,Aimee,Downs,Steele Group,Chavezborough,Bosnia and Herzegovina,(283)437-3886x88321,999-728-1637,[email protected],2020-02-25,http://www.berger.net/
'''
prompt = f"""
Using the CSV data below, write SQL to:
1. Create a table `customers`.
2. Insert all rows.
3. Select customers where country = 'Chile'.
Also, show the expected query result.
```{context}```
"""
raw = get_code_completion(prompt, "sql")
sql_code = cleanup_code(raw, "sql")
print(sql_code)
```text
Sample output:
```sql
CREATE TABLE customers (
id INT PRIMARY KEY,
customer_id VARCHAR(50),
first_name VARCHAR(50),
last_name VARCHAR(50),
company VARCHAR(100),
city VARCHAR(50),
country VARCHAR(50),
phone_1 VARCHAR(30),
phone_2 VARCHAR(30),
email VARCHAR(100),
subscription_date DATE,
website VARCHAR(200)
);
INSERT INTO customers (id, customer_id, first_name, last_name, company, city, country, phone_1, phone_2, email, subscription_date, website) VALUES
(1, 'D37CF93EacA6D0', 'Sheryl', 'Baxter', 'Rasmussen Group', 'East Leonard', 'Chile', '229.077.5154', '397.884.0519x718', '[email protected]', '2020-08-24', 'http://www.stephenson.com/'),
-- (remaining rows omitted for brevity)
;
SELECT * FROM customers WHERE country = 'Chile';
-- Possible outcome:
-- 1 | D37CF93EacA6D0 | Sheryl | Baxter | Rasmussen Group | East Leonard | Chile | 229.077.5154 | 397.884.0519x718 | zunigavanessa@smith.in | 2020-08-24 | http://www.stephenson.com/