Hi, "CREATE TABLE ALBUM(AlbumId INTEGER PRIMARY KEY NOT NULL,AlbumName TEXT NOT NULL COLLATE NOCASE ,AlbumTrackCount INTEGER,UNIQUE(AlbumName));"
AlbumId AlbumName AlbumTrackCount 1 aaa 3 2 ddd 2 3 ccc 1 Here I am maintaining the Number of track for that particular Album in AlbumTrackCount. Bcoz I need to find the total number of track so instead of using "select Count(*) from MUSIC where Album_Id = 1 ;" I will just read the AlbumTrackCount from ALBUM table.This speed up my performance. "CREATE TABLE MUSIC(Id INTEGER PRIMARY KEY NOT NULL,Track TEXT NOT NULL,Album_Id INTEGER);" Id Track Album_Id 1 t1 1 2 t2 1 3 t3 1 4 t4 2 5 t5 2 6 t6 3 I want to update all the Album to some new name say 'xxx' then i have to delete all the records in ALBUM table and to insert one new Album with name as 'xxx' and the AlbumTrackCount should now become 7.After that I have to change the Album_Id in MUSIC also. So after updating AlbumId AlbumName AlbumTrackCount 1 xxx 7 And all the Album_Id value should be 1. Can any one help to solve this. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users