SELECT genre, films_id FROM Genre_has_films;
SELECT name FROM Directors;
SELECT title FROM Films;

SELECT genre FROM Genre WHERE action = 1;
SELECT actor_id FROM Actor_has_films WHERE films_id = 'AAAAAAAA';
SELECT title FROM Films WHERE films_id = 'AAAAAAAA';

SELECT name FROM Actors
WHERE age > 50
ORDER BY age;

SELECT director_id, age FROM Directors
WHERE gender = 'F'
ORDER BY age; 

SELECT COUNT(actor_id) FROM Actors;
SELECT MAX(age) FROM Directors;

SELECT name, gender, MIN(age) FROM Actors
WHERE gender = 'F';

SELECT director_id, COUNT(*) FROM Directors
WHERE gender = 'M';

SELECT title, COUNT(*) FROM Films 
GROUP BY title;

SELECT gender, AVG(age) FROM Directors
GROUP BY gender;

SELECT duration, COUNT(*) FROM Films 
GROUP BY reviews
HAVING reviews > 8;

SELECT name, age, gender FROM Directors
GROUP BY gender
HAVING age > AVG(age);

SELECT * FROM Actor_has_films INNER JOIN Actors ON Actor_has_films.actor_id = Actors.actor_id;

SELECT Directors.name, Directs.films_id FROM Directors, Directs 
WHERE Directors.director_id = Directs.director_id;

SELECT * FROM Actor_has_films 
LEFT OUTER JOIN Films 
ON Actor_has_films.films_id = Films.films_id
LEFT OUTER JOIN Actors
ON Actor_has_films.actor_id = Actors.actor_id;

SELECT * FROM Directs
CROSS JOIN Actor_has_films 
CROSS JOIN Genre_has_films;

SELECT * FROM Actor_has_films 
LEFT OUTER JOIN Films 
ON Actor_has_films.films_id = Films.films_id
LEFT OUTER JOIN Actors
ON Actor_has_films.actor_id = Actors.actor_id 
LEFT OUTER JOIN Directs 
ON Films.films_id = Directs.films_id;

SELECT * FROM Films
CROSS JOIN Actor_has_films 
CROSS JOIN Directs 
CROSS JOIN Actors;






