1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How to reference one column by multiple tables columns primary keys

Discussão em 'Outras Linguagens' iniciado por Stack, Janeiro 19, 2021.

  1. Stack

    Stack Membro Participativo

    I have a database consist of 3 tables each table indicate one user like this:


    1. Admin table 'User 1'.


    2. Staff table 'User 2'.


    3. Student table 'user 3'.

    I want to implement a common table between them called 'POST' WHERE each user can post content to the post table content column, however I need to Identify the type of posters ' the one who posted the post ' so I'm adding a column user_type to the table POST the column user_type should hold the ID of the USER ' Admin, Staff, Student '

    I'm in a case where I want to be able to refer to this column ( user_type) in the POST table to multiple table columns Admin table, Staff table, Student table. So I Can identify the USER who posted the post.

    Continue reading...

Compartilhe esta Página