コンピュータ インベントリ用のデータベースを作成しました。私の課題は、「Dell」や「IBM」などの特定の単語のみをフィールドに入力できるようにすることです。テーブルの作成方法は次のとおりです。
Create table computer_inventory (
assetnumber int(10) not null default 0,
manufacturer char(3) ENUM('Dell', 'IBM', 'OtherCompany') NOT NULL default ' ',
originalcost decimal(12,2) not null default 0,
currentvalue decimal(12,2) not null default 0,
boughtfrom varchar(20) not null default ' ',
instock tinyint(1) not null default 0,
currentuser varchar(20) not null default ' ',
userphonenum varchar(13) not null default ' ',
boughtdate datetime not null default '0000-00-00'
);
今度は、製造元として「DELL」または「IBM」のみを入力できるようにすることを想定しています。