MySQL Forums
Forum List  »  Newbie

another 1064 error
Posted by: Marc Ray
Date: October 05, 2018 10:01AM

please help me fix this problem. i am trying to create schema using workbench 8.0. error shown at end...here is what i got after i clicked "execute"...


Executing:
CREATE SCHEMA `relational_database` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci ;
USE `relational_database`



CREATE TABLE AGENT (
AGENT_CODE varchar(50),
AGENT_PHONE varchar(50)
);

INSERT INTO AGENT VALUES('125','6152439887');
INSERT INTO AGENT VALUES('167','6153426778');
INSERT INTO AGENT VALUES('231','6152431124');
INSERT INTO AGENT VALUES('333','9041234445');

/* -- */


CREATE TABLE CUSTOMER (
CUS_CODE varchar(50),
CUS_LNAME varchar(50),
CUS_ZIP varchar(50),
AGENT_CODE varchar(50)
);

INSERT INTO CUSTOMER VALUES('1132445','Walker','32145','231');
INSERT INTO CUSTOMER VALUES('1217782','Adares','32145','125');
INSERT INTO CUSTOMER VALUES('1312243','Rakowski','34129','167');
INSERT INTO CUSTOMER VALUES('1321242','Rodriguez','37134','125');
INSERT INTO CUSTOMER VALUES('1542311','Smithson','37134','421');
INSERT INTO CUSTOMER VALUES('1657399','Vanloo','32145','231');

/* -- */


CREATE TABLE DIFF_TBL1 (
STU_FNAME varchar(50),
STU_LNAME varchar(50)
);

INSERT INTO DIFF_TBL1 VALUES('George', 'Jones');
INSERT INTO DIFF_TBL1 VALUES('Jane', 'Smith');
INSERT INTO DIFF_TBL1 VALUES('Peter', 'Robinson');
INSERT INTO DIFF_TBL1 VALUES('Franklin', 'Johnson');
INSERT INTO DIFF_TBL1 VALUES('Martin', 'Lopez');

/* -- */

CREATE TABLE DIFF_TBL2 (
EMP_FNAME varchar(50),
EMP_LNAME varchar(50)
);

INSERT INTO DIFF_TBL2 VALUES('Franklin', 'Lopez');
INSERT INTO DIFF_TBL2 VALUES('William', 'Turner');
INSERT INTO DIFF_TBL2 VALUES('Franklin', 'Johnson');
INSERT INTO DIFF_TBL2 VALUES('Susan', 'Rogers');

/* -- */

CREATE TABLE DIV_TBL1 (
P_CODE varchar(50),
CUS_CODE varchar(50)
);

INSERT INTO DIV_TBL1 VALUES('123456', '10400');
INSERT INTO DIV_TBL1 VALUES('123456', '11501');
INSERT INTO DIV_TBL1 VALUES('123456', '10030');
INSERT INTO DIV_TBL1 VALUES('123456', '12550');
INSERT INTO DIV_TBL1 VALUES('234567', '12350');
INSERT INTO DIV_TBL1 VALUES('234567', '10040');
INSERT INTO DIV_TBL1 VALUES('234567', '10500');
INSERT INTO DIV_TBL1 VALUES('234567', '10030');
INSERT INTO DIV_TBL1 VALUES('234567', '12550');
INSERT INTO DIV_TBL1 VALUES('345678', '10400');
INSERT INTO DIV_TBL1 VALUES('345678', '11630');
INSERT INTO DIV_TBL1 VALUES('345678', '12550');
INSERT INTO DIV_TBL1 VALUES('456789', '11630');
INSERT INTO DIV_TBL1 VALUES('567890', '10600');
INSERT INTO DIV_TBL1 VALUES('567890', '10030');
INSERT INTO DIV_TBL1 VALUES('567890', '12550');
INSERT INTO DIV_TBL1 VALUES('678901', '11500');
INSERT INTO DIV_TBL1 VALUES('678901', '10400');
INSERT INTO DIV_TBL1 VALUES('678901', '11630');

/* -- */

CREATE TABLE DIV_TBL2 (
P_CODE varchar(50)
);

INSERT INTO DIV_TBL2 VALUES('123456');
INSERT INTO DIV_TBL2 VALUES('234567');
INSERT INTO DIV_TBL2 VALUES('567890');

/* -- */

CREATE TABLE INT_TBL1 (
STU_FNAME varchar(50),
STU_LNAME varchar(50)
);

INSERT INTO DIFF_TBL1 VALUES('George', 'Jones');
INSERT INTO DIFF_TBL1 VALUES('Jane', 'Smith');
INSERT INTO DIFF_TBL1 VALUES('Peter', 'Robinson');
INSERT INTO DIFF_TBL1 VALUES('Franklin', 'Johnson');
INSERT INTO DIFF_TBL1 VALUES('Martin', 'Lopez');

/* -- */

CREATE TABLE INT_TBL2 (
EMP_FNAME varchar(50),
EMP_LNAME varchar(50)
);

INSERT INTO DIFF_TBL2 VALUES('Franklin', 'Lopez');
INSERT INTO DIFF_TBL2 VALUES('William', 'Turner');
INSERT INTO DIFF_TBL2 VALUES('Franklin', 'Johnson');
INSERT INTO DIFF_TBL2 VALUES('Susan', 'Rogers');

/* -- */

CREATE TABLE PROD_TBL1 (
P_CODE varchar(50),
P_DESCRIPT varchar(50),
PRICE numeric(4,2),
);

INSERT INTO PROD_TBL1 VALUES('123456','Flashlight','5.26');
INSERT INTO PROD_TBL1 VALUES('123457','Lamp','25.15');
INSERT INTO PROD_TBL1 VALUES('123458','Box Fan','10.99');
INSERT INTO PROD_TBL1 VALUES('213345','9v battery','1.92');
INSERT INTO PROD_TBL1 VALUES('311452','Powerdrill','34.99');
INSERT INTO PROD_TBL1 VALUES('254467','100W bulb','1.47');

/* -- */

CREATE TABLE PROD_TBL2 (
STORE varchar(50),
AISLE varchar(50),
SHELF varchar(50)
);

INSERT INTO PROD_TBL2 VALUES('23','W','5');
INSERT INTO PROD_TBL2 VALUES('24','K','9');
INSERT INTO PROD_TBL2 VALUES('25','Z','6');

/* -- */


CREATE TABLE PROJ_TBL1 (
P_CODE varchar(50),
P_DESCRIPT varchar(50),
PRICE numeric(4,2),
);

INSERT INTO PROJ_TBL1 VALUES('123456','Flashlight','5.26');
INSERT INTO PROJ_TBL1 VALUES('123457','Lamp','25.15');
INSERT INTO PROJ_TBL1 VALUES('123458','Box Fan','10.99');
INSERT INTO PROJ_TBL1 VALUES('213345','9v battery','1.92');
INSERT INTO PROJ_TBL1 VALUES('311452','Powerdrill','34.99');
INSERT INTO PROJ_TBL1 VALUES('254467','100W bulb','1.47');

/* -- */

CREATE TABLE SEL_TBL1 (
P_CODE varchar(50),
P_DESCRIPT varchar(50),
PRICE numeric(4,2),
);

INSERT INTO SEL_TBL1 VALUES('123456','Flashlight','5.26');
INSERT INTO SEL_TBL1 VALUES('123457','Lamp','25.15');
INSERT INTO SEL_TBL1 VALUES('123458','Box Fan','10.99');
INSERT INTO SEL_TBL1 VALUES('213345','9v battery','1.92');
INSERT INTO SEL_TBL1 VALUES('311452','Powerdrill','34.99');
INSERT INTO SEL_TBL1 VALUES('254467','100W bulb','1.47');

/* -- */

CREATE TABLE UNI_TBL1 (
P_CODE varchar(50),
P_DESCRIPT varchar(50),
PRICE numeric(4,2),
);

INSERT INTO UNI_TBL1 VALUES('123456','Flashlight','5.26');
INSERT INTO UNI_TBL1 VALUES('123457','Lamp','25.15');
INSERT INTO UNI_TBL1 VALUES('123458','Box Fan','10.99');
INSERT INTO UNI_TBL1 VALUES('213345','9v battery','1.92');
INSERT INTO UNI_TBL1 VALUES('311452','Powerdrill','34.99');
INSERT INTO UNI_TBL1 VALUES('254467','100W bulb','1.47');

/* -- */

CREATE TABLE UNI_TBL2 (
P_CODE varchar(50),
P_DESCRIPT varchar(50),
PRICE numeric(4,2),
);

INSERT INTO UNI_TBL2 VALUES('345678','Microwave','160');
INSERT INTO UNI_TBL2 VALUES('345679','Dishwasher','500');
INSERT INTO UNI_TBL2 VALUES('123458','Box Fan', '10.99');

/* -- */

Operation failed: There was an error while applying the SQL script to the database.
ERROR 1064: 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 'CREATE TABLE AGENT (
AGENT_CODE varchar(50),
AGENT_PHONE varchar(50)
)' at line 5
SQL Statement:
USE `relational_database`



CREATE TABLE AGENT (
AGENT_CODE varchar(50),
AGENT_PHONE varchar(50)
)

Options: ReplyQuote


Subject
Written By
Posted
another 1064 error
October 05, 2018 10:01AM
October 05, 2018 10:15AM
October 05, 2018 10:36AM
October 05, 2018 11:01AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.