File tree Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change 1+ 1757 - Recyclable and Low Fat Products
2+ ``` sql
3+ SELECT product_id
4+ FROM Products
5+ WHERE low_fats = ' Y'
6+ AND recyclable = ' Y'
7+ ```
8+ ---
9+
10+ 584 - Find Customer Referee
11+ ``` sql
12+ SELECT name
13+ FROM Customer
14+ WHERE referee_id != 2 OR referee_id IS null
15+ ```
16+
17+ 595 - Big Countries
18+ ``` sql
19+ SELECT name, population, area
20+ FROM WORLD
21+ WHERE area >= 3000000
22+ OR population >= 25000000
23+ ```
24+
25+ 1148 - Article Views I
26+ ``` sql
27+ SELECT DISTINCT author_id as id
28+ FROM Views
29+ WHERE viewer_id >= 1
30+ AND author_id = viewer_id
31+ ORDER BY author_id
32+ ```
33+
34+ 1683 - Invalid Tweets
35+ ``` sql
36+ SELECT tweet_id
37+ FROM Tweets
38+ WHERE length(content) > 15
39+ ```
40+
41+ 1378 - Replace Employee ID With The Unique
42+ Identifier
43+ ``` sql
44+ SELECT unique_id, name
45+ FROM Employees e
46+ LEFT JOIN EmployeeUNI eu
47+ ON e .id = eu .id
48+ ```
49+
50+ 1068 - Product Sales Analysis I
51+ ``` sql
52+ SELECT product_name, year, price
53+ FROM Sales s
54+ LEFT JOIN Product p
55+ ON s .product_id = p .product_id
56+ ```
57+
58+ 1581 - Customer Who Visited but Did Not Make Any Transactions
59+ ``` sql
60+ SELECT customer_id, COUNT (* ) as count_no_trans
61+ FROM Visits
62+ WHERE visit_id NOT IN (SELECT DISTINCT visit_id FROM Transactions)
63+ GROUP BY customer_id
64+ ```
65+
66+
67+
68+
69+
You can’t perform that action at this time.
0 commit comments