- Connect to your PostgreSQL server from PSQL terminal by providing the connection details.
- Run the script xyz.sql
\i path/xyz.sql
NOTE: q1, q2, q3_1 and q3_2 can and should be run as above. q4 and q5 can also be run similarly, but the second query would override the results of the first query. So, you have to manually run each query in q4 if you want to cross-check the timings.