This is the code and notes from my live Twitch programming and drawing classes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
streaming-school/python/code/module-4/euro_migrate.sql

14 lines
386 B

DROP TABLE IF EXISTS currency;
CREATE TABLE currency (id INTEGER PRIMARY KEY
AUTOINCREMENT NOT NULL, currency TEXT);
ALTER TABLE rate ADD COLUMN currency_id INTEGER;
INSERT INTO currency (currency) SELECT currency FROM rate GROUP BY
currency;
UPDATE rate SET currency_id = currency.id FROM currency WHERE
rate.currency = currency.currency;
ALTER TABLE rate DROP COLUMN currency;