skill-assessment-app/db/sql/candidate_quiz.sql

18 lines
540 B
MySQL
Raw Permalink Normal View History

2016-07-30 16:25:09 -05:00
select c.id candidate_id
, c.name, c.test_hash
, q.quiz_id, q.id question_id, a.id answer_id, q.sort
, q.question, q.category, q.input_type, q.input_options, a.answer
, ifnull(a.saved, false) saved, ifnull(a.submitted, false) submitted , a.updated_at
from candidates c
inner join questions q on q.quiz_id = c.quiz_id
left join answers a on a.candidate_id = c.id AND a.question_id = q.id
2016-07-31 18:54:12 -05:00
where c.test_hash = 'R67PmfDHGiw' -- and q.input_type = 'radio'
2016-07-30 16:25:09 -05:00
order by c.name, q.sort;
2016-07-31 18:54:12 -05:00
-- delete from answers where id = 1008398109