The data is all Boolean and I need to retrieve a sub set of the 15 which are true(1) for any number of given user inputs from the 100. Also the 100 becomes 101 as frequently as 3-4 times a year.For example consider the 15 as letters and 100 as numbers. A is true for all 2 multiples and B is true for all 3 multiples and C for all 5 multiples,when the user inputs 6 it should return A and B and if user input is 6 and 15 it should return A,B and C. If the user asks for 15 then B and C. If I go for nums as rows and letters as cols I dont know if I can retrieve the condition satisfying column names, if I go for the opposite as I mentioned above numbers keep increasing so whenever there is a column it will be difficult to fill all of its corresponding rows.

  • So, you have a table (CREATE TABLE foo (q1 BOOLEAN, q2 BOOLEAN, q3... q100 BOOLEAN);) and you want to pick a subset of 15 specific questions to which the response is yes/true? What's the problem? Why have you tagged the question with both MySQL and SQLite? Are you asking for a database recommendation - normally off-topic. The only reason to choose MySQL over SQLite is for its multi-user characteristics. There are a few questions on how to ask questions here on my profile - you might want to look? p.s. welcome to the forum! – Vérace Feb 7 at 10:40
  • 1
    Please give sample of your data and sample of the user input for compare / retrieve. – Natarajan N Napoleon Feb 7 at 10:49
  • Think about bit-mapped datatype SET. – Akina Feb 7 at 12:28
  • I have added the sample data and required sample output – Rahul Nanda Feb 10 at 9:21
  • Smells like factorization? Another way is 100 rows of SMALLINT UNSIGNED, where each bit of the smallint is one of your booleans. – Rick James Feb 11 at 16:27

Browse other questions tagged or ask your own question.