How to create an efficient database design in sql using asp.net?

后端 未结 2 2004
半阙折子戏
半阙折子戏 2021-01-29 08:20

Right now I\'m still a beginner in databases and still learning all about it. I have a problem with the design of my database and I don\'t really know where to go from here. Bas

2条回答
  •  天命终不由人
    2021-01-29 09:15

    If this is all you are storing, you can add an extra two fields in the database One called Guitar and has a 1 when the brand applies to a guitar (so all of them at the moment) and another field called Bass which only has a 1 on the brands which uses a bass.

    In your filter you can add "where g.Bass==1"

    This will only return the Bass brands.

    However, if you intend to expand on the instruments, you should create a separate table which links the type of instrument to the brands.

    eg

    Type Brand Guitar 1 Guitar 2 Guitar 3 Guitar 4 etc Bass 1 Bass 2 Bass 5

    Then link the two tables together in the where.

提交回复
热议问题