Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I AM HAVING ERROR ON EMPLYOEE TABLE WHILE ADDING FORIEGN KEY, AND THE ERROR IS GIVEN IN NEXT PICTURE AB2.sqI - COMPUT...PUTERNavne (65)) REATE TABLE
I AM HAVING ERROR ON EMPLYOEE TABLE WHILE ADDING FORIEGN KEY, AND THE ERROR IS GIVEN IN NEXT PICTURE
AB2.sqI - COMPUT...PUTER\Navne (65)) REATE TABLE EMPLOYEE ( NAME VARCHAR(20) NOT NULL, Minit CHAR (1), LNAME VARCHAR (30) NOT NULL, SSN CHAR (9) NOT NULL UNIQUE, BDATE VARCHAR (25), ADDRESS VARCHAR (50), SEX CHAR (10), SALARY INT, SUPERSSN CHAR (9), DNO INT NOT NULL, PRIMARY KEY (SSN), FOREIGN KEY (SUPERSSN) REFERENCES EMPLOYEE(SSN), FOREIGN KEY (DNO) REFERENCES DEPAR WENT (DNUMBER)); INSERT INTO EMPLOYEE VALUES (30hn INSERT INTO EMPLOYEE VALUES ('Frank Foreign key 'FK EMPLOYEE O6d4e02d925162174559' references invalid table 'DEPARTMENT. INSERT INTO EMPLOYEE VALUES( JoyCe INSERT INTO EMPLOYEE VALUES (James', 'E', 'Borg', '888665555, '1e-Nov 27', 450 5tone, Houston, TX', 'M', 55000, 'MULL', 1); INSERT INTO EMPLOYEE VALUES(Jennifen', 'S', WaIlace', 98/654321, '20 Jun-31', 291 Berry, Bellaire, TX;, 'F;, 430e0, 888665555;, 4); INSERT INTO EMPLOYEE VALUES ('Ahmad', 'V', 'Jabban', '98798798/, '29-Yar 59, '980 Dallas, Houston, TX', 'M', 250e0, '987654321', 4); INSERT INTO EMPLOYEE VALUES (AIIcia', ' j ', 'Zelaya', 99988777;, 1974158 ', 3321 Castle, SPring, TX', 'F;, 2500e, '987654321', 4); CREATE TABLE DEPARTMENT DNAME VARCHAR (20) NOT NULL UNIQUE, DNUMBER INT NOT NULL UNIQUE, MGRSSN CHAR(9) NOT NULL, MGRSTARTDATE VARCHAR (20), PRIMARY KEY (DIUUMBER), FOREIGN KEY (MGRSSN) REFERENCES FMPLOYFE(SSN)); INSERT INTO DEPARTMENT VALUES (Headquarters ;,1,888665555,191 un-71'); INSERT INTO DEPARTMENT VALUES ('Administration', 4,987654321, ' 91 -Jan-85'); INSERT INTO DEPARTMENT VALUES ('Reseanch , 5,333445555,2214ay78 ); INSERT INTO DEPARTMENT VALUES ( AUtOMat1OO', 7,123456789,66.0cL95 '); ECREATE TABLE DEPENDENT (ESSN CHAR(9) NOT NULL,DEPENDENT_NAME VARCHAR(20) NOT NULL UNTQUE, SEX CHAR(10), BRATE VARCHAR(5a), RELATIONSHIP CHAR(20) NOT NULL, PRIMARY KEY (ESSN, DEPENDENT NAME), FOREIGN KEY (ISSN) REFERENCES EMPLOYEE (SSN))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started