Quick Functions
SQLite contains several functions for performing different types of options whether they are small or big. We don't have to write the SQL query to perform them every time just for a sneak peek.
getCNames
This function is used often when we have to retrieve the column names of tables(s).
Output:
getNColumns
Same as getCNames
but instead of returning the names of columns, it returns the number of columns.
Output:
getNRecords
This function is used when we have to calculate the no. of records in a table.
Output:
The output will be the same as the by getNColumns
but this time the count is for records instead of columns. It returns list
as the result.
getTCommand
This function is often used when we have get the command using which the specified tables was created. The order of output is same as of all other functions.
Output:
getTNames
This function is often used when we have get the names of tables in database(s).
Output:
getDbSize
This function is used when we have to get the size of database(s).
Output:
For example:
getSampleDb
This function is useful when we have to perform some test (or experiment) operations on a database apart from our main database. This function generates a sample database for those tests.
This function generates two types of databases, big
or small
.
bigData=False
will generate data with 3 tables city (1000 records)
, country (239 records)
, countrylanguage (303 records)
bigData=True
will generate data with 3 tables city (2500 records)
, country (239 records)
, countrylanguage (984 records)
Note: This data is taken from MySQL data repository and not generated by SQL-Tools team.
Last updated
Was this helpful?