I have tables like this
Employee
Id | IdEmployee | Employee | Address | Phone_num |
1 | EM10000 | Jack | wall st. | 9000010 |
2 | EM10001 | Paul | elm st. | 9000010 |
3 | EM10002 | George | ex st . | 9000010 |
Technician
id | IdTech | TechName | Address | phone_num |
1 | TE10000 | Gabut | Hello st. | 9000010 |
2 | TE10001 | Polnaref | coding st. | 9000010 |
3 | TE10002 | Rafioli | stack st. | 9000010 |
Admin
id | IdAdmin | username | password | phone_num |
1 | AM10000 | sim1 | 1234 | 9000010 |
2 | AM10001 | sim2 | luvcoding | 9000010 |
3 | AM10002 | sim3 | okaymate | 9000010 |
How do i make Table Technician and Employee become a user too, so they could use their information as username in a login form? Plus, i want each Id (not the "AutoIncrement" ID) of Technician and Employee would become the username.
How to manage the database like this?
or should i add password column in both tables? (Employee and Technician)
or should i make one table just like this?
(new) Admin
id | Id | username | password | phone_num |
1 | AM10000 | sim1 | 1234 | 9000010 |
2 | AM10001 | sim2 | luvcoding | 9000010 |
3 | AM10002 | sim3 | okaymate | 9000010 |
4 | AM10003 | EM10000 | test1 | NULL |
5 | AM10004 | EM10001 | test2 | NULL |
6 | AM10005 | EM10002 | test3 | NULL |
7 | AM10006 | TE10000 | 1234 | NULL |
8 | AM10007 | TE10001 | ok123 | NULL |
There is no relationship between Technician and Employee (stand-alone table)