-
Notifications
You must be signed in to change notification settings - Fork 1
/
listofqueries.sql
95 lines (65 loc) · 1.53 KB
/
listofqueries.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
83
84
85
86
87
88
89
90
91
92
93
94
95
SELECT staffid
FROM employee
WHERE race = $1
SELECT *
FROM moneytransfer
WHERE amount > $1 and date > $2
SELECT accountnum
FROM moneytransfer
NATURAL JOIN host_transfer
WHERE amount > $1 and date > $2
SELECT emt.staffid, cah.commission + cag.commission AS commission1
FROM
Commission_amount_host AS cah, Commission_amount_guest AS cag,
Guest_transfer AS gt,
Host_transfer AS ht,
MoneyTransfer AS mt,
Employee_manage_transfer as emt
WHERE
cah.amount = cag.amount
AND
cag.amount = gt.amount
AND
cah.amount = ht.amount
AND
gt.TransactionNum = ht.TransactionNum
AND
gt.TransactionNum = mt.TransactionNum
AND
mt.TransactionNum = emt.TransactionNum
GROUP BY emt.staffid, commission1
SELECT guestid
FROM talk_host_guest
WHERE host_id = $1
INSERT INTO employee (staffid, age, race)
VALUES (
:staffid,
:age,
:race
)
delete from employee
where staffid = $1
UPDATE Zip_hood
SET zipcode = $1, HouseLocation = $2
where zipcode = $3
select avg(amount)
from moneytransfer
where date = $1
select g.SIN
from guest_account as g
where not exists (
(select l.ListingID
from Listing_Info as l)
except
(select v.ListingID
from View_listing as v
where v.SIN = g.SIN))
delete from UpcomingBooking
where confirmationnum = $1
select ListingID, HostAccountNum
from Review_Info
where rating > (select Max(rating) from Review_Info where listingId = $1)
select some_col
from employee
select *
from table1, table2