Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Trying to solve this question but getting an error, please help me to find out an error. Here is the qurstion, i already figure out

Trying to solve this question but getting an error, please help me to find out an error.

Here is the qurstion, i already figure out for job but getting error on EMP_1

image text in transcribed

Here is my answer where i am getting an error:

create table EMP_1

( EMP_NUM CHAR(3),

EMP_LNAME VARCHAR(15), EMP_FNAME VARCHAR(15), EMP_INITIAL CHAR(1), EMP_HIREDATE DATE, JOB_CODE CHAR(3),

primary key(EMP_NUM), foreign key (JOB_CODE)

references JOB(JOB_CODE), constraint check_JOB_CODE CHECK (JOB_CODE in ('500' ,'501', '502')) );

1. Using the data dictionary below write the MySQL code that will create the table structure for both the JOB and EMP 1 tables. I expect that both primary and foreign keys are added to these tables as indicated in the data dictionary. I also expect if you use a foreign key that you create an INDEX for that foreign key Also add a CONSTRAINT CHECK or a CHECK that checks the JOB CODE in EMP 1 is either 500, 501, or 502 - remember that JOB CODE is a CHAR(3) a not a number Key Table Type Attribute (Field) Name EMP NUM EMP LNAME EMP FNAME EMP INITIAL EMP_HIREDATE JOB_CODE JOB_CODE OB DESCRIPTION JOB CHG HOUR JOB_LASTUPDATE Data Declaration CHAR(3) VARCHAR(15) VARCHAR(15) CHAR(1 DATE CHAR(3) CHAR(3) VARCHAR(25) DECIMAL(12,2) DATE EMP 1 PK FK OB PK

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_2

Step: 3

blur-text-image_3

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

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

0262660709, 978-0262660709

More Books

Students also viewed these Databases questions

Question

Why is Accumulated Depreciation an asset account?

Answered: 1 week ago

Question

How does the EEOC define sexual harassment?

Answered: 1 week ago