SELECT query with SQLite database by using cursor, fetchall, fetchone with LIMIT to get records.

preview_player
Показать описание
About mounting google drive to colab with SQLite database
List of all Python SQLite tutorials

Connect to SQLite database first using the connection string. Then collect all records by using SELECT query suing execute() method. This method will take SQL query as input. WE will get one cursor and we can loop through this cursor to get each row of records.
Using WHERE condition we can get records of a particular class
fetchall()
By using fetchall() we can get a list of rows from the table with each column of data as elements.
fetchone()
By using fetchone() we can get a single record and we can print the details by using this output.
We can restrict the number of rows returned by the table by using LIMIT query in our SQL.
Рекомендации по теме
Комментарии
Автор

sir, is there a way to select all records "except" a particular column? can u please share that sql command if possible

vishalgiri