basic.test 1.0 KB
Newer Older
羽飞's avatar
羽飞 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
-- echo basic insert

create table t_basic(id int, age int, name char, score float);
insert into t_basic values(1,1, 'a', 1.0);
insert into t_basic values(2,2, 'b', 2.0);
insert into t_basic values(4,4, 'c', 3.0);
insert into t_basic values(3,3, 'd', 4.0);
insert into t_basic values(5,5, 'e', 5.5);
insert into t_basic values(6,6, 'f', 6.6);
insert into t_basic values(7,7, 'g', 7.7);

--sort select * from t_basic;

-- echo basic delete
delete from t_basic where id=3;
-- sort select * from t_basic;

-- echo basic select
select * from t_basic where id=1;

-- sort select * from t_basic where id>=5;

select * from t_basic where age>1 and age<3;

select * from t_basic where t_basic.id=1 and t_basic.age=1;

select * from t_basic where id=1 and age=1;

-- sort select id, age, name, score from t_basic;

-- sort select t_basic.id, t_basic.age, t_basic.name, t_basic.score from t_basic;

-- sort select t_basic.id, t_basic.age, name from t_basic;

-- echo create index
create index i_id on t_basic (id);
-- sort select * from t_basic;