this duplication of string data violates one of the best practices for database normalization which basically states that we should never put the same string data in the database more than once if we need the data more than oncewe create numeric key for the data and reference the actual data using this key in practical termsa string takes up lot more space than an integer on the disk and in the memory of our computerand takes more processor time to compare and sort if we only have few hundred entriesthe storage and processor time hardly matters but if we have million people in our database and possibility of million friend linksit is important to be able to scan data as quickly as possible we will store our twitter accounts in table named people instead of the twitter table used in the previous example the people table has an additional column to store the numeric key associated with the row for this twitter user sqlite has feature that automatically adds the key value for any row we insert into table using special type of data column (integer primary keywe can create the people table with this additional id column as followscreate table people (id integer primary keyname text uniqueretrieved integernotice that we are no longer maintaining friend count in each row of the people table when we select integer primary key as the type of our id columnwe are indicating that we would like sqlite to manage this column and assign unique numeric key to each row we insert automatically we also add the keyword unique to indicate that we will not allow sqlite to insert two rows with the same value for name now instead of creating the table pals abovewe create table called follows with two integer columns from_id and to_id and constraint on the table that the combination of from_id and to_id must be unique in this table ( we cannot insert duplicate rowsin our database create table follows (from_id integerto_id integerunique(from_idto_idwhen we add unique clauses to our tableswe are communicating set of rules that we are asking the database to enforce when we attempt to insert records we are creating these rules as convenience in our programsas we will see in moment the rules both keep us from making mistakes and make it simpler to write some of our code in essencein creating this follows tablewe are modelling "relationshipwhere one person "followssomeone else and representing it with pair of numbers indicating that (athe people are connected and (bthe direction of the relationship programming with multiple tables we will now redo the twitter spider program using two tablesthe primary keysand the key references as described above here is the code for the new version of the program