query = """ INSERT INTO res_company (name, email)
VALUES (‘Demo company, ‘demo@gmail.com')"""
self.env.cr.execute(query)
query = “””SELECT * FROM res_company”””
self.env.cr.execute(query)

Let’s have a look,
self.env.cr.execute(“INSERT INTO res_company(name) VALUES(‘demo company)”)
This is an example of inserting new data into the res.company model. ‘name’ is the corresponding field name where we are going to insert data and ‘demo company’ is the new data that we are inserting to that field.
self.env.cr.execute("""UPDATE res_company SET phone=’23’ WHERE id=50""")
This is an example of modifying existing data. Here updating the contact number of the company whose ID is 50 on the res.company model.
self.env.cr.execute("""DELETE FROM res_company WHERE id=5""")
This is an example of deleting an existing record from res.company model
self.env.cr.execute(“””SELECT * FROM res_company”””)
self.env.cr.fetchall()
This is an example of fetching all the data from the res.company model.