Using imdbpy2sql.py to create a database and using SQL to query the db, will provide you the required data.
You can also try using Java Movie Database or imdbdumpimport to read in the text files to SQL.
The last option to do this is parsing the plain text files provided by IMDb yourself.