Database design for international suppliers and their support language -


i new database world , want design database contains many service providers. provide services on world, few states. also, need store language in can support customers.

i want query efficiently:
1) suppliers servicing state.
2) suppliers support language.

i thought of following design:

  • country_table {countryid : pk ...}
  • state_table {stateid: pk, countryid : fk ...}
  • language_table {languageid: pk, ....}
  • supplier_table {supplierid : pk, suppliername, supplier address...}
  • supplier_language_table {supplierid : pk,fk , languageid : pk, fk}
  • supplier_state_table { supplierid : pk, fk , stateid: pk, fk}

i have few problems design:

  1. what in case of country has no states (for instance: egypt)? thought of using countryid=0 these cases. in country_table, texas state , usa country. however, egypt state countryid 0 . valid solution?
  2. for each language supplier supports need insert row. efficient later querying suppliers language or there better solution?
  3. in supplier_state_table need insert row each state supplier provides. seems inefficient. thought of using stateid 0 indicate whole world. then, if supplier provides service only, having data row each state seems crazy.

any appreciated.

1) no. instead, have both supplier_state_table , supplier_country_table

2) fine.

3) again, fine, databases designed handle lot of data.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -