Track daily view count of youtube videos
Well, the biggest thoughts I have are regarding the application and data collection.  For example, why are you storing the entire address?  You really should only store the "v=" option of the querystring.  That's the part of the web address to tells youtube to go to the video.  If you store the entire address, then you may have one video stored multiple times when new attributes are added to the querystring (such as &amp;feature=youtube_gdata_player changes to &amp;feature=embedded_player or something).  I would just pull of the string between "v=" and the next "&amp;" to get a "VideoId" column.

Secondly, I would include a main table "Video" as such:

CREATE TABLE Video
(
    VideoPK INTEGER PRIMARY KEY IDENTITY,
    VideoId VARCHAR(100),
    PreviousViewCount BIGINT,
    CurrentViewCount BIGINT
)


This would allow you to do the screen scrape from Youtube, get the VideoID ("v=" parameter from the query string), set the PreviousViewCount to the CurrentViewCount and set the CurrentViewCount to whatever you find from the youtube screenscrape.  If you wanted to get fancy, you could add in a "SnapshotDate DATETIME" column to insure that at least 20 hours has passed since the last snapshot.

Then you could run a query against the Video table, something like:

SELECT VideoId 
FROM Video
WHERE CurrentViewCount - PreviousViewCount &gt; 1000


That would work out well for your purposes.

If you really wanted to log historical data, I would throw in a second table to do that:

CREATE TABLE VideoHistory
(
    HistoryID INTEGER PRIMARY KEY IDENTITY,
    VideoPK INTEGER 
        FOREIGN KEY REFERENCES Video(VideoPK),
    SnapshotDate DATETIME,
    ViewCount BIGINT
)


Then, when you did the screenscrape, add a new entry into the VideoHistory table.

At least, that's how I would approach it.



Edit:  First, I didn't realize this is SQLite, so that syntax won't work for you.
Secondly, I misunderstood the question



Since you want to view all videos that have had a count of 1000 or more for the past N days, I would stick with something like this:

CREATE TABLE VideoHistory
(
    HistoryID INTEGER PRIMARY KEY AUTOINCREMENT,
    VideoId VARCHAR(100),
    SnapshotDate DATETIME,
    ViewCount BIGINT,
)


The query for pulling the data is going to be slow (due to large amounts of data and correlated subqueries).  But a covering index should help out.

Also, I wouldn't put SearchTerm in the table since your search term probably won't change from one video to another.  I would add a secondary table, such as:

CREATE TABLE SearchTerm
(
    SnapshotDate DATETIME PRIMARY KEY,
    SearchTerm VARCHAR(100),
)


It will help remove the duplicate data.