NOTE: I am new for psql
How to add two different table column as reference in one field ( column ) in PostgreSQL
case:
- I my case, I have 3 table, "salary", "user_management", "driver_management"
- "user_management" and "driver_management" both table have column "user_id"
- "user_id" in these two separate tables should use only one column "salary" > "user_id" as reference.
below my psql query:
create table salary (
"id" SERIAL PRIMARY KEY,
"user_id" VARCHAR REFERENCES user_management(user_id) REFERENCES driver_management(user_id),
"basic_pay" INT,
"pay_group" VARCHAR,
"pay_method" Pay_Method,
"pay_cycle" Pay_Cycle,
"bank_name" VARCHAR,
"account_number" numeric(26),
"lmts" timestamp default current_timestamp
);