I have a table called Staff I am currently creating. I have columns:
- staffNo
- fName
- lName
- position
- sex
- DOB
- salary
- branchNo
Currently, the entry I have in the postgres command line is:
CREATE TABLE Staff(
staffNo TEXT CONSTRAINT firstkey PRIMARY KEY,
fname TEXT NOT NULL,
lname TEXT NOT NULL,
position TEXT NOT NULL,
sex CHAR(1) NOT NULL,
DOB DATE NOT NULL,
salary INT NOT NULL,
FOREIGN KEY (branchNo) REFERENCES Branch(branchNo));
I would like to set it so that for position, only either Manager, Assistant, or Supervisor can be inserted into that column. For sex, I would like the same to be for M or F. Can anyone provide an example of how this can be done?