用户名和密码数据库设计 [英] Username & Password Database Design
问题描述
那么,如何为每个用户分配唯一的用户名? (使用Ms Access)。
thx
创建一个实体表。无论何时向其他表格(员工,供应商,客户,驱动程序)添加条目,请在实体表中添加一行。
在其他表(Employee ,供应商,客户,驱动程序),添加外键(列名称:entity_id)。
获取员工的实体ID:
SELECT entity_id FROM employees WHERE id = {employee_id};
作为一个奖励,所有实体类型通用的字段可以移动到实体表。 / p>
I'm Designing a database for industrial company , I Have these entities ( Employee , Suppliers , Customers , Drivers ) and Each one of them has his own unique ID ( Employee Id , .. etc ) . So , How can I assign a unique username for each user ? ( using Ms Access ). thx
Create an entity table. Whenever you add an entry to the other tables ( Employee , Suppliers , Customers , Drivers ), add a row in the entity table for them.
In the other tables ( Employee , Suppliers , Customers , Drivers ), add a foreign key (column name: entity_id).
To get the entity id for an employee:
SELECT entity_id FROM employees WHERE id = {employee_id};
As a bonus, fields that are common to all entity types can be moved to the entity table.
这篇关于用户名和密码数据库设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!