this  sql code is wrong  ,can someone help me see whats the wrong with this code ? CREATE TABLE SALES ( ProductID int not null, MCampID int not null, PayMethodID int not null, DateID int not null, StoreID int not null, EmployeeID int not null, CustomerID int not null, DemogrGrID int not null, SurrogateID int, PurchaseTransactionID int not null, AgeGroupName varchar(30) not null, Quantity int not null, Amount decimal(6,2) default 0.00, Taxes decimal(6,2) default 0.00, DiscountType decimal(6,2) default 0.00, Cost_ decimal(6,2) default 0.00, Profit decimal(6,2) default 0.00, EmployeeName varchar(30) not null, EmployeeGender varchar(30) not null, CustomerName varchar(30) not null, CustomerGender varchar(30) not null, PRIMARY KEY (SurrogateID), CONSTRAINT CHK_Amount CHECK (Amount >= 0), CONSTRAINT CHK_Taxes CHECK (Taxes >= 0), CONSTRAINT CHK_Cost CHECK (Cost_ >= 0), CONSTRAINT CHK_Profit CHECK (Profit >= 0), CONSTRAINT fk_Product FOREIGN KEY (ProductID) REFERENCES PRODUCTS (ProductID), CONSTRAINT fk_MCamp FOREIGN KEY (MCampID) REFERENCES MARKETING_CAMPAIGN (MCampID), CONSTRAINT fk_PayMethod FOREIGN KEY (PayMethodID) REFERENCES PAYMENT_METHODS (PayMethodID), CONSTRAINT fk_Date FOREIGN KEY (DateID) REFERENCES DATE_ (DateID), CONSTRAINT fk_Store FOREIGN KEY (StoreID) REFERENCES STORES (StoreID), CONSTRAINT fk_Employee FOREIGN KEY (EmployeeID) REFERENCES EMPLOYEE (EmployeeID), CONSTRAINT fk_Customer FOREIGN KEY (CustomerID) REFERENCES CUSTOMERS (CustomerID), CONSTRAINT fk_DemogrGr FOREIGN KEY (DemogrGrID) REFERENCES DEMOGRAFIC_GROUPS (DemogrGrID) ); Error starting at line : 269 in command - INSERT INTO SALES VALUES (1001, 8001, 0100, 020000020, 60001, 120001, 2000001, 3, 103000001, 3000001, 'Adults (ages 26-59)', 1, 5.00, 0.65, 0.00, 1.55, 3.45, 'Margaret Chapman', 'FM', 'Ashley johnson', 'FM') INTO SALES VALUES (1002, 8001, 0100, 020000020, 60002, 120002, 2000002, 3, 103000002, 3000002, 'Adults (ages 26-59)', 1, 7.00, 0.91, 0.00, 1.05, 5.95, 'Elizabeth Tremblay', 'FM', 'Thomas Marshall', 'Ma') INTO SALES VALUES (1003, 8001, 0100, 020000020, 60003, 120003, 2000003, 4, 103000003, 3000003, 'Senior(60+)', 1, 8.00, 1.04, 0.00, 1.25, 6.75, 'Gladys Julie', 'FM', 'James Simpson', 'Ma') INTO SALES VALUES (1004, 8001, 0100, 020000020, 60004, 120004, 2000004, 3, 103000004, 3000004, 'Adults (ages 26-59)', 1, 14.00, 1.82, 0.00, 3.00, 11.00, 'John Taylor', 'Ma', 'Doris Miller', 'FM') INTO SALES VALUES (1005, 8001, 0100, 020000020, 60005, 120005, 2000005, 2, 103000005, 3000005, 'Teenagers (ages 13-25)', 1, 25.00, 3.25, 0.00, 5.00, 20.00, 'Amelia Smith', 'FM', 'Robot Wood', 'Ma') INSERT INTO STORES (StoreID ,StoreName ,StoreCity ,StoreProvince ,StorePostalCode ) VALUES (60001, 'Market Yi', 'Toronto', 'Ontario', 'A1Q 1A2'), (60002, 'Shop Er', 'Toronto', 'Ontario', 'B2W 2S3'), (60003, 'Store Te', 'Toronto', 'Ontario', 'C3E 3D4'), (60004, 'Supermarket Di', 'Toronto', 'Ontario', 'D4R 4F5'), (60005, 'shopping Da', 'Toronto', 'Ontario', 'E5T 5G6') Error at Command Line : 270 Column : 1 Error report - SQL Error: ORA-00933: SQL command not properly ended 00933. 00000 -  "SQL command not properly ended" *Cause:     *Action:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

  this  sql code is wrong  ,can someone help me see whats the wrong with this code ?

CREATE TABLE SALES (
ProductID int not null,
MCampID int not null,
PayMethodID int not null,
DateID int not null,
StoreID int not null,
EmployeeID int not null,
CustomerID int not null,
DemogrGrID int not null,
SurrogateID int,
PurchaseTransactionID int not null,
AgeGroupName varchar(30) not null,
Quantity int not null,
Amount decimal(6,2) default 0.00,
Taxes decimal(6,2) default 0.00,
DiscountType decimal(6,2) default 0.00,
Cost_ decimal(6,2) default 0.00,
Profit decimal(6,2) default 0.00,
EmployeeName varchar(30) not null,
EmployeeGender varchar(30) not null,
CustomerName varchar(30) not null,
CustomerGender varchar(30) not null,
PRIMARY KEY (SurrogateID),
CONSTRAINT CHK_Amount CHECK (Amount >= 0),
CONSTRAINT CHK_Taxes CHECK (Taxes >= 0),
CONSTRAINT CHK_Cost CHECK (Cost_ >= 0),
CONSTRAINT CHK_Profit CHECK (Profit >= 0),
CONSTRAINT fk_Product FOREIGN KEY (ProductID) REFERENCES PRODUCTS (ProductID),
CONSTRAINT fk_MCamp FOREIGN KEY (MCampID) REFERENCES MARKETING_CAMPAIGN (MCampID),
CONSTRAINT fk_PayMethod FOREIGN KEY (PayMethodID) REFERENCES PAYMENT_METHODS (PayMethodID),
CONSTRAINT fk_Date FOREIGN KEY (DateID) REFERENCES DATE_ (DateID),
CONSTRAINT fk_Store FOREIGN KEY (StoreID) REFERENCES STORES (StoreID),
CONSTRAINT fk_Employee FOREIGN KEY (EmployeeID) REFERENCES EMPLOYEE (EmployeeID),
CONSTRAINT fk_Customer FOREIGN KEY (CustomerID) REFERENCES CUSTOMERS (CustomerID),
CONSTRAINT fk_DemogrGr FOREIGN KEY (DemogrGrID) REFERENCES DEMOGRAFIC_GROUPS (DemogrGrID)
);
Error starting at line : 269 in command -
INSERT INTO SALES VALUES (1001, 8001, 0100, 020000020, 60001, 120001, 2000001, 3, 103000001, 3000001, 'Adults (ages 26-59)', 1, 5.00, 0.65, 0.00, 1.55, 3.45, 'Margaret Chapman', 'FM', 'Ashley johnson', 'FM')
INTO SALES VALUES (1002, 8001, 0100, 020000020, 60002, 120002, 2000002, 3, 103000002, 3000002, 'Adults (ages 26-59)', 1, 7.00, 0.91, 0.00, 1.05, 5.95, 'Elizabeth Tremblay', 'FM', 'Thomas Marshall', 'Ma')
INTO SALES VALUES (1003, 8001, 0100, 020000020, 60003, 120003, 2000003, 4, 103000003, 3000003, 'Senior(60+)', 1, 8.00, 1.04, 0.00, 1.25, 6.75, 'Gladys Julie', 'FM', 'James Simpson', 'Ma')
INTO SALES VALUES (1004, 8001, 0100, 020000020, 60004, 120004, 2000004, 3, 103000004, 3000004, 'Adults (ages 26-59)', 1, 14.00, 1.82, 0.00, 3.00, 11.00, 'John Taylor', 'Ma', 'Doris Miller', 'FM')
INTO SALES VALUES (1005, 8001, 0100, 020000020, 60005, 120005, 2000005, 2, 103000005, 3000005, 'Teenagers (ages 13-25)', 1, 25.00, 3.25, 0.00, 5.00, 20.00, 'Amelia Smith', 'FM', 'Robot Wood', 'Ma')

INSERT INTO STORES (StoreID ,StoreName ,StoreCity ,StoreProvince ,StorePostalCode )

VALUES (60001, 'Market Yi', 'Toronto', 'Ontario', 'A1Q 1A2'),
(60002, 'Shop Er', 'Toronto', 'Ontario', 'B2W 2S3'),
(60003, 'Store Te', 'Toronto', 'Ontario', 'C3E 3D4'),
(60004, 'Supermarket Di', 'Toronto', 'Ontario', 'D4R 4F5'),
(60005, 'shopping Da', 'Toronto', 'Ontario', 'E5T 5G6')
Error at Command Line : 270 Column : 1
Error report -
SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 -  "SQL command not properly ended"
*Cause:    
*Action:

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
SQL Query
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education