I want to solve the following problem using one query for example
Questions Table
id | question | correct_answer | point
1 | "what ..?"| 'test' | 10
2 | "what ..?"| 'test' | 5
Answers Table
id | question_id | user_id | answers | point
Using Laravel 8 I want to add answers to multiple questions at the same time using join and get scores from the questions table and if user answers match to questions.correct_answer also add its score to answers table
use something like code:
DB::table('questions')->join('answers','answers.question_id','=','questions.id')
Thanks in Advance 🙂