basic.result 1.9 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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
BASIC INSERT

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

select * from t_basic;
1 | 1 | A | 1
2 | 2 | B | 2
3 | 3 | D | 4
4 | 4 | C | 3
5 | 5 | E | 5.5
6 | 6 | F | 6.6
7 | 7 | G | 7.7
ID | AGE | NAME | SCORE

BASIC DELETE
delete from t_basic where id=3;
SUCCESS
select * from t_basic;
1 | 1 | A | 1
2 | 2 | B | 2
4 | 4 | C | 3
5 | 5 | E | 5.5
6 | 6 | F | 6.6
7 | 7 | G | 7.7
ID | AGE | NAME | SCORE

BASIC SELECT
select * from t_basic where id=1;
ID | AGE | NAME | SCORE
1 | 1 | A | 1

select * from t_basic where id>=5;
5 | 5 | E | 5.5
6 | 6 | F | 6.6
7 | 7 | G | 7.7
ID | AGE | NAME | SCORE

select * from t_basic where age>1 and age<3;
ID | AGE | NAME | SCORE
2 | 2 | B | 2

select * from t_basic where t_basic.id=1 and t_basic.age=1;
ID | AGE | NAME | SCORE
1 | 1 | A | 1

select * from t_basic where id=1 and age=1;
ID | AGE | NAME | SCORE
1 | 1 | A | 1

select id, age, name, score from t_basic;
1 | 1 | A | 1
2 | 2 | B | 2
4 | 4 | C | 3
5 | 5 | E | 5.5
6 | 6 | F | 6.6
7 | 7 | G | 7.7
ID | AGE | NAME | SCORE

select t_basic.id, t_basic.age, t_basic.name, t_basic.score from t_basic;
1 | 1 | A | 1
2 | 2 | B | 2
4 | 4 | C | 3
5 | 5 | E | 5.5
6 | 6 | F | 6.6
7 | 7 | G | 7.7
ID | AGE | NAME | SCORE

select t_basic.id, t_basic.age, name from t_basic;
1 | 1 | A
2 | 2 | B
4 | 4 | C
5 | 5 | E
6 | 6 | F
7 | 7 | G
ID | AGE | NAME

CREATE INDEX
create index i_id on t_basic (id);
SUCCESS
select * from t_basic;
1 | 1 | A | 1
2 | 2 | B | 2
4 | 4 | C | 3
5 | 5 | E | 5.5
6 | 6 | F | 6.6
7 | 7 | G | 7.7
ID | AGE | NAME | SCORE