简体   繁体   中英

SQL Server nested table

Persons: theoretically, unlimited number of persons can be registered in the system. Contact information linked to each person should also be able to be added without limits.

  • UUID
  • Name
  • Surname
  • Company

Communication information:

  • Information Type: Telephone Number, E-mail Address, Location
  • Information Content

Report:

  • Location information
    • Most -> Least to be listed by their number of locations
  • The number of people registered in the directory at that location
  • Number of phone numbers registered in the phone book at that location

I have 2 tables, how should the relationship be between them and I am confused since the Communication information attribute has 2 attributes in itself. Should communication information be in a separate table?

I would suggest to divide this into three tables:

  • Persons(UUID,Name,Surname,Company)
  • CommunicationType(Telephone Number, E-mail Address,)
  • CommunicationInformation(Person_ID,CommunicationType_ID, ......)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM