I'm very new to working with DBs/SQL and doing my best to get adjusted I'm using SQLAlchemy/Postgres to write data from a Python API that I write market data from every 10 minutes (inserted into DB). This scraper is intended to get stock minute "candles", so it should be inserting 10 rows into each stock every time. I started running it last night and noticed the numbers are a bit off, in that I did a SELECT count(*) FROM exchange WHERE market='x_market';
in pgcli and I got a count of 900, where it should be around 1000 (started running 1k minutes ago). Essentially, what I want to do (if possible) is to see if there are any gaps (data it didn't catch) between rows. Each row has a unix timestamp, and each timestamp "below it" should be 60000 ms (1 min) different. I know in Python I could just iterate through and check that, but I am interested in learning more about SQL (would be much nicer to just check on pgcli). Is it possible to check this (with SQL)? I am attaching a screenshot to show schema/what I mean.
Thanks very much in advance.
(For pic, timestamp (unix) is first column, and the remaining others are just the equity price data)