By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE users
AS
SELECT 'passenger' AS user_type
Records: 1 Duplicates: 0 Warnings: 0
INSERT INTO users
(`user_type`)
VALUES
('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),
('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),
('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),
('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),('driver'),
('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),
('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),
('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),
('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),
('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),
('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),
('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),
('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),
('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),('passenger'),
('passenger'),('passenger'),('passenger');
Records: 89 Duplicates: 0 Warnings: 0
SELECT user_type, COUNT(*) AS cnt, SUM(COUNT(*)) OVER() AS total
FROM users
WHERE user_type IN ('driver', 'passenger')
GROUP BY user_type
user_type | cnt | total |
---|---|---|
passenger | 58 | 90 |
driver | 32 | 90 |