I have the following Table (C# and MS Access):
_sSqlString = "CREATE TABLE Device("
+ "deviceID AUTOINCREMENT NOT NULL,"
+ "brandName VARCHAR NOT NULL,"
+ "modelName VARCHAR NOT NULL,"
+ "deviceCaliber VARCHAR NOT NULL,"
+ "batterySize INT NOT NULL,"
+ "screenSize DOUBLE NOT NULL,"
+ "frontCameraMP INT NOT NULL,"
+ "rearCameraMP INT NOT NULL,"
+ "weightedScore INT,"
+ "PRIMARY KEY (deviceID)"
+ ")";
Table in MS Access with Populated Data
Goal:
The User can select the Brands they prefer, which will do a SELECT command to find all devices that matches their preference. The User can also select "Any Brand", which is a simple SELECT * command.
What I have tried:
Successfully: A SELECT procedure which passes in all the Brands, set to NULL if they are not selected.
While this works, I feel the repetition of OR is inefficient, and has the potential to be improved. Is it possible to improve this, or is a SELCT OR, OR, OR e.t.c the best way?
Thank you in advance for any help, it's very much appreciated! :)