-------------- SELECT COUNT(*) FROM ronfle -------------- +----------+ | COUNT(*) | +----------+ | 100 | +----------+ 1 row in set (0.00 sec) -------------- SELECT COUNT(*) FROM ronfle WHERE sexe=0 -------------- +----------+ | COUNT(*) | +----------+ | 75 | +----------+ 1 row in set (0.00 sec) -------------- SELECT COUNT(*) FROM ronfle WHERE sexe=1 -------------- +----------+ | COUNT(*) | +----------+ | 25 | +----------+ 1 row in set (0.00 sec) -------------- SELECT sexe , COUNT(sexe) FROM ronfle GROUP BY sexe ORDER by sexe -------------- +------+-------------+ | sexe | COUNT(sexe) | +------+-------------+ | 0 | 75 | | 1 | 25 | +------+-------------+ 2 rows in set (0.00 sec) -------------- SELECT COUNT(*) FROM ronfle WHERE sexe=0 AND ronfle=0 -------------- +----------+ | COUNT(*) | +----------+ | 45 | +----------+ 1 row in set (0.00 sec) -------------- SELECT COUNT(*) FROM ronfle WHERE sexe=1 AND taba=1 -------------- +----------+ | COUNT(*) | +----------+ | 10 | +----------+ 1 row in set (0.00 sec) -------------- SELECT COUNT(*) FROM ronfle WHERE sexe=1 AND taba=1 AND ronfle=1 -------------- +----------+ | COUNT(*) | +----------+ | 1 | +----------+ 1 row in set (0.00 sec) -------------- SELECT 100.0*(1/10)," %" -------------- +--------------+----+ | 100.0*(1/10) | % | +--------------+----+ | 10.00 | % | +--------------+----+ 1 row in set (0.00 sec) -------------- SELECT COUNT(*) FROM ronfle WHERE sexe=1 AND taba=0 -------------- +----------+ | COUNT(*) | +----------+ | 15 | +----------+ 1 row in set (0.00 sec) -------------- SELECT COUNT(*) FROM ronfle WHERE sexe=1 AND taba=0 AND ronfle=1 -------------- +----------+ | COUNT(*) | +----------+ | 4 | +----------+ 1 row in set (0.00 sec) -------------- SELECT 100.0*(4/15)," %" -------------- +--------------+----+ | 100.0*(4/15) | % | +--------------+----+ | 26.67 | % | +--------------+----+ 1 row in set (0.00 sec) -------------- SELECT AVG(age) FROM ronfle WHERE sexe=0 -------------- +----------+ | AVG(age) | +----------+ | 52.5600 | +----------+ 1 row in set (0.00 sec) -------------- SELECT AVG(poids) FROM ronfle -------------- +------------+ | AVG(poids) | +------------+ | 90.4100 | +------------+ 1 row in set (0.00 sec) -------------- SELECT COUNT(*) FROM ronfle WHERE poids>90.41 -------------- +----------+ | COUNT(*) | +----------+ | 59 | +----------+ 1 row in set (0.00 sec) -------------- ALTER TABLE ronfle ADD vs INTEGER -------------- Query OK, 100 rows affected (0.02 sec) Records: 100 Duplicates: 0 Warnings: 0 -------------- UPDATE ronfle SET vs = IF(ronfle=1 AND taba=1,1,0) -------------- Query OK, 100 rows affected (0.00 sec) Rows matched: 100 Changed: 100 Warnings: 0 Bye