客户分为两种,个人客户和企业客户。例如,它们具有相同的字段(电子邮件、密码),但企业客户具有唯一的字段(公司名称、公司电话、地址)。还有什么可能是数据库的结构?
mysql> desc `customers`;
+-------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+----------------+
| id_customer | int(11) | NO | PRI | NULL | auto_increment |
| email | varchar(32) | NO | | NULL | |
| password | int(16) | NO | | NULL | |
+-------------+-------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
mysql> desc `corporate_customers`;
+-----------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-------------+------+-----+---------+-------+
| id_customer | int(11) | NO | PRI | NULL | |
| company_name | varchar(32) | NO | | NULL | |
| company_address | text | NO | | NULL | |
+-----------------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)