I’m having difficulties writing an Integrity Constraint check for table creation. The following is my table creation statement:
CREATE TABLE User (
UName VARCHAR(15) PRIMARY KEY,
FName VARCHAR(15),
LName VARCHAR(15)
);
The integrity constraint I’m looking for is that the UName (Username) cannot contain the first name, and/or the last name.
Can I write this without PL/SQL?
Any help is greatly appreciated.
Yes, you need define it as a
TABLE CHECK CONSTRAINT(not against the UNAME column, as it refers to other columns in the same table) as follows: