Select Data

Report a typo

The following code defines the get_customers() function that takes a connection as a parameter, creates a cursor, and gets all records from the Customer table, and returns them. Organize the following code and don't forget to close the cursor and the connection! Yes! In that order!

Reorder lines using drag or arrows. Adjust indentation with left buttons
                customers = cursor.fetchall()
              
                cursor = con.cursor()
              
                cursor.execute('SELECT * FROM customers')
              
                return customers
              
                def get_customers(con):
              
                con.close()
              
                cursor.close()
              
___

Create a free account to access the full topic