Question: 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

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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!