Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
with watches_emily as ( select distinct r.customer_id from film as f inner join film_actor as fa on fa.film_id = f.film_id inner join actor as a on a.actor_id = fa.actor_id inner join inventory as i on i.film_id = f.film_id inner join rental as r on r.inventory_id = i.inventory_id where a.first_name = "EMILY" and a.last_name = "DEE" ) select c.last_name, c.first_name from customer as c where not exists (select we.customer_id from watches_emily as we where we.customer_id = c.customer_id) group by c.first_name, c.last_name order by c.last_name /* with watches_emily as ( select distinct r.customer_id from film as f inner join film_actor as fa on fa.film_id = f.film_id inner join actor as a on a.actor_id = fa.actor_id inner join inventory as i on i.film_id = f.film_id inner join rental as r on r.inventory_id = i.inventory_id where a.first_name = "EMILY" and a.last_name = "DEE" ) select distinct c.last_name, c.first_name from customer as c where not exists (select we.customer_id from watches_emily as we where we.customer_id = c.customer_id) order by c.last_name */ /* SELECT last_name, first_name FROM customer c WHERE NOT EXISTS ( SELECT 1 FROM rental r JOIN inventory i ON r.inventory_id = i.inventory_id JOIN film_actor fa ON i.film_id = fa.film_id JOIN actor a ON fa.actor_id = a.actor_id WHERE r.customer_id = c.customer_id AND a.first_name = 'EMILY' AND a.last_name = 'DEE' ) ORDER BY last_name; */ ; show status like 'Last_query_cost';

Stuck with a problem? Got Error? Ask AI support!

Copy Clear