On Apr 9, 9:48 am, "Chirag" <chirag.dpa...@gmail.comwrote:
I want to create a table with
member id(primary key for Students,faculty and staff [Tables])
and now i want to create issues[Tables] with foreign key as member id
but in references i could not able to pass on reference as or
condition for students, faculty and staff.
Thank You,
Chirag
Two options
1. Create multiple member tables
member_student,member_faculty,member_staff and
issues_student,issues_faculty,issues_staff
2. Create a new column called flag in both the tables like
Create table member ( memberid iNT, Flag Char(1) --S - Student,
F- Faculty, T - Staff)
Primary Key (flag,memberid)
Create table Issues (memberid INT, Flag Char(1) -- S - Student, F-
Faculty, T- Staff)
Primary Key (flag,memberid)
Now Reference two tables with flag and memberid.
If you want to refernce member table with student,faculty,staff you
need to handle in trigger