Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
91 lines (49 loc) · 1.25 KB

File metadata and controls

91 lines (49 loc) · 1.25 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# FIRST QUESTION
//
For this challenge you need to create a simple SELECT statement that will return all columns from the products table, and join to the companies table so that
you can return the company name.
products table schema
id
name
isbn
company_id
price
companies table schema
id
name
You should return all product fields as well as the company name as "company_name".
//
# RESULT
SELECT *, companies.name FROM products
JOIN companies USING (id);
# SECOND QUESTION
//
For this challenge you need to create a simple GROUP BY statement, you want to group all the people by their age and count the people who have the same age.
people table schema
id
name
age
select table schema
age [group by]
people_count (people count)
//
# RESULT
SELECT age, COUNT(*) AS total_people
FROM people
GROUP BY age
# THIRD QUESTION
//
For this challenge you need to create a simple SELECT statement that will return all columns from the people table, and join to the toys table so that you can
return the COUNT of the toys
people table schema
id
name
toys table schema
id
name
people_id
You should return all people fields as well as the toy count as "toy_count".
//
# RESULT
SELECT *, COUNT(toys.name) AS toys_count FROM people
JOIN toys USING (id);
Morty Proxy This is a proxified and sanitized view of the page, visit original site.