SQLite Forum

Placeholder for table name when inserting data?
Login
> Data is simple financial stock market data with UNIQUE date, then columns: open, high, low, close and volume.

> each table is one stock ticker

> In this case, I'm probably OK with my schema?

I don't think so, and having to parametrise the table name is usually a red flag meaning that someone is not using SQL the way it was intended to be used. In this case each stock ticker is like a book type in TripeHound's example, so they might better be merged in one table. You won't have to parametrise table names if you make the ticker part of the table definition and make the constraint `UNIQUE(date, ticker)`. Making reports per each ticker would also become an SQL problem instead of "how to iterate over multiple similarly-defined tables in `$programming_language`" problem; instead you'd just add a `GROUP BY ticker` to an aggregating query.