Database schema:

CREATE TABLE actors (
	actorid INTEGER NOT NULL -- example: ['16', '4'],
	a_gender TEXT NOT NULL -- example: ['M', 'F'],
	a_quality INTEGER NOT NULL -- example: ['0', '4'],
	PRIMARY KEY (actorid)
)


CREATE TABLE directors (
	directorid INTEGER NOT NULL -- example: ['7387', '12945'],
	d_quality INTEGER NOT NULL -- example: ['0', '1'],
	avg_revenue INTEGER NOT NULL -- example: ['0', '1'],
	PRIMARY KEY (directorid)
)


CREATE TABLE movies (
	movieid INTEGER DEFAULT 0 NOT NULL -- example: ['1672052', '1672111'],
	year INTEGER NOT NULL -- example: ['4', '3'],
	"isEnglish" TEXT NOT NULL -- example: ['F', 'T'],
	country TEXT NOT NULL -- example: ['other', 'USA'],
	runningtime INTEGER NOT NULL -- example: ['2', '3'],
	PRIMARY KEY (movieid)
)


CREATE TABLE movies2actors (
	movieid INTEGER NOT NULL -- example: ['1672052', '1672111'],
	actorid INTEGER NOT NULL -- example: ['88796', '88848'],
	cast_num INTEGER NOT NULL -- example: ['0', '1'],
	PRIMARY KEY (movieid, actorid), 
	CONSTRAINT fk_movies2actors_actors FOREIGN KEY(actorid) REFERENCES actors (actorid),
	CONSTRAINT fk_movies2actors_movies FOREIGN KEY(movieid) REFERENCES movies (movieid)
)


CREATE TABLE movies2directors (
	movieid INTEGER NOT NULL -- example: ['1672052', '1672111'],
	directorid INTEGER NOT NULL -- example: ['54934', '22397'],
	genre TEXT NOT NULL -- example: ['Adventure', 'Action'],
	PRIMARY KEY (movieid, directorid), 
	CONSTRAINT fk_movies2directors_directors FOREIGN KEY(directorid) REFERENCES directors (directorid),
	CONSTRAINT fk_movies2directors_movies FOREIGN KEY(movieid) REFERENCES movies (movieid)
)


CREATE TABLE u2base (
	userid INTEGER DEFAULT 0 NOT NULL -- example: ['2', '1'],
	movieid INTEGER NOT NULL -- example: ['1684486', '1685309'],
	rating TEXT NOT NULL -- example: ['2', '1'],
	PRIMARY KEY (userid, movieid), 
	CONSTRAINT fk_u2base_movies FOREIGN KEY(movieid) REFERENCES movies (movieid),
	CONSTRAINT fk_u2base_users FOREIGN KEY(userid) REFERENCES users (userid)
)


CREATE TABLE users (
	userid INTEGER DEFAULT 0 NOT NULL -- example: ['2', '1'],
	age TEXT NOT NULL -- example: ['1', '56'],
	u_gender TEXT NOT NULL -- example: ['M', 'F'],
	occupation TEXT NOT NULL -- example: ['2', '3'],
	PRIMARY KEY (userid)
)

Question: What is the total amount male and female actors who were casted in movie ID 1684910 and what is the proportion between the highest quality actors against the worst quality of actors? Indicate your answer in percentage. List the the director as well as the genre.
Evidence: Female actors mean that a_gender = 'F'; Male actors mean that a_gender = 'M'; a_quality = 5 refers to act the best, a_quality = 0 refers to act the worst

SQL:
SELECT SUM(IIF(a_gender = 'M', 1, 0)) , SUM(IIF(a_gender = 'F', 1, 0)) , CAST(SUM(IIF(a_quality = 5, 1, 0)) AS REAL) * 100 / COUNT(*) , CAST(SUM(IIF(a_quality = 0, 1, 0)) AS REAL) * 100 / COUNT(*), ( SELECT directorid FROM movies2directors WHERE movieid = 1684910 ) , ( SELECT genre FROM movies2directors WHERE movieid = 1684910 ) FROM actors WHERE actorid IN ( SELECT actorid FROM movies2actors WHERE movieid = 1684910 )