Map the following ER diagram to relations by writing SQL statements to capture a
ID: 671327 • Letter: M
Question
Map the following ER diagram to relations by writing SQL statements to capture as many of the constraints as possible. If you cannot capture some constraints, explain why.
FILE DESIGN REVIEW VI HOME Cut Copy Format Painter INSERT VIEW Sign in Find AaBbCcC AaBbCcI AaBbCcI ac Replace Paste :, 2 m | TNormal TNoSpac Heading 1 Heading 2 Title Subtitle Subtle Em Emphasis Select Clipboard Font Paragraph Styles Editing phone ame location name birthday ID salary Employees Has Childrern comnission bonus Salespersons salePrice saleDate Sales Cars madeYear serialINO manufacturer model PAGE 3 OF 5 609 WORDS Lx + 100% 7:01 AM 10/2/2015 Search the web and Windows 2)/»)Explanation / Answer
create table Employees (
ID primary key,
name varchar2(20),
phone varchar2(20),
location varchar2(100),
salary decimal(10,2)
);
create table Children (
name varchar2(20),
birthday DATETIME,
foreign key (name) references Emloyees(name)
);
create table Salespersons(
commission decimal(10,2),
bonus decimal(10,2)
);
create table Sales(
saleDate DATETIME,
salePrice decimal(10,2)
);
create table Cars(
madeYear DATETIME,
manufacturer varchar2(10),
model varchar2(10),
serialNo In
);