规范化实例
为了说明方便,我们在本文中将使用一个SAMPLE数据表,来一步一步分析规范化的过程。
首先,我们先来生成一个的最初始的表。
CREATE TABLE "SAMPLE" ( "PRJNUM" INTEGER NOT NULL, "PRJNAME" VARCHAR(200), "EMYNUM" INTEGER NOT NULL, "EMYNAME" VARCHAR(200), "SALCATEGORY" CHAR(1), "SALPACKAGE" INTEGER) IN "USERSPACE1"; ALTER TABLE "SAMPLE" ADD PRIMARY KEY ("PRJNUM", "EMYNUM"); Insert into SAMPLE(PRJNUM, PRJNAME, EMYNUM, EMYNAME, SALCATEGORY, SALPACKAGE) values(100001, 'TPMS', 200001, 'Johnson', 'A', 2000), (100001, 'TPMS', 200002, 'Christine', 'B', 3000), (100001, 'TPMS', 200003, 'Kevin', 'C', 4000), (100002, 'TCT', 200001, 'Johnson', 'A', 2000), (100002, 'TCT', 200004, 'Apple', 'B', 3000); |
文章来源于领测软件测试网 https://www.ltesting.net/