| 207 | |
| 208 | {{{ |
| 209 | DECLARE correct_student_id INT; |
| 210 | SET correct_student_id = 11111; |
| 211 | |
| 212 | SELECT |
| 213 | ce.calendar_event_id, |
| 214 | ce.event_name, |
| 215 | ce.event_type, |
| 216 | ce.event_description, |
| 217 | ce.event_start_time, |
| 218 | ce.event_end_time |
| 219 | FROM |
| 220 | calendar_event ce |
| 221 | JOIN |
| 222 | term t ON ce.starting_year = t.starting_year |
| 223 | AND ce.finishing_year = t.finishing_year |
| 224 | AND ce.term_type = t.term_type |
| 225 | WHERE t.student_id = correct_student_id |
| 226 | AND t.starting_year = 2023 |
| 227 | AND t.finishing_year = 2024 |
| 228 | AND t.term_type = 'Zimski'; |
| 229 | }}} |
| 230 | |
| 231 | |
| 233 | |
| 234 | |
| 235 | {{{ |
| 236 | DECLARE correct_student_id INT; |
| 237 | SET correct_student_id = 11111; |
| 238 | |
| 239 | SELECT |
| 240 | ce.calendar_event_id, |
| 241 | ce.event_name, |
| 242 | ce.event_type, |
| 243 | ce.event_description, |
| 244 | ce.event_start_time, |
| 245 | ce.event_end_time, |
| 246 | NULL AS task_id, |
| 247 | NULL AS task_name, |
| 248 | NULL AS task_description, |
| 249 | NULL AS task_priority, |
| 250 | NULL AS is_done |
| 251 | FROM |
| 252 | subject_event se |
| 253 | JOIN calendar_event ce ON se.calendar_event_id = ce.calendar_event_id |
| 254 | WHERE |
| 255 | se.term_subject_id = 170569 |
| 256 | UNION |
| 257 | SELECT |
| 258 | NULL AS calendar_event_id, |
| 259 | NULL AS event_name, |
| 260 | NULL AS event_type, |
| 261 | NULL AS event_description, |
| 262 | NULL AS event_start_time, |
| 263 | NULL AS event_end_time, |
| 264 | t.task_id, |
| 265 | t.task_name, |
| 266 | t.task_description, |
| 267 | t.task_priority, |
| 268 | t.is_done |
| 269 | FROM |
| 270 | creates_task ct |
| 271 | JOIN |
| 272 | task t ON ct.task_id = t.task_id |
| 273 | WHERE |
| 274 | ct.term_subject_id = 170569; |
| 275 | |
| 276 | |
| 277 | |
| 278 | }}} |
| 279 | |