sqlite
database; 삽입된 관계형 데이터베이스
英[ˈnˈsɜ:rt]
vt. 삽입; n. 삽입(특히 인쇄된 페이지에 삽입되거나 겹쳐 인쇄된 작은 그림);SQLite 삽입 기능 통사론
기능: SQLite의 INSERT INTO 문은 데이터베이스의 테이블에 새 데이터 행을 추가하는 데 사용됩니다.
구문: INSERT INTO TABLE_NAME (열1, 열2, 열3,...열N)] ,
VALUES (값1, 값2, 값3,...값N);
SQLite 삽입 기능 예
创建表:sqlite> CREATE TABLE COMPANY( ID INT PRIMARY KEY NOT NULL, NAME TEXT NOT NULL, AGE INT NOT NULL, ADDRESS CHAR(50), SALARY REAL ); INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (1, 'Paul', 32, 'California', 20000.00 ); INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (2, 'Allen', 25, 'Texas', 15000.00 ); INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (3, 'Teddy', 23, 'Norway', 20000.00 ); INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (4, 'Mark', 25, 'Rich-Mond ', 65000.00 ); INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (5, 'David', 27, 'Texas', 85000.00 ); INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (6, 'Kim', 22, 'South-Hall', 45000.00 ); 您也可以使用第二种语法在 COMPANY 表中创建一个记录,如下所示: INSERT INTO COMPANY VALUES (7, 'James', 24, 'Houston', 10000.00 ); 上面的所有语句将在 COMPANY 表中创建下列记录。 ID NAME AGE ADDRESS SALARY ---------- ---------- ---------- ---------- ---------- 1 Paul 32 California 20000.0 2 Allen 25 Texas 15000.0 3 Teddy 23 Norway 20000.0 4 Mark 25 Rich-Mond 65000.0 5 David 27 Texas 85000.0 6 Kim 22 South-Hall 45000.0 7 James 24 Houston 10000.0