문제

CREATE TABLE Customers(
  CustID number(5,0),
  EmpID CHAR(1),
  Cust_Name varchar(20) not null,
  Cust_Address varchar(20) not null,
  Cust_City varchar(20) not null,
  Cust_State char(2) not null,
  Cust_Zipcode number(5,0) not null,
  Ship_Date date not null,
  Order_Date date not null,
  constraint ci_fk FOREIGN KEY (EmpID) references EMPLOYEES(EmpID),
  constraint ci_ck check (Ship_Date>Order_Date)
)

What's the problem?

도움이 되었습니까?

해결책

Employees table does not exist.

or EmpId is not a primary key.

Once I did these, my copy of the create statement worked.

다른 팁

Chris said it.

Change CHAR to VARCHAR2 as CHAR should never be used. Also, number(5,0) is the same as NUMBER(5), so you can use that.

Verify that the Employees table exists.

Verify that the EmpID column in the Employees table is of the same datatype as in the Customers table.

Verify that the EmpID column in the Employees table is the primary key of the employee table.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top