从不同的表中获取凭据

I would like to create project and following is scenario :

Database tables:

Table first : Company
Table Second :Employee

when superuser create company then i put information in company table like company name, user name and password. Then with these username and password company login and enter its employee like name, gender , phone no etc plus username and password for employee so that employee can login as well with its employee rights.

confusion is that when superadmin create new company then it enter values in company table and when company create emplyee account then i enter value in employee table. So on login screen how i can check its superadmin, company or employee so that i can get information from that perticular database table.

Can you guys help me to create database for this scenario. how i can manage what should i use join , view or.....

thanks

Your database structure is correct as you're putting relevant information in each table. E.g. Company's data in company table and Employee's data in employee table.

What you need to do is when someone logins from platform add a extra parameter along with credentials for the type of user.

There are couple of solutions for this,

  1. Create two separate pages for Employee and Company's login.
  2. Have single login page for both of the user having selection box for the user type.