| 226 | | === Извештај за секое кино, колку од настаните биле организирани кај него и извештај за секој настан колку клиенти биле заинтересирани за секој настан во последните 6 месеци === |
| 227 | | {{{#!sql |
| 228 | | select c.id_cinema,count(distinct coe.id_event) from cinemas c |
| 229 | | left join cinema_organizes_event coe on coe.id_cinema=c.id_cinema |
| 230 | | left join events e on e.id_event=coe.id_event |
| 231 | | where e.start_date between now()-interval'6 months' and now() |
| 232 | | group by c.id_cinema |
| 233 | | }}} |
| 234 | | |
| 235 | | {{{#!sql |
| 236 | | select e.id_event,count(distinct c.id_customer) from events e |
| 237 | | left join customer_is_interested_in_event ciiie on ciiie.id_event=e.id_event |
| 238 | | left join customers c on ciiie.id_customer=c.id_customer |
| 239 | | where e.start_date between now()-interval'6 months' and now() |
| 240 | | group by e.id_event |
| 241 | | }}} |
| | 275 | |
| | 276 | === Извештај за секое кино, колку од настаните биле организирани кај него и извештај за секој настан колку клиенти биле заинтересирани за секој настан во последните 6 месеци === |
| | 277 | {{{#!sql |
| | 278 | select c.id_cinema,count(distinct coe.id_event) from cinemas c |
| | 279 | left join cinema_organizes_event coe on coe.id_cinema=c.id_cinema |
| | 280 | left join events e on e.id_event=coe.id_event |
| | 281 | where e.start_date between now()-interval'6 months' and now() |
| | 282 | group by c.id_cinema |
| | 283 | }}} |
| | 284 | |
| | 285 | {{{#!sql |
| | 286 | select e.id_event,count(distinct c.id_customer) from events e |
| | 287 | left join customer_is_interested_in_event ciiie on ciiie.id_event=e.id_event |
| | 288 | left join customers c on ciiie.id_customer=c.id_customer |
| | 289 | where e.start_date between now()-interval'6 months' and now() |
| | 290 | group by e.id_event |
| | 291 | }}} |