国別の送料テーブル テーブル作成とデータ投入を以下のSQLで行います。 -- テーブル作成 create table postage_table ( id serial primary key, country_code varchar(2) not null, postage int default 0 ); -- データ投入 insert into postage_table (country_code, postage) values ('US', 100), ('JP', 101), ('XX', 999); 国コードを指定してデータを取得するSQLは一番単純に考えると以下のようになると思います。 select * from postage_table where country_code = 'JP'; id | country_code | postage ----+-----
