and python (againsome irrelevant output lines are omitted here) :\pp \dbase\sqlpython from sqlite import connect conn connect('dbase 'curs conn cursor(curs execute('delete from people'curs execute('select from people'curs fetchall([empty the table file open('data txt'rows [line rstrip(split(','for line in filerows[ ['bob''devel'' 'for rec in rowscurs execute('insert into people values (???)'reccurs execute('select from people'for rec in curs fetchall()print(rec('bob''devel' ('sue''music' ('ann''devel' ('tim''admin' ('kim''devel' this code makes use of list comprehension to collect string split results for all lines in the file after removing any newline charactersand file iterators to step through the file line by line its python loop does the same work as the mysql load statementand it will work on more database typesincluding sqlite we can get some similar result from an executemany db api call shown earlier as wellbut the python for loop here has the potential to be more general python versus sql in factyou have the entire python language at your disposal for processing database resultsand little python can often duplicate or go beyond sql syntax for instancesql has special aggregate function syntax for computing things such as sums and averagescurs execute("select sum(pay)avg(payfrom people where job 'devel'"curs fetchall([( )by shifting the processing to pythonwe can sometimes simplify and do more than sql' syntax allows (albeit potentially sacrificing any query performance optimizations the database may performcomputing pay sums and averages with python can be accomplished with simple loopsql database interfaces