📄 insert.sql
字号:
---- this test is for basic insert functionality---- NOTE: drop, create, select from the same table doesn't work yet either.-- create the tablescreate table t1 (i int, j int);create table t2 (k int, l int);-- populate t2insert into t2 values (1, 2);insert into t2 values (3, 4);-- select * from t2insert into t1 select * from t2;insert into t1 (i, j) select * from t2;insert into t1 (j, i) select * from t2;select * from t1;-- drop and recreate t1drop table t1;create table t1 (i int, j int);-- select column list from t2insert into t1 select k, l from t2;insert into t1 select l, k from t2;insert into t1 (i, j) select k, l from t2;insert into t1 (j, i) select k, l from t2;select * from t1;-- drop and recreate t1drop table t1;create table t1 (i int, j int);-- select constants from t2insert into t1 select 5, 6 from t2;insert into t1 (i, j) select 5, 6 from t2;insert into t1 (j, i) select 6, 5 from t2;select * from t1;-- drop and recreate t1drop table t1;create table t1 (i int, j int);insert into t1 (i) select 666 from t2;insert into t1 (j) select 666 from t2;select * from t1 where i = 666 or j = 666;-- drop and recreate t1drop table t1;create table t1 (i int, j int);-- Negative test cases - column references in values clauseinsert into t1 values(1, c1);insert into t1 values("asdf asdf", 2);-- Negative test case - syntax errorinsert into t1 values;-- Too many values in values clauseinsert into t1 values(1,1,1);-- insert select with too many result columns in selectinsert into t1 select 1, 2, 3 from t2;-- multiple instances of same column in colum listinsert into t1 (i, i) values(2,2);-- target column list size != source sizeinsert into t1 (i, j) values(1);insert into t1 (i) values (1, 2);-- Negative test cases - column name not specifiedinsert into t1 select 666 from t2;-- target table in source - deferred modeinsert into t1 values (1,1);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -