*******************MYSQL:
CREATE TABLE T_Person (FName VARCHAR(20),FAgeINT,FRemark VARCHAR(20),PRIMARY
KEY (FName));
CREATE TABLE T_Debt (FNumber VARCHAR(20),FAmountDECIMAL(10,2) NOT NULL,
FPerson VARCHAR(20),PRIMARY KEY (FNumber),
FOREIGN KEY (FPerson) REFERENCES T_Person(FName)) ;
*******************MSSQLServer:
CREATE TABLE T_Person (FName VARCHAR(20),FAgeINT,FRemark VARCHAR(20),PRIMARY
KEY (FName));
CREATE TABLE T_Debt (FNumber VARCHAR(20),FAmountNUMERIC(10,2) NOT NULL,
FPerson VARCHAR(20),PRIMARY KEY (FNumber),
FOREIGN KEY (FPerson) REFERENCES T_Person(FName)) ;
**********************Oracle:
CREATE TABLE T_Person (FName VARCHAR2(20),FAgeNUMBER(10) ,FRemark
VARCHAR2(20),PRIMARY KEY (FName)) ;
CREATE TABLE T_Debt (FNumber VARCHAR2(20),FAmountNUMERIC(10,2) NOT NULL,
FPerson VARCHAR2(20),PRIMARY KEY (FNumber),
FOREIGN KEY (FPerson) REFERENCES T_Person(FName)) ;
***********************DB2:
CREATE TABLE T_Person (FName VARCHAR(20) NOT NULL,FAgeINT, FRemark VARCHAR(20),PRIMARY KEY (FName));
CREATE TABLE T_Debt (FNumber VARCHAR(20) NOT NULL,FAmountDECIMAL(10,2) NOT
NULL, FPerson VARCHAR(20),PRIMARY KEY (FNumber),
FOREIGN KEY (FPerson) REFERENCES T_Person(FName)) ;
其中主键字段FName为人员姓名,FAge为年龄,而FRemark则为备注信息;
T_Debt 记录了债务信息,其中主键字段FNumber为债务编号,FAmount为欠债金额,FPerson字段为欠债
人姓名,FPerson字段与T_Person中的FName字段建立了外键关联关系。