File tree 12 files changed +33
-16
lines changed
0181.Employees Earning More Than Their Managers
0183.Customers Who Never Order
12 files changed +33
-16
lines changed Original file line number Diff line number Diff line change 39
39
### ** SQL**
40
40
41
41
```
42
-
42
+ select distinct(Num) as ConsecutiveNums from Logs Curr where
43
+ Num = (select Num from Logs where id = Curr.id - 1) and
44
+ Num = (select Num from Logs where id = Curr.id - 2)
43
45
```
44
46
45
- <!-- tabs:end -->
47
+ <!-- tabs:end -->
Original file line number Diff line number Diff line change 64
64
### ** SQL**
65
65
66
66
```
67
-
67
+ select distinct(Num) as ConsecutiveNums from Logs Curr where
68
+ Num = (select Num from Logs where id = Curr.id - 1) and
69
+ Num = (select Num from Logs where id = Curr.id - 2)
68
70
```
69
71
70
- <!-- tabs:end -->
72
+ <!-- tabs:end -->
Original file line number Diff line number Diff line change
1
+ select distinct (Num) as ConsecutiveNums from Logs Curr where
2
+ Num = (select Num from Logs where id = Curr .id - 1 ) and
3
+ Num = (select Num from Logs where id = Curr .id - 2 )
Original file line number Diff line number Diff line change 36
36
### ** SQL**
37
37
38
38
```
39
-
39
+ select Name as Employee from Employee Curr where
40
+ Salary > (select Salary from Employee where Id = Curr.ManagerId)
40
41
```
41
42
42
- <!-- tabs:end -->
43
+ <!-- tabs:end -->
Original file line number Diff line number Diff line change 58
58
### ** SQL**
59
59
60
60
```
61
-
61
+ select Name as Employee from Employee Curr where
62
+ Salary > (select Salary from Employee where Id = Curr.ManagerId)
62
63
```
63
64
64
- <!-- tabs:end -->
65
+ <!-- tabs:end -->
Original file line number Diff line number Diff line change
1
+ select Name as Employee from Employee Curr where
2
+ Salary > (select Salary from Employee where Id = Curr .ManagerId )
Original file line number Diff line number Diff line change 39
39
### ** SQL**
40
40
41
41
```
42
-
42
+ select Email from Person group by Email having count(Email) > 1
43
43
```
44
44
45
- <!-- tabs:end -->
45
+ <!-- tabs:end -->
Original file line number Diff line number Diff line change 60
60
### ** SQL**
61
61
62
62
```
63
-
63
+ select Email from Person group by Email having count(Email) > 1
64
64
```
65
65
66
- <!-- tabs:end -->
66
+ <!-- tabs:end -->
Original file line number Diff line number Diff line change
1
+ select Name as Employee from Employee Curr where
2
+ Salary > (select Salary from Employee where Id = Curr .ManagerId )
Original file line number Diff line number Diff line change 49
49
### ** SQL**
50
50
51
51
```
52
-
52
+ select Name as Customers from Customers
53
+ where id not in (select CustomerId from Orders)
53
54
```
54
55
55
- <!-- tabs:end -->
56
+ <!-- tabs:end -->
Original file line number Diff line number Diff line change 86
86
### ** SQL**
87
87
88
88
```
89
-
89
+ select Name as Customers from Customers
90
+ where id not in (select CustomerId from Orders)
90
91
```
91
92
92
- <!-- tabs:end -->
93
+ <!-- tabs:end -->
Original file line number Diff line number Diff line change
1
+ select Name as Customers from Customers
2
+ where id not in (select CustomerId from Orders)
You can’t perform that action at this time.
0 commit comments