用户名和密码数据库设计 [英] Username & Password Database Design

查看:263
本文介绍了用户名和密码数据库设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为工业公司设计一个数据库,我有这些实体(员工,供应商,客户,驱动程序),每个人都有自己的唯一ID(员工身份等)。
那么,如何为每个用户分配唯一的用户名? (使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆