I created a table in Sqlite by using the CREATE TABLE AS syntax to create a table based on a SELECT statement. Now this table has no primary key b
CREATE TABLE AS
SELECT
You can do it like this:
CREATE TABLE mytable ( field1 text, field2 text, field3 integer, PRIMARY KEY (field1, field2) );