SQLite databases are a single file on disk. In this case you already named it in your connection: "ontime.sqlite3". The error message occurs because your query select count(*), tailnum from ontime group by tailnum is asking for data in a table named ontime (inside the ontime DB), and presumably there...
First things first, mydata.sql is not an SQLite database, it's a text file containing SQL statements that will create and populate your database. I suggest you download an SQLite data browser such as this one, which is multiplatform. Using this tool, you can create an actual SQLite database. For instance,...