Skip to content
Advertisement

SQL query to get data of MCQ question and the answer from two table

MCQ Question and correct answer table name = Table1

Options for every MCQ question and options code table Name = Table2

Table1

enter image description here

Table2

enter image description here

SQL query to get data in the form of –

Questions, All 3 options and correct option

Advertisement

Answer

I am assuming you are using MSSQL as database

Use JOINS

FIDDLE DEMO

Or

Output

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement