I have a big task that I need some help with.
My goal is the following table structure:
type: type of car number_of_cars: number of cars for each car type number: number of people driving each car type average: average number of people driving each car type median: number of people driving each car type max: max value of people driving each car type min: min value of people driving each car type standard deviation: standard deviation of number of people driving each car type
My data table looks like the following:
id type people
-----------------------
1 subaru 1
2 bmw 5
3 tesla 2
4 tesla 3
5 subaru 4
6 tesla 1
7 tesla 3
8 subaru 1
9 bmw 5
10 subaru 7
11 subaru 7
12 ford 2
13 ford 4
14 subaru 6
15 ford 3
16 tesla 2
17 tesla 1
18 tesla 1
19 tesla 1
Where id is a unique identifier, type is the type of car, and people is the number of people driving this car.
How do I create one giant MySQL query that gives me the results I need for my table?
Help is appreciated!
Ps. I know that MySQL is not necessarily the best approach to gather statictical data like this, but it should be possible, right?