SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
DROP TABLE IF EXISTS Directors; CREATE TABLE Directors ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(40), surname VARCHAR(40), country VARCHAR(40), rating INT ); TRUNCATE Directors; INSERT INTO Directors (name, surname, country, rating) VALUES ('Christopher', 'Nolan', 'England', 90), ('Steven', 'Spielberg', 'USA', 79), ('Quentin', 'Tarantino', 'USA', 95), ('Martin', 'Scorsese', 'USA', 68), ('David', 'Fincher', 'USA', 100), ('Ridley', 'Scott', 'England', 54), ('Stanley', 'Kubrick', 'USA', 9), ('Clint', 'Eastwood', 'USA', 74), ('James', 'Cameron', 'Canada', 11), ('Tim', 'Burton', 'USA', 41); SELECT AVG(rating) FROM Directors GROUP BY country --WHERE country != 'USA' --TIME(order_time) = GREATEST(TIME_TO_SEC(order_time))days_spent --ORDER BY num_of_names, letter --LIMIT 1

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear