Anas A.

asked • 04/15/20

Write the SQL queries


HAPPY INSURANCE Database Tables


CLIENT

ClientID                              ClientName                     ClientAgent                 ClientSpouseName

C111                           Tom                     A1                   Jenny

C222                           Karin                   A1                   Bill

C333                           Cole                     A2                   Amy

C444                           Dorothy                A2       

C555                           Andy                   A3                   Amy

C666                           Tina                     A3                   Matt

C777                           Christina              A4                   Mike


AGENT

AgentID                          AgentName        AgentArea                AgentRating                     AgentYearOfHire SupervisedBy

A1                         Kate             1                     101                        1990   

A2                         Amy             2                     92                          2009             A1

A3                         Luke            3                     100                        1992   

A4                         James           3                     90                          2010             A3


AREA

AreaID                                 AreaName        AreaHQ

1                             East           Boston

2                             West          San Francisco

3                             Central       Chicago



Question #1

Show the CREATE TABLE statements for HAPPY INSURANCE database for the table CLIENT (assume that non-primary key columns can be optional) with the DELETE SET-TO-NULL and UPDATE CASCADE option for its referential integrity constraint.


Question #2

Show the CREATE TABLE statements for HAPPY INSURANCE database for the table AGENT (assume that non-primary key columns can be optional) with the user defined constraint specifying that the agent rating must be between 50 and 150.


1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.