sql queries from 31.01.22

PHOTO EMBED

Mon Jan 31 2022 13:08:23 GMT+0000 (Coordinated Universal Time)

Saved by @vvnezapnopwnz #json

ALTER TABLE custom_tests_results
ADD COLUMN theme varchar(55);

select * from custom_tests_results a
join group_custom_tests b
on a.custom_test_id = b.id
join students c
on a.student_id = c.student_id
join subjects d
on a.subject_id = d.id
where a.custom_test_id = 24
and a.student_id = 585
and a.subject_id = 14

select distinct a.format, a.id, b.test_date
from group_custom_tests a
            join custom_tests_results b
            on a.id = b.custom_test_id
            where a.format = 'Второй' 
            and b.subject_id = 17

select * from group_subjects a
join subjects b
on a.subject_id = b.id
where a.group_id = 69

select * from custom_tests_results a
join subjects b
on a.subject_id = b.id
join students c
on a.student_id = c.student_id
where c.name = 'Кенебаев Манас'
and b.name = 'История Казахстана'
and custom_test_id = 24
content_copyCOPY