In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article, the editor introduces in detail "how to use the keyword AUTOINCREMENT of SQLite". The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to use the keyword AUTOINCREMENT of SQLite" can help you solve your doubts.
Autoincrement means automatic increment in Chinese. T is a keyword in SQLite, which is used to automatically increment the values of fields in a table. You can use the AUTOINCREMENT keyword on a specific list name to automatically increase the value of this field when you create a table.
Grammar
The basic usage of the AUTOINCREMENT keyword is as follows:
CREATE TABLE table_name (column1 INTEGER AUTOINCREMENT, column2 datatype, column3 datatype,. ColumnN datatype,); instance
Suppose the COMPANY table to be created is as follows:
Sqlite > CREATE TABLE COMPANY (ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT NOT NULL, AGE INT NOT NULL, ADDRESS CHAR (50), SALARY REAL)
Now, insert the following record into the COMPANY table:
INSERT INTO COMPANY (NAME,AGE,ADDRESS,SALARY) VALUES ('Paul', 32,' California', 20000.00); INSERT INTO COMPANY (NAME,AGE,ADDRESS,SALARY) VALUES ('Allen', 25,' Texas', 15000.00); INSERT INTO COMPANY (NAME,AGE,ADDRESS,SALARY) VALUES ('Teddy', 23,' Norway', 20000.00); INSERT INTO COMPANY (NAME,AGE,ADDRESS,SALARY) VALUES ('Mark', 25,' Rich-Mond', 65000.00) INSERT INTO COMPANY (NAME,AGE,ADDRESS,SALARY) VALUES ('David', 27,' Texas', 85000.00); INSERT INTO COMPANY (NAME,AGE,ADDRESS,SALARY) VALUES ('Kim', 22,' South-Hall', 45000.00); INSERT INTO COMPANY (NAME,AGE,ADDRESS,SALARY) VALUES ('James', 24,' Houston', 10000.00)
This inserts seven tuples into the COMPANY table, and the record of the COMPANY table is as follows:
ID NAME AGE ADDRESS SALARY--1 Paul 32 California 20000.02 Allen 25 Texas 15000.03 Teddy 23 Norway 20000.04 Mark 25 Rich-Mond 65000.05 David 27 Texas 85000.06 Kim 22 South-Hall 45000.07 James 24 Houston 10000.0 read here This article "how to use the keyword AUTOINCREMENT of SQLite" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about the article, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.