The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
This is a test document of the assignment I'm working on. This is a SQL DB project, and I'm trying to create a table and define constraints to my primary and foreign keys. However, when I'm testing the file, I get an error stating, "
ERROR 1072 (42000) at line 23: Key column 'Customer_ID' doesn't exist in table"
I've tried determining if it was how I declared the Primary Key, but I can't figure where I went wrong with the defining. Any help in getting this resolved will be great.
Â
DROP TABLE IF EXISTS Customers;DROP TABLE IF EXISTS Employees;DROP TABLE IF EXISTS Technician;DROP TABLE IF EXISTS Services;CREATE TABLE Customers(Customer_ID INT,First_Name VARCHAR (25) NOT NULL,Last_Name VARCHAR (25) NOT NULL,Street_Address VARCHAR (50) NOT NULL,City VARCHAR(25) NOT NULL,State VARCHAR(2) NOT NULL,Zip INT NOT NULL,Phone_Number INT NOT NULL,CONSTRAINT Customers_pkPRIMARY KEY(Customer_ID));CREATE TABLE Employees(Employee_ID INT,First_Name VARCHAR(25) NOT NULL,Last_Name VARCHAR(25) NOT NULL,Street_Address VARCHAR(50) NOT NULL,City VARCHAR(25) NOT NULL,State VARCHAR(2) NOT NULL,Zip INT NOT NULL,Wage DECIMAL(10,2) NOT NULL,CONSTRAINT Employees_pkPRIMARY KEY(Employee_ID),CONSTRAINT Employees_fk_CustomersFOREIGN KEY (Customer_ID) REFERENCES Customers (Customer_ID),--FOREIGN KEY (Service_ID_fk) REFERENCES Services (Service_ID));
Attachments:
-----------