Page 29 - Phyton_GUIprogrammingwithTkinter
P. 29

P a ge  | 20



                       4)  Use the execute () methods to run the SQL query and return the result.





                       5)  Use fetchall () method or fetchone () method or fetchmany () method to extract
                          query result.
                              a.  fetchall () to retrieve ALL data;
                              b.  fetachmany (10) to fetch 10 data;
                              c.  fetchone () to retrieve the first data only.








                       6)  Use commit () method to save the data. This method is usually called when
                          inserting data, updating data, and deleting data.




                       7)  Use close () method to close cursor and open connections after our work
                          completes.
   24   25   26   27   28   29   30   31   32   33   34