How do I execute sqlite3 file into a database in mac terminal?
<p>I've tried the other suggestions on stackoverflow but can't seem to get it right. Nothing really works?</p>

<p>So say I have an sql file called afile.sql which contains sql commands for creating tables as well as inserting information into those tables, how do I run all these statements so that tables are created in a database I made in the terminal?</p>

<p>I have tried 
[someone@somewhere ~]$ echo "select * from sometable;" > file.sql
[someone@somewhere ~]$ sqlite3 file.db &lt; file.sql </p>

<p>from this link <a href="https://stackoverflow.com/questions/10045035/how-to-execute-an-sql-script-file-against-an-sqlite-3-database-file">How to execute an sql script file against an SQLite 3 database file?</a></p>

<p>and a few others. 
Should I be running the "insert sql command file into database" outside of sqlite3 or in sqlite 3?</p>

<p>I have tried:
DATA.db &lt; afile.sql(in sqlite3)
sqlite3 DATA.db &lt; afile.sql (not in sqlite3)</p>

<p>and also
.read afile.sql
DATA.db

<p>Nothing seems to work.</p>

<p>Screenshots:</p>

<p><a href="https://i.stack.imgur.com/LsFaD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LsFaD.png" alt="try 1"></a></p>

<p><a href="https://i.stack.imgur.com/h4p2q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h4p2q.png" alt="try 2"></a></p>

<p><a href="https://i.stack.imgur.com/cDD87.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cDD87.png" alt="still no database with instances stored in it =("></a></p>

<p>Still no database with instances stored in it =(</p>