Question

Hi I have the following Code and it Keeps giving me This Error in EDUPE: ERROR...

Hi I have the following Code and it Keeps giving me This Error in EDUPE: ERROR 1064 (42000) at line 1.

Here is the Code I need to create a database with:

DROP TABLE IF EXISTS Order;
DROP TABLE IF EXISTS Customer;
DROP TABLE IF EXISTS Employee;
DROP TABLE IF EXISTS Payment;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS InventoryReport;
DROP TABLE IF EXISTS DistributionChannel;

-- Table structure for table `Order`

CREATE TABLE Order
(Order_Number INT(100) PRIMARY KEY,
Product_Id VARCHAR(25) NOT NULL,
Quanity INT(100) NOT NULL,
Ship_Date DATE);

-- Data for table `Order`

INSERT INTO `Order` VALUES
(OrderNumber, ProductId, Quantity, ShipDate)
(2067980, '5678', '1', '2019-05-02'),
(2070369, '6867', '2', '2019-09-06'),
(2039542, '4652', '10', '2019-11-30');

-- table structure for `Employee`

CREATE TABLE Employee
(EmployeeID INT(15) PRIMARY KEY,
EmployeeFirstName VARCHAR(25) NOT NULL,
EmployeeLastName VARCHAR(25) NOT NULL,
EmployeeAddress VARCHAR(45) NOT NULL,
EmployeeCity VARCHAR(25) NOT NULL,
EmployeeZipcode VARCHAR(25) NOT NULL,
EmployeeState VARCHAR(25) NOT NULL);

INSERT INTO Employee VALUES
(EmployeeID, FirstName, LastName, Address, City, State, Zipcode)

(2468, 'Jason', 'Harmon', '10 Western Court', 'Howell', 'NJ', '07731'),

(2469, 'Gary', 'Hodgens', '1 Lewis Street', 'Secaucus', 'NJ', '07094'),

(2461, 'Mayla', 'Slate', '18 Sand Road', 'Milltown', 'NJ', '08850');


-- Table structure for table `Customer`

CREATE TABLE Customer
(CustomerID INT(35) PRIMARY KEY,
CustomerFirstName VARCHAR(25),
CustomerLastName VARCHAR(25) NOT NULL,
CustomerAddress VARCHAR(45) NOT NULL,
CustomerState VARCHAR(25),
CustomerZip INT(20) NOT NULL);

-- Data for table `Customer`
INSERT INTO Customer VALUES
(CustomerID, FirstName, LastName, Address, City, State, Zipcode, CustomerAcountNumber)

(01234, ‘John’, ‘Smith’, ‘3 Evergreen Drive’, ‘Nutley’, ‘NJ’, ‘9950’),

(01235, ‘Dave’, ‘Tee’, ‘6 Devry Road’, ‘Naperville’, ‘IL’, ‘60563’, ‘9961’),

(01236, ‘Jane’, ‘White’, ‘9 Conover Avenue’, ‘Arlington’, ‘VA’, ‘22202’, ‘9982’);


-- Table structure for table ‘Product’

CREATE TABLE Product
(ProductNumber INT(10) PRIMARY KEY,
ProductName VARCHAR(50) NOT NULL,
ProductModel VARCHAR(25),
ProductPrice Decimal(10),
Manufatcurer VARCHAR(25));

-- Data for table `Product`

INSERT INTO Product VALUES
(ProductNumber, Name, Model, Price, Brand)

(5678, 'TV', '60inch', '350', 'LG'),

(4652, 'Laptop', '17inch', '400', 'Toshiba'),

(6867, 'Radio', 'CDPlayer', '150', 'Bose');


-- Table structure for table `InventoryReport`

CREATE TABLE InventoryReport
(ItemNumber VARCHAR (25) PRIMARY KEY,
ItemSold INT(25) NOT NULL,
ItemsOnHand INT(500) NOT NULL,
BackOrdered VARCHAR(500));

-- Data for table `InventoryReport`

INSERT INTO InventortyReport VALUES
(ItemNumber, ItemSold, ItemsOnHand, BackOrdered)

(5678, '1', '100', '200'),

(6867, '2', '50', '150'),

(4652, '10', '300', '400');

-- Table structure for table `DistributionCannel`

CREATE TABLE DistributionChannel
(TrackingNumber VARCHAR(35) PRIMARY KEY,
CarrierName VARCHAR(45) NOT NULL,
CarrierType VARCHAR(45));

-- Data for table `DistributionChannel`
INSERT INTO 'DistributionChannel' VALUES
(TrackingNumber, CarrierName, CarrierType)

(6694, 'Fedex', 'Truck'),

(6695, 'UPS', 'Van'),

(6696, 'USPS', 'Car');


-- Table structure for table `Payment`

CREATE TABLE Payment
(CustomerAcountNumber INT(50) NOT NULL,
PaymentType VARCHAR(25),
Total Decimal (20));

-- Data for table `Payment`
INSERT INTO 'Payment' VALUES
(CustomerAcountNumber, PaymentType, Total)

(9950, 'Visa', '100.00'),

(9961, 'Echeck', '25.00'),

(9982, 'Mastercard', '32.00');


Select * from Order;
Select * from Customer;
Select * from Employee;
Select * from Payment;
Select * from Product;
Select * from InventoryReport;
Select * from DistributionChannel;

Please take a look as I am stumped on this error.

This Is using MSQL

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CREATE TABLE Orders(OrderNumber INT (100) Primary Key,ProductId VARCHAR (25) NOT NULL,Quanity INT(100) NOT NULL,ShipDate DATE );

INSERT INTO Orders VALUES(2067980, '5678', '1' , '05-02-2019');
INSERT INTO Orders VALUES(2070369,'6867','2','09-06-2019');
INSERT INTO Orders VALUES(2039542, '4652', '10', '11-30-2019');

CREATE TABLE Employee(EmployeeID INT(15) Primary KEY,EmployeeFirstName VARCHAR (25) NOT NULL,EMployeeLastName VARCHAR (25) NOT NULL,
EmployeeAddress VARCHAR (45) NOT NULL,EmployeeCity VARCHAR (25) NOT NULL,EmployeeState VARCHAR (25) NOT NULL,Zipcode VARCHAR (25) NOT NULL);

INSERT INTO `Employee` VALUES(2468, 'Jason', 'Harmon', '10 Western Court', 'Howell', 'NJ', '07731');

INSERT INTO `Employee` VALUES(2469, 'Gary', 'Hodgens', '1 Lewis Street', Secaucus', 'NJ', '07094');

INSERT INTO `Employee` VALUES(2461, 'Mayla', 'Slate', '18 Sand Road', 'Milltown', 'NJ', '08850');

CREATE TABLE Customer( CustomerID int (35) PRIMARY KEY,CustomerFirstName varchar (25),CustomerLastName varchar (25) NOT NULL,
CustomerAddress varchar (45) NOT NULL,CustomerState varchar (25),CustomerZip int (20) NOT NULL) ;

INSERT INTO Customer VALUES(01234, 'John', 'Smith', '3 Evergreen Drive', 'NJ', '9950');
INSERT INTO Customer VALUES(01235, 'Dave', 'Tee', '6 Devry Road', 'IL', '9961');
INSERT INTO Customer VALUES(01236, 'Jane', 'White', '9 Conover Avenue', 'VA', '9982');

CREATE TABLE Product(ProductNumber INT (10) PRIMARY KEY,ProductName VARCHAR(50) NOT NULL,ProductModel VARCHAR (25),ProductPrice Decimal (10),
Manufatcurer VARCHAR (25));

INSERT INTO Product VALUES(5678, 'TV', '60inch', '350', 'LG');
INSERT INTO Product VALUES(4652, 'Laptop', '17inch', '400', 'Toshiba');
INSERT INTO Product VALUES(6867, 'Radio', 'CDPlayer', '150', 'Bose');


CREATE TABLE InventoryReport(ItemNumber VARCHAR (25) PRIMARY KEY,ItemSold int(25) NOT NULL,ItemsOnHand int (500) NOT NULL,
BackOrdered varchar(500)) ;

INSERT INTO InventoryReport VALUES(5678, '1', '100', '200');
INSERT INTO InventoryReport VALUES(6867, '2', '50', '150');
INSERT INTO InventoryReport VALUES(4652, '10', '300', '400');

CREATE TABLE DistributionChannel( TrackingNumber VARCHAR (35) Primary Key,CarrierName VARCHAR (45) NOT NULL,CarrierType VARCHAR (45)) ;

INSERT INTO DistributionChannel VALUES(6694, 'Fedex', 'Truck');
INSERT INTO DistributionChannel VALUES(6695, 'UPS', 'Van');
INSERT INTO DistributionChannel VALUES(6696, 'USPS', 'Car');

CREATE TABLE Payment( CustomerAcountNumber INT(50) NOT NULL,PaymentType VARCHAR (25),Total Decimal (20));

INSERT INTO Payment VALUES(9950, 'Visa','100.00');
INSERT INTO Payment VALUES(9961, 'Echeck','25.00');
INSERT INTO Payment VALUES(9982, 'Mastercard', '32.00');

Select * from Orders;

Select * from Customer;

Select * from Employee;

Select * from Payment;

Select * from Product;

Select * from InventoryReport;

Select * from DistributionChannel;

Add a comment
Know the answer?
Add Answer to:
Hi I have the following Code and it Keeps giving me This Error in EDUPE: ERROR...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need to add constraints but I am unsure how. I also need FK in this...

    I need to add constraints but I am unsure how. I also need FK in this script. Does that make sense. CREATE TABLE Orders(OrderNumber INT (100) Primary Key,ProductId VARCHAR (25) NOT NULL,Quanity INT(100) NOT NULL,ShipDate DATE ); INSERT INTO Orders VALUES(2067980, '5678', '1' , '05-02-2019'); INSERT INTO Orders VALUES(2070369,'6867','2','09-06-2019'); INSERT INTO Orders VALUES(2039542, '4652', '10', '11-30-2019'); CREATE TABLE Employee(EmployeeID INT(15) Primary KEY,EmployeeFirstName VARCHAR (25) NOT NULL,EMployeeLastName VARCHAR (25) NOT NULL, EmployeeAddress VARCHAR (45) NOT NULL,EmployeeCity VARCHAR (25) NOT NULL,EmployeeState VARCHAR...

  • This script isn't working with SQL Server 2012, It keeps giving me an error of: There...

    This script isn't working with SQL Server 2012, It keeps giving me an error of: There is already an object named 'CustomerID' in the database. PLEASE HELP- What do I need to do????? CREATE TABLE [CustomerID] ( [CustomerID] int, [LastName] varchar(25), [FirstName] varchar(25), [PhoneNumber] varchar(10), [Address] varchar(75), [City] varchar(25), [Zip] int, [ServiceTicketID] int, PRIMARY KEY ([CustomerID]) ); CREATE INDEX [FK] ON [CustomerID] ([ServiceTicketID]); CREATE TABLE [ServiceTicket] ( [ServiceTicketID] int, [DateOfService] varchar(25), [Notes] varchar(100), [CustomerID] int, [PartsUsedID] int, PRIMARY KEY ([ServiceTicketID])...

  • I need help with the following SQL query for a company database (script given below). The...

    I need help with the following SQL query for a company database (script given below). The name of the Department. The number of employees working in that department. The number of different projects controlled by this department. The name of the project controlled by this department that has the maximum number of employees of the company working on it. The number of the above project. The cumulative sum of the number of employees of the company working on the projects...

  • Database Management 6. [5] Create the following table: CREATE TABLE customer ( cust_name VARCHAR(30) NOT NULL,...

    Database Management 6. [5] Create the following table: CREATE TABLE customer ( cust_name VARCHAR(30) NOT NULL, address VARCHAR(60), UNIQUE (cust name, address)); A. Run the following inserts and explain why both work and how will you prevent it INSERT INTO customer VALUES ('Alex Doe', NULL); INSERT INTO customer VALUES ('Alex Doe', NULL); 7. [5] Modify the following table definition to ensure that all employees have a minimum wage of $10 CREATE TABLE employee ( empId INT PRIMARY KEY, empName VARCHAR(40)...

  • a database of employees that corresponds to the employee-payroll hierarchy is provided (see employees.sql to create...

    a database of employees that corresponds to the employee-payroll hierarchy is provided (see employees.sql to create the employees for a MySQL database). Write an application that allows the user to: Add employees to the employee table. Add payroll information to the appropriate table for each new employee. For example, for a salaried employee add the payroll information to the salariedEmployees table 1 is the entity-relationship diagram for the employees database Figure 1: Table relationships in the employees database [1]. Add...

  • /* I am executing following SQL statement for the below code but I am getting error....

    /* I am executing following SQL statement for the below code but I am getting error. Pls, upload screenshot after running it. SQL Statement: SELECT OfferNo, CourseNo FROM Offering WHERE OfferTerm = 'Sum' AND OfferYear = 2012 AND FacSSN IS NULL; */ CREATE TABLE STUDENT( StdSSN INT NOT NULL PRIMARY KEY, StdFName VARCHAR2(50), StdLName VARCHAR2(50), StdCity VARCHAR2(50), StdState VARCHAR2(2), StdZip VARCHAR2(10), StdMajor VARCHAR2(15), StdYear VARCHAR2(20) ); CREATE TABLE FACULTY( FacSSN INTEGER NOT NULL PRIMARY KEY, FacFName VARCHAR(50), FacLName VARCHAR(50), FacCity...

  • I keep getting this error "You have an error in your SQL syntax; check the manual...

    I keep getting this error "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4" line 4 is the "Genre char(20) not null," any help or guidance would be lovely create table Games      (gameid int not null auto_increment primary key,       title varchar(100) not null,       Genre char(20) not null,       year_released int not null);      insert into Games(title, Genre,...

  • Someone Please Help Me modify this in PHP I'm in desperate need I cant figure this out ... Make t...

    Someone Please Help Me modify this in PHP I'm in desperate need I cant figure this out ... Make the following modifications: For the vendors table: Comment out the table-level primary key Change the VendorIDcolumn to be a column-level primary key Add a VendorEmail column to the bottom of the table definition (define the data type for the column as variable character and set it to not exceed 45 characters) After the lineItems table, add code to create a table...

  • NEED HELP IN INSERT STATEMENTS FOR THE TABLES CAN YOU PLEASE ADD SOME INSERT STATEMENTS FOR...

    NEED HELP IN INSERT STATEMENTS FOR THE TABLES CAN YOU PLEASE ADD SOME INSERT STATEMENTS FOR A COMPANY SCHEMA SCRIPT. PLEASE ADN THANK YOU DROP TABLE dependent; DROP TABLE works_on; DROP TABLE project; DROP TABLE dept_locations; DROP TABLE department; DROP TABLE employee; CREATE TABLE employee ( fname varchar(15) not null, minit varchar(1), lname varchar(15) not null, ssn char(9), bdate date, address varchar(50), sex char, salary numeric(10,2), superssn char(9), dno numeric, primary key (ssn), foreign key (superssn) references employee(ssn) ); CREATE...

  • SQL I have a database CREATE TABLE vendor ( vid CHAR(2) NOT NULL, vname VARCHAR(25) NOT...

    SQL I have a database CREATE TABLE vendor ( vid CHAR(2) NOT NULL, vname VARCHAR(25) NOT NULL, PRIMARY KEY (vid) ); CREATE TABLE category ( catid CHAR(2) NOT NULL, catname VARCHAR(25) NOT NULL, PRIMARY KEY (catid) ); CREATE TABLE product ( pid CHAR(3) NOT NULL, pname VARCHAR(25) NOT NULL, price NUMERIC (7,2) NOT NULL, vid CHAR(2) NOT NULL, categoryid CHAR(2) NOT NULL, PRIMARY KEY (pid)); CREATE TABLE region ( rid CHAR NOT NULL, rname VARCHAR(25) NOT NULL, PRIMARY KEY (rid)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT