
Untitled
By: a guest on
Jul 22nd, 2012 | syntax:
None | size: 0.54 KB | hits: 11 | expires: Never
Best way to store a SET bigger than 64
Spain,France,Germany
create table countries (
iso_country_code char(3) primary key,
country_name varchar(50) not null unique
);
insert into countries (country_name, iso_country_code) values
('AALAND ISLANDS', 'ALA'),
('AFGHANISTAN', 'AFG'),
('ALBANIA', 'ALB'),
...
('YEMEN', 'YEM'),
('ZAMBIA', 'ZMB'),
('ZIMBABWE', 'ZWE');
create table some_other_table_that_references_countries (
some_key ... primary key,
iso_country_code char(3) not null references countries (iso_country_code),
...
);