Here are the tables I'm trying to create:
Code:
CREATE TABLE stores (
strname VARCHAR2(25),
rrgncode NUMBER(1),
rgndesc VARCHAR2(5),
CONSTRAINT store_strname_pk PRIMARY KEY(strname));
CREATE TABLE employee (
empcode NUMBER(2),
emptitle VARCHAR2(4),
emplname VARCHAR2(25),
empfname VARCHAR2(25),
empinitial CHAR(1),
empdob CHAR(9),
empytdsales VARCHAR2(12),
CONSTRAINT employee_empcode_pk PRIMARY KEY (empcode),
CONSTRAINT employee_storename_fk FOREIGN KEY (strname) REFERENCES stores (strname));
Here is the error I get:
Code:
Error starting at line 1 in command:
CREATE TABLE employee (
empcode NUMBER(2),
emptitle VARCHAR2(4),
emplname VARCHAR2(25),
empfname VARCHAR2(25),
empinitial CHAR(1),
empdob CHAR(9),
empytdsales VARCHAR2(12),
CONSTRAINT employee_empcode_pk PRIMARY KEY (empcode),
CONSTRAINT employee_storename_fk FOREIGN KEY (strname) REFERENCES stores (strname))
Error at Command Line:10 Column:48
Error report:
SQL Error: ORA-00904: "STRNAME": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
What on earth am I doing wrong?