-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathqueries.sql
82 lines (76 loc) · 2.08 KB
/
queries.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
select u1_0.id, u1_0.clazz_, u1_0.email, u1_0.name, u1_0.average_rating, u1_0.attendance, u1_0.psp
from (select id, email, name, null as average_rating, null as attendance, null as psp, 0 as clazz_
from tpc_user
union all
select id, email, name, average_rating, null as attendance, null as psp, 1 as clazz_
from tpc_mentor
union all
select id, email, name, null as average_rating, attendance, psp, 2 as clazz_
from tpc_student
union all
select id, email, name, average_rating, null as attendance, null as psp, 3 as clazz_
from tpc_ta) u1_0
select c1_0.id,
c1_0.name,
p1_0.category_id,
p1_0.id,
p1_0.description,
p1_0.image,
p1_0.price,
p1_0.title
from category c1_0
left join product p1_0 on c1_0.id = p1_0.category_id
where c1_0.id = ?
select c1_0.id, c1_0.name
from category c1_0
where c1_0.id = ?
select p1_0.category,
p1_0.id,
p1_0.description,
p1_0.image,
p2_0.id,
p2_0.currency,
p2_0.price,
p1_0.title
from product p1_0
left join price p2_0 on p2_0.id = p1_0.price_id
where p1_0.category = ?
select p1_0.category,
p1_0.id,
p1_0.description,
p1_0.image,
p2_0.id,
p2_0.currency,
p2_0.price,
p1_0.title
from product p1_0
left join price p2_0 on p2_0.id = p1_0.price_id
where p1_0.category = ?
select c1_0.id,
c1_0.name,
p1_0.category,
p1_0.id,
p1_0.description,
p1_0.image,
p2_0.id,
p2_0.currency,
p2_0.price,
p1_0.title
from category c1_0
left join product p1_0 on c1_0.id = p1_0.category
left join price p2_0 on p2_0.id = p1_0.price_id
where c1_0.id = ? Hibernate:
select c1_0.id,
c1_0.name,
p1_0.category,
p1_0.id,
p1_0.description,
p1_0.image,
p2_0.id,
p2_0.currency,
p2_0.price,
p1_0.title
from category c1_0
left join product p1_0 on c1_0.id = p1_0.category
left join price p2_0 on p2_0.id = p1_0.price_id
where c1_0.id = ?