<SQL>
SELECT `n`, 'mpg' AS `Variable`, 'mu' AS `Stat`, `mpg..mu` AS `Est`
FROM (
SELECT
AVG(`mpg`) AS `mpg..mu`,
STDDEV_SAMP(`mpg`) AS `mpg..sigma`,
AVG(`hp_per_cyl`) AS `hp_per_cyl..mu`,
STDDEV_SAMP(`hp_per_cyl`) AS `hp_per_cyl..sigma`,
AVG(`efficiency`) AS `efficiency..mu`,
STDDEV_SAMP(`efficiency`) AS `efficiency..sigma`,
COUNT(*) AS `n`
FROM (
SELECT
`mpg`,
`disp`,
`hp`,
`hp` / `cyl` AS `hp_per_cyl`,
`mpg` / `disp` AS `efficiency`,
`cyl`,
`drat`,
`wt`,
`qsec`,
`vs`,
`am`,
`gear`,
`carb`
FROM `df`
WHERE (`cyl` = 6.0)
) AS `q01`
) AS `q01`
UNION ALL
SELECT
`n`,
'hp_per_cyl' AS `Variable`,
'mu' AS `Stat`,
`hp_per_cyl..mu` AS `Est`
FROM (
SELECT
AVG(`mpg`) AS `mpg..mu`,
STDDEV_SAMP(`mpg`) AS `mpg..sigma`,
AVG(`hp_per_cyl`) AS `hp_per_cyl..mu`,
STDDEV_SAMP(`hp_per_cyl`) AS `hp_per_cyl..sigma`,
AVG(`efficiency`) AS `efficiency..mu`,
STDDEV_SAMP(`efficiency`) AS `efficiency..sigma`,
COUNT(*) AS `n`
FROM (
SELECT
`mpg`,
`disp`,
`hp`,
`hp` / `cyl` AS `hp_per_cyl`,
`mpg` / `disp` AS `efficiency`,
`cyl`,
`drat`,
`wt`,
`qsec`,
`vs`,
`am`,
`gear`,
`carb`
FROM `df`
WHERE (`cyl` = 6.0)
) AS `q01`
) AS `q01`
UNION ALL
SELECT
`n`,
'efficiency' AS `Variable`,
'mu' AS `Stat`,
`efficiency..mu` AS `Est`
FROM (
SELECT
AVG(`mpg`) AS `mpg..mu`,
STDDEV_SAMP(`mpg`) AS `mpg..sigma`,
AVG(`hp_per_cyl`) AS `hp_per_cyl..mu`,
STDDEV_SAMP(`hp_per_cyl`) AS `hp_per_cyl..sigma`,
AVG(`efficiency`) AS `efficiency..mu`,
STDDEV_SAMP(`efficiency`) AS `efficiency..sigma`,
COUNT(*) AS `n`
FROM (
SELECT
`mpg`,
`disp`,
`hp`,
`hp` / `cyl` AS `hp_per_cyl`,
`mpg` / `disp` AS `efficiency`,
`cyl`,
`drat`,
`wt`,
`qsec`,
`vs`,
`am`,
`gear`,
`carb`
FROM `df`
WHERE (`cyl` = 6.0)
) AS `q01`
) AS `q01`
UNION ALL
SELECT `n`, 'mpg' AS `Variable`, 'sigma' AS `Stat`, `mpg..sigma` AS `Est`
FROM (
SELECT
AVG(`mpg`) AS `mpg..mu`,
STDDEV_SAMP(`mpg`) AS `mpg..sigma`,
AVG(`hp_per_cyl`) AS `hp_per_cyl..mu`,
STDDEV_SAMP(`hp_per_cyl`) AS `hp_per_cyl..sigma`,
AVG(`efficiency`) AS `efficiency..mu`,
STDDEV_SAMP(`efficiency`) AS `efficiency..sigma`,
COUNT(*) AS `n`
FROM (
SELECT
`mpg`,
`disp`,
`hp`,
`hp` / `cyl` AS `hp_per_cyl`,
`mpg` / `disp` AS `efficiency`,
`cyl`,
`drat`,
`wt`,
`qsec`,
`vs`,
`am`,
`gear`,
`carb`
FROM `df`
WHERE (`cyl` = 6.0)
) AS `q01`
) AS `q01`
UNION ALL
SELECT
`n`,
'hp_per_cyl' AS `Variable`,
'sigma' AS `Stat`,
`hp_per_cyl..sigma` AS `Est`
FROM (
SELECT
AVG(`mpg`) AS `mpg..mu`,
STDDEV_SAMP(`mpg`) AS `mpg..sigma`,
AVG(`hp_per_cyl`) AS `hp_per_cyl..mu`,
STDDEV_SAMP(`hp_per_cyl`) AS `hp_per_cyl..sigma`,
AVG(`efficiency`) AS `efficiency..mu`,
STDDEV_SAMP(`efficiency`) AS `efficiency..sigma`,
COUNT(*) AS `n`
FROM (
SELECT
`mpg`,
`disp`,
`hp`,
`hp` / `cyl` AS `hp_per_cyl`,
`mpg` / `disp` AS `efficiency`,
`cyl`,
`drat`,
`wt`,
`qsec`,
`vs`,
`am`,
`gear`,
`carb`
FROM `df`
WHERE (`cyl` = 6.0)
) AS `q01`
) AS `q01`
UNION ALL
SELECT
`n`,
'efficiency' AS `Variable`,
'sigma' AS `Stat`,
`efficiency..sigma` AS `Est`
FROM (
SELECT
AVG(`mpg`) AS `mpg..mu`,
STDDEV_SAMP(`mpg`) AS `mpg..sigma`,
AVG(`hp_per_cyl`) AS `hp_per_cyl..mu`,
STDDEV_SAMP(`hp_per_cyl`) AS `hp_per_cyl..sigma`,
AVG(`efficiency`) AS `efficiency..mu`,
STDDEV_SAMP(`efficiency`) AS `efficiency..sigma`,
COUNT(*) AS `n`
FROM (
SELECT
`mpg`,
`disp`,
`hp`,
`hp` / `cyl` AS `hp_per_cyl`,
`mpg` / `disp` AS `efficiency`,
`cyl`,
`drat`,
`wt`,
`qsec`,
`vs`,
`am`,
`gear`,
`carb`
FROM `df`
WHERE (`cyl` = 6.0)
) AS `q01`
) AS `q01`