
table and specified table name parameter, here specified table means actual table name, schema is an optional part of this syntax.īy using the above statement we describe the company_emp table, here the first column represents the column id, second is used for the column name, after that third used for the column name, next column is used for not null constraint and it represents by using 0 and 1, 1 for not null constraint and 0 for null constraint. In the above syntax, we use PRAGMA command with schema. Syntax PRAGMA schema.table_info(specified table name) Now we can describe the table by using the following command as follows. The end output of the above statement we illustrate by using the following screenshot as follows. In the above example, we use the use create table statement to create a new table name as company_emp with different fields such as emp_id, emp_name, emp_dept and emp_salary with different data types as shown in the above statement.

create table company_emp (emp_id integer primary key, emp_name text not null, emp_dept text not null, emp_salary text not null)

Now let’s see the different examples of describing tables as follows. First, we need to create a table by using the create table statement as follows. SQL: sql provides the different command means we can create tables, create views, create virtual tables or we can say create triggers that are executed against the database. We can represent rootpage as sqlite_schema_rootpage. Root page: It is used to store the page number of root b tree page for the table and index.

We can represent tbl_name as sqlite_schema_tbl_name. Tbl_name: This parameter is used to store the table name or a view. Without a rowid table, we can’t use the primary key constraint that means sqlite_schema does not allow for the primary key bur SQLite auto index uses the primary key. In this parameter, we can also define the unique and primary key constraint at that time of table creation and it created the internal index with name. Name: Name means column store name of object. The type we can represent as sqlite_schema.type. Type: SQLite type means text string such as table, view, index, or trigger as that depends on which type of object we defined. Schema uses the different parameters as follows. The above-mentioned second and third alternatives are only used for the temp database and are associated with each and every database connection.

As well as it has some alternative names as follows. Sqlite_schema is basically used as a reference for the schema table and it is granted by the name is main.sqlite_schema. Database uses the schema and is a depiction of the entirety of different tables, lists, triggers, and views that are contained inside the database. This is one of the commands to describe the table that is sqlite_master.Įach SQLite database has a solitary “schema table” that holds the schema for that database. The only difference is that it also returns the hidden column that specified the virtual table. This statement is the same as the above statement. This command is equivalent to the SQL describe command, this command returns the single row from every column from the specified table. This command is used to describe the specified table in this command first, we need to create the table.
