using databases and sql ( 'drchuck' ( 'opencontent' ( 'lhawthorn' ( 'steve_coppin' ( 'davidkocher' rows follows( ( ( ( ( rows connections for id= ( 'drchuck' ( 'cnxorg' ( 'kthanos' ( 'somethinggirl' ( 'ja_pac' rows you see the columns from the people and follows tables and the last set of rows is the result of the select with the join clause in the last selectwe are looking for accounts that are friends of "opencontent( people id= in each of the "metarowsin the last selectthe first two columns are from the follows table followed by columns three through five from the people table you can also see that the second column (follows to_idmatches the third column (people idin each of the joined-up "metarows summary this has covered lot of ground to give you an overview of the basics of using database in python it is more complicated to write the code to use database to store data than python dictionaries or flat files so there is little reason to use database unless your application truly needs the capabilities of database the situations where database can be quite useful are( when your application needs to make many small random updates within large data set( when your data is so large it cannot fit in dictionary and you need to look up information repeatedlyor ( when you have long-running process that you want to be able to stop and restart and retain the data from one run to the next you can build simple database with single table to suit many application needsbut most problems will require several tables and links/relationships between rows in different tables when you start making links between tablesit is important to do some thoughtful design and follow the rules of database normalization to make the best use of the database' capabilities since the primary motivation for using database is that you have large amount of data to deal withit is important to model your data efficiently so your programs run as fast as possible