SQLite: Ordering my select results
I have a table with unique usernames and a bunch of string data I am keeping track of. Each user will have 1000 rows and when I select them I want to return them in the order they were added. Is the following code a necessary and correct way of doing this:

CREATE TABLE foo (
  username TEXT PRIMARY KEY,
  col1 TEXT,
  col2 TEXT,
  ...
  order_id INTEGER NOT NULL
);

CREATE INDEX foo_order_index ON foo(order_id);

SELECT * FROM foo where username = 'bar' ORDER BY order_id;


SQLite: Ordering my select results
===

I have a table with unique usernames and a bunch of string data I am keeping track of. Each user will have 1000 rows and when I select them I want to return them in the order they were added. Is the following code a necessary and correct way of doing this:

CREATE TABLE foo (
  username TEXT PRIMARY KEY,
  col1 TEXT,
  col2 TEXT,
  ...
  order_id INTEGER NOT NULL
);

CREATE INDEX foo_order_index ON foo(order_id);

SELECT * FROM foo where username = 'bar' ORDER BY order_id;

