I have already created a table to the database.
Table is something like following (I am using sqlite on mac for iPhone dev)
create table
(
attendanceDate varchar,
studentNo integer,
absentDetail varchar
);
Now I have already committed this statements. What I need is the following:
- Add a composite primary key (attandanceDate,studentNo)
- add a foreign key studentNo
I don’t know the alter table syntax in sqlite3.
So, I need help.
Thanks in advance.
SQLITE3 does not have syntax to do what you want.
From the SQLITE documentation at http://www.sqlite.org/lang_altertable.html
You will need to recreate the table with the composite primary key and foreign key defined.