Setting Up a Table in SQLite
In order to perform operations, we need to create a table in our database first. We can simply create a table with below query.
Table : w3wiki
Query:
CREATE TABLE w3wiki (
id INTEGER PRIMARY KEY,
name TEXT,
rank INTEGER,
total_score INTEGER
);
Now, we have created a table, lets add some data to it and display it. We can simply add the data to our table with below query.
Query:
--Data Insertion
INSERT INTO w3wiki(id, name, rank, total_score)
VALUES(101,'Vishu',01,500);
INSERT INTO w3wiki(id, name, rank, total_score)
VALUES(102,'Aayush',02,400);
INSERT INTO w3wiki(id, name, rank, total_score)
VALUES(103,'Neeraj',03,450);
INSERT INTO w3wiki(id, name, rank, total_score)
VALUES(104,'Sumit',04,350);
INSERT INTO w3wiki(id, name, rank, total_score)
VALUES(105,'Vivek',05,200);
--Displaying our table's data
SELECT * From w3wiki;
Output:
Now, we are are done with creating the table and inserting data to it. Lets move to some case based examples.
How to Set a Column Value to NULL in SQLite?
SQLite is a lightweight and self-contained relational database management system in short RDBMS. Its has a server-less architecture which makes it a better option for small desktop and mobile applications. It also requires very low configuration which eventually helps the developer to integrate it into any applications with great ease. In this article, we are going to explore the topic “how to set a column value to null“. We are going to explore all its required concepts with clear and concise examples.