Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a script file of SQL statements that will create the tables from the following image. Include the following constraints on the tables. -The primary

Write a script file of SQL statements that will create the tables from the following image. Include the following constraints on the tables.

-The primary key field(s) of each table should be present.

-The Works relation has two foreign keys. One references Employee and the other references Project.

-The Salary, Budget, and Hours fields should be restricted to nonnegative values.

-The Loc field should be restricted to N, S, E, W (unlike Assignment #1)

-The Manager field is a foreign key referencing Employee (this is a self-reference)

image text in transcribed

Relations Note: Each table's primary key is underlined. Works Employee Emplo EmpName Dept Salary Manager 101 Alpha HR 200 202 Beta ENGR 250 303 Gamma IT 300 202 404 Delta ENGR 275 202 505 Epsilon HR 325 101 606 Zeta IT 225 404 707 Omega IT 300 303 EmplD Projld Hours 101 Red 5 101 Orange 10 101 Yellow 15 202 Green 20 202 Blue 12 303 Indigo 8 303 Violet 4 303 Red 16 404 Orange 7 404 Yellow 17 505 Green 22 505 Blue 2 505 Indigo 11 606 Violet 13 Project Projld Loc Budget Lead Red NW 1000 707 Orange NE 1100 707 Yellow sw 950 606 Green SE 900 606 Blue NW 1200 505 Indigo sw 1000 404 Violet NW 1150 303

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

What are the purposes of promotion ?

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago