I have to create a table in the way shown below. Can we create in this way? (If Yes)
Table_name: Sample
product_id| product_name| category |
1 | Sample1 | 1|2|3 |
2 | sample2 | 4|5|6 |
where category filed which contains multiple values.
& how we can search for category 4 comes in which row of the table.
You cannot create nested table. And the thing on your mind is not a good idea to design table like that. You should have two tables (exactly three which holds the description if the category). One is for the
productand the second table holds the category for each product. Example design would look like this,and Populate Sample Records
sample queries