CREATE TABLE keyword (id NUMBER, keyword CLOB)
CREATE TABLE company (id NUMBER, name CLOB, country_code VARCHAR2)
CREATE TABLE directed_by (id NUMBER, msid NUMBER, did NUMBER)
CREATE TABLE actor (aid NUMBER, gender CLOB, name CLOB, nationality CLOB, birth_city CLOB, birth_year NUMBER)
CREATE TABLE written_by (id NUMBER, msid NUMBER, wid NUMBER)
CREATE TABLE classification (id NUMBER, msid NUMBER, gid NUMBER)
CREATE TABLE director (did NUMBER, gender CLOB, name CLOB, nationality CLOB, birth_city CLOB, birth_year NUMBER)
CREATE TABLE producer (pid NUMBER, gender CLOB, name CLOB, nationality CLOB, birth_city CLOB, birth_year NUMBER)
CREATE TABLE genre (gid NUMBER, genre CLOB)
CREATE TABLE movie (mid NUMBER, title CLOB, release_year NUMBER, title_aka CLOB, budget CLOB)
CREATE TABLE copyright (id NUMBER, msid NUMBER, cid NUMBER)
CREATE TABLE tv_series (sid NUMBER, title CLOB, release_year NUMBER, num_of_seasons NUMBER, num_of_episodes NUMBER, title_aka CLOB, budget CLOB)
CREATE TABLE made_by (id NUMBER, msid NUMBER, pid NUMBER)
CREATE TABLE tags (id NUMBER, msid NUMBER, kid NUMBER)
CREATE TABLE writer (wid NUMBER, gender CLOB, name CLOB, nationality CLOB, birth_city CLOB, birth_year NUMBER)
CREATE TABLE cast (id NUMBER, msid NUMBER, aid NUMBER, role CLOB)

What is the maximum number of movies in which ' Brad Pitt ' act in a given year ?
SELECT MAX(DERIVED_TABLEalias0.DERIVED_FIELDalias0) FROM (SELECT COUNT(DISTINCT (MOVIE.TITLE)), CAST, MOVIE WHERE ACTORalias0.NAME = ' Brad Pitt ' AND CAST.AID = ACTORalias0.AID AND MOVIE.MID = CAST.MSID GROUP BY MOVIE.RELEASE_YEAR) AS DERIVED_TABLEalias0
WITH "DERIVED_TABLEalias0" AS (SELECT MAX(1) AS "_" WHERE "ACTORalias0"."AID" = "CAST"."AID" AND "ACTORalias0"."NAME" = ' Brad Pitt ' AND "CAST"."MSID" = "MOVIE"."MID" GROUP BY "MOVIE"."RELEASE_YEAR") SELECT MAX("DERIVED_TABLEalias0"."DERIVED_FIELDalias0") FROM "DERIVED_TABLEalias0" "DERIVED_TABLEalias0"