CBSE Class 12 Informatics Practices
Question 63 of 70
Importing/Exporting Data between CSV Files/MySQL and Pandas — Question 7
Back to all questionsThe DataFrame df includes all the columns where 'zone' equals 'central'.
The code executes an SQL query to select all columns (*) from the "Sales" table where the "zone" column equals to "central". It then reads the results of the query into a pandas DataFrame df using pandas.read_sql(). Then, it returns the first five rows of df using df.head().