47 solutions available
Question 1fetchone() methods will return only one row from the result set in the form of a tuple containing a record.
Question 2fetchall() method returns the result set in the form of tuples containing the records or rows returned by the SQL table.
Question 3A Resultset refers to a logical set of records that is fetched from the database.
Question 4A session between the application program and the database is called Connection.
Question 5A database cursor is a special control structure that facilitates the row-by-row processing of records in the result set.
Question 6A SELECT query is used to check if data has been added to the table or not.
Question 7To connect MySQL database, Python script is used.
Question 8The rowcount is a property of cursor object that returns the number of rows allowed from the cursor so far.
Question 9MySQLdb package can be imported in place of mysql-connector.
Question 10A Database is a collection of organized information that can be easily used, managed, updated and is classified according to its...
Question 1Which connector is used for linking the database with Python code?MySQL-connectorYesSQL: connectorPostSQL: connectorNone of these
Question 2To open a connector to MySQL database, which statement is used to connect with MySQL?connectorconnectpasswordusername
Question 3Which software is used for coding the Python language?IdeaIDLEPython ScriptConnector
Question 4Which command is used for counting the number of rows in a database?rowrowcountcount()row_count
Question 5Name the method which is used for displaying only one record from the result set.fetchmany()fetchno()fetchall()fetchone()
Question 6To execute all the rows from the result set, which method is used?fetchall()fetchone()fetchmany()none of these
Question 7Pick the correct username used for logging in database.rootlocaldirectoryhost
Question 8Name the host name used for signing in the database.localhostlocalpostlocalcostnone of these
Question 9The command used for modifying the records is:update()add()updateall()none of these
Question 10Which command is used for cleaning up the environment?my.closed()is.end()con.quit()mycon.close()
Question 11Which function of connection is used to check whether connection to MySQL is successfully done or not?import mysql.connector as mycon con...
Question 12Identify the correct statement to create cursor:import mysql.connector as msq con = msq.connect() #ConnectionString mycursor...
Question 1Explain the following 'results' retrieval methods with examples.(a) fetchone()(b) rowcount(c) fetchall()
Question 2What is the significance of connecting Python with MySQL?
Question 3Why do we use connect() function?
Question 4Explain the steps for establishing MySQL connection with Python.
Question 5Explain the transaction keywords used with MySQL-Python connectivity.
Question 6Give the significance of using execute() function.
Question 7Differentiate between commit() and rollback() statements.
Question 8Which function is used to connect to database?
Question 9Which function is used to run the SQL query?
Question 10Which function is used to read one record from the database?
Question 11Write a program to display all records in ascending order of their salary from table employee.
Question 12Write a program to increase salary of the employee, whose name is "MANOJ KUMAR", by 3000.
Question 13Write a program to delete the employee record whose name is read from keyboard at execution time.
Question 14Create a database TESTDB.
Question 15Create a table EMPLOYEE with Fields FIRST_NAME, LAST_NAME, AGE, GENDER and INCOME.
Question 1Read operation on any table means to fetch some useful information from the table.
Question 2Use fetchall() method to retrieve only one value from a database table.
Question 3rowcount is a read-only attribute.
Question 4To disconnect database connection, use connect() method.
Question 5Update statement is used to insert data into the table.
Question 6A result set is an object that is returned when a cursor object is used to query a table.
Question 7After establishing connection, execute() method is used.
Question 8fetchone() fetches the next row of a query result set.
Question 9DB-API is the standard for Python's database interface.
Question 10connect() method does not require any parameters.