This document contains SQL commands that create tables for a database to store person information including name, email, phone number, and type. The tables are person, emailaddress, phonenumbertype, and personphone. Primary keys are set for each table and foreign key constraints are created to link the tables together based on business entity ID and phone number type ID.
This document contains SQL commands that create tables for a database to store person information including name, email, phone number, and type. The tables are person, emailaddress, phonenumbertype, and personphone. Primary keys are set for each table and foreign key constraints are created to link the tables together based on business entity ID and phone number type ID.
This document contains SQL commands that create tables for a database to store person information including name, email, phone number, and type. The tables are person, emailaddress, phonenumbertype, and personphone. Primary keys are set for each table and foreign key constraints are created to link the tables together based on business entity ID and phone number type ID.
businessentityid int not null primary key, persontype char(2) not null, namestyle bit not null, title varchar(8) null, firstname varchar(50) not null, middlename varchar(50) null, lastname varchar(50) not null, suffix varchar(10) null, emailpromotion int not null, modifieddate datetime not null, )
create table emailaddress(
businessentityid int not null primary key, emailaddressid int identity(1,1), emailaddress varchar(50) null, modifieddate datetime not null foreign key(businessentityid) references person(businessentityid) )
create table phonenumbertype(
phonenumbertypeid int identity primary key, name varchar(50) not null, modifieddate datetime not null, )
create table personphone(
businessentityid int not null primary key, phonenumber varchar(25) not null, phonenumbertypeid int not null, modifieddate datetime not null, foreign key(businessentityid) references person(businessentityid) )