To run SQL queries in this project, we add %%sql on its own line to the start of our query. So to execute the query above, we’ll use the following code:
%%sql
SELECT *
FROM sqlite_master
WHERE type='table';
So, you need to run your statements with %%sql and not with %%capture at the top of the cell.
The following should run without issues -
%%sql
SELECT *
FROM sqlite_master
Please note that you will have to run the queries in separate cells as well.