Interview Query

t Value via SQL

0
Have you seen this question before?

Let’s say you are managing products for an eCommerce store. You think products from category 9 have a lower average price than those in all other categories.

Calculate the t-value and degrees of freedom for such a test. You do not need to calculate the p-value of the test.

Example:

Input:

products table

Column Type
id INTEGER
name VARCHAR
price DOUBLE
category_id INTEGER

Output

Column Type
T_value DOUBLE
D_o_F INTEGER
Next question: Best Measure
.....
MySQL 8.0.17
Loading editor
Use Shift + Enter to run query