COMP3311 21T1 - Assignment 2SQL, Python, SQLiteDatabase SystemsLast updated: Monday 29th Mar 05:47pm (most recent updates are in [..])Due : Friday 16th April 17:00AimsThis assignment aims to give you practice inuse of SQL in SQLite (i.e., sqlite3)writing scripts in Python that interact with a databasepopulating a RDBMS with a larger dataset, and analysing the data; making test data for testing database applications;Your task is to complete the functionality of some command-line tools via a combination of database code and Python code.SummarySubmission: Login to Course Web Site > Assignments > Assignment 2 > Assignment 2 Specification > Make Submission > upload required files > [Submit]Required Files (total 3 files): msearch, toprank, shortestYou may also submit the assignment via the give command from CSE machines: give cs3311 a2 msearch toprank shortestDeadline: Friday 16 April 2021 @ 17:00Late Penalty: Late submissions will have marks deducted from the maximum achievable mark at the rate of 2% of the total mark per hour that they are late (i.e.,48% per day).This assignment contributes 20 marks toward your total mark for this course.Downloads: a2.tgz, a2.zipNote that a2.tgz and a2.zip contain the same material.Each archive contains the IMDB database dump a2.db, plus a sample Python code file called sample.What To Do Now:read this specification carefully and completelylogin to a CSE linux machinecreate a directory for this assignmentunpack the supplied zip file into this directoryget familiar with the schema and data by exploring and querying the provided database using the command: sqlite3 a2.dbfamiliarise (read the code) yourself with the provided sample Python code file called sampletry out the sample code by running: ./sample YEAR where YEAR is a number representing a year, e.g., 1989 make sure sample is executable (by chmod u+x sample) and run itcomplete the assignment tasks using sample as a reference templatesubmit all these files (the 'Required Files') via WebCMS3 or give as described aboveDetails of the above steps are further elaborated below. You can edit and run the Python files on any CSE machines.IntroductionA successful movie (including TV show) not only entertains audience, but also enables film companies to gain tremendous profit. A lot of factors (such as gooddirectors, experienced actors, etc) are important for creating good movies. Nevertheless, famous directors and actors usually bring an attractive box-office income,but they do not necessarily guarantee a highly rated imdb score. This assignment is based on an IMDB dataset to build several small Python commands to showinteresting results.The dataset itself contains around 5000 movies, spanning across 100 years in 66 countries. There are more than 2000 movie directors, and thousands ofactors/actresses. It also contains the IMDB rating score, numbers of votes and various facebook likes. To give you a feel for the kind of data that you are dealing with,a (unordered) glimpse of the dataset is included below:cs3311@wagner:~/sqlite/a2$ sqlite3 a2.dbSQLite version 3.27.2 2019-02-25 16:06:06Enter ".help" for usage hints.sqlite>sqlite> select * from movie limit 10;1|Avatar|2009|PG-13|178|English|USA|760505847|237000000|7352|Pirates of the Caribbean: At World's End|2007|PG-13|169|English|USA|309404152|300000000|5553|Spectre|2015|PG-13|148|English|UK|200074175|245000000|17764|The Dark Knight Rises|2012|PG-13|164|English|USA|448130642|250000000|10786|John Carter|2012|PG-13|132|English|USA|73058679|263700000|22177|Spider-Man 3|2007|PG-13|156|English|USA|336530303|258000000|6258|Tangled|2010|PG|100|English|USA|200807262|260000000|9229|Avengers: Age of Ultron|2015|PG-13|141|English|USA|458991599|250000000|141010|Harry Potter and the Half-Blood Prince|2009|PG|153|English|UK|301956980|250000000|111711|Batman v Superman: Dawn of Justice|2016|PG-13|183|English|USA|330249062|250000000|2180sqlite>sqlite> .headers onsqlite>sqlite> select * from movie limit 10;id|title|year|content_rating|duration|lang|country|gross|budget|director_id1|Avatar|2009|PG-13|178|English|USA|760505847|237000000|7352|Pirates of the Caribbean: At World's End|2007|PG-13|169|English|USA|309404152|300000000|5553|Spectre|2015|PG-13|148|English|UK|200074175|245000000|17762021/4/9 COMP3311 21T1 - Assignment 2https://www.cse.unsw.edu.au/~... 2/74|The Dark Knight Rises|2012|PG-13|164|English|USA|448130642|250000000|10786|John Carter|2012|PG-13|132|English|USA|73058679|263700000|22177|Spider-Man 3|2007|PG-13|156|English|USA|336530303|258000000|6258|Tangled|2010|PG|100|English|USA|200807262|260000000|9229|Avengers: Age of Ultron|2015|PG-13|141|English|USA|458991599|250000000|141010|Harry Potter and the Half-Blood Prince|2009|PG|153|English|UK|301956980|250000000|111711|Batman v Superman: Dawn of Justice|2016|PG-13|183|English|USA|330249062|250000000|2180sqlite>sqlite> select * from rating limit 10;movie_id|num_critic_for_reviews|num_user_for_reviews|num_voted_users|movie_facebook_likes|cast_total_facebook_likes|imdb_1|723|3054|886204|33000|4834|7.92|302|1238|471220|0|48350|7.13|602|994|275868|85000|11700|6.84|813|2701|1144337|164000|106759|8.56|462|738|212204|24000|1873|6.67|392|1902|383056|0|46055|6.28|324|387|294810|29000|2036|7.89|635|1117|462669|118000|92000|7.510|375|973|321795|10000|58753|7.511|673|3018|371639|197000|24450|6.9sqlite>sqlite> .mode columnsqlite>sqlite> select * from director limit 10;id name facebook_likes
...