Set up database best practice

I want to set up a database and populate with a default list of entries. I was thinking I would use:

CREATE TABLE IF NOT EXISTS

Then count the number of rows, if there are 0 rows I’d populate the table with default entries. I have two questions. Is this a good approach? Also, I’m having trouble formulating a query to count rows, I have been trying: 

db:rawQuery( “SELECT count(*) FROM table”, null )

Which doesn’t work. 

Looking at the Corona docs it looks like Corona only supports nrows() for retrieving data from the database. 

Looking at the Corona docs it looks like Corona only supports nrows() for retrieving data from the database.