This document outlines how to interface Python with MySQL. It discusses establishing a connection, checking the connection, creating and altering tables, inserting, updating, deleting, and selecting data. Key steps include importing the MySQL connector module, creating a connection object, getting a cursor instance, executing SQL queries, and using cursor methods like fetchall(), fetchone(), and fetchmany() to retrieve result sets from queries.
This document outlines how to interface Python with MySQL. It discusses establishing a connection, checking the connection, creating and altering tables, inserting, updating, deleting, and selecting data. Key steps include importing the MySQL connector module, creating a connection object, getting a cursor instance, executing SQL queries, and using cursor methods like fetchall(), fetchone(), and fetchmany() to retrieve result sets from queries.
This document outlines how to interface Python with MySQL. It discusses establishing a connection, checking the connection, creating and altering tables, inserting, updating, deleting, and selecting data. Key steps include importing the MySQL connector module, creating a connection object, getting a cursor instance, executing SQL queries, and using cursor methods like fetchall(), fetchone(), and fetchmany() to retrieve result sets from queries.
This document outlines how to interface Python with MySQL. It discusses establishing a connection, checking the connection, creating and altering tables, inserting, updating, deleting, and selecting data. Key steps include importing the MySQL connector module, creating a connection object, getting a cursor instance, executing SQL queries, and using cursor methods like fetchall(), fetchone(), and fetchmany() to retrieve result sets from queries.
d="delete from emp where id=555" cur=mycon.cursor( ) cur.execute(d) mycon.commit( ) print("Data Deleted")
BY: FARAH ARIF 1
7. Update data in MySQL Table: u="update emp set Salary=20000 where city='Gonda'" cur=mycon.cursor( ) cur.execute(u) mycon.commit( ) print("Updation Done")
OR
u1="update emp set Salary=25000 where name='Anil Soni'"
Download Full Handbook of Reinforcement Learning and Control: 325 (Studies in Systems, Decision and Control, 325) Kyriakos G. Vamvoudakis (Editor) PDF All Chapters