Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I am currently in an Intro to Database class and I am learning the basics of SQL at the moment. I am currently working

Hi,

I am currently in an Intro to Database class and I am learning the basics of SQL at the moment. I am currently working on an assignment and I am getting an error for when I am entering values into the data tables. The error is ORA-02291: integrity constraint (SQL_DEIJPYXRBUPSAXYFLBNFLXZED.SYS_C001408692) violated - parent key not found ORA-06512: at "SYS.DBMS_SQL", line 1721 . I am stuck and not sure what to do right now; I have posted the assignment and the code I have so far. I appreciate the help!

Thanks!

Assignment

image text in transcribed

Code:

CREATE Table store ( storeid VARCHAR (3) NOT NULL, storezip CHAR (5) NOT NULL, PRIMARY KEY (storeid));

CREATE Table employee ( employeeid VARCHAR(5) NOT NULL, employeefname VARCHAR(25) NOT NULL, employeelname VARCHAR(25) NOT NULL, storeid VARCHAR(3) NOT NULL, PRIMARY KEY (employeeid), FOREIGN KEY (storeid) REFERENCES store(storeid) ); INSERT INTO employee VALUES ('E1234' , 'George', 'Loocas','S1'); INSERT INTO employee VALUES ('E1235', 'Steven', 'Speelberg', 'S2');

Assume that you will need to create one more table in your database for keeping track of employees who work in the store. Each store will have many employees and each employee works in a particular store. StorelQ StoreZip EmployeeFName STORE EMPLOYEE has EmployeeLName Create the Employee table assuming EmploveelD can be captured using five characters, employee first name and last name can be captured using 25 characters. Make sure to include StoreID as the the foreign key field in the Employee table pointing to Storell field in the Store table. 1. SQL Enter two records for Employees with the following data: Employee ID, Employee First Name, Employee Last Name, Storen E1234 George, Lgocas, S1 E1235, Steven, Speelberg, S2

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

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

1680838482, 978-1680838480

More Books

Students also viewed these Databases questions

Question

Food supply

Answered: 1 week ago