Giter VIP home page Giter VIP logo

Comments (2)

DandreChen avatar DandreChen commented on May 23, 2024

1.版本号测试
./mysqld --version
2.DDL
建库:
create database if not exists stdb character set utf8mb4;
建表:
use stdb ;
create table person(id int, name varchar(20)) engine=tianmu;
更改表结构:
desc person;
show create table person;
alter table person drop column id;
alter table person add column id int;
删除:
drop table person;
drop database stdb ;
3.DML
插入:
insert into person (id, name) value (1, " zhangsan "),(2, " lisi ");
修改:
update person set name= " wangwu " where id=2;
删除:
delete from person where id=1;
4.DQL
查询:
select * from person where id=2;
in用法:
create table tin(id int,name varchar(25),sex varchar(25)) engine=tianmu;
insert into tin values(1,"atom","male");
insert into tin values(2,"atomdb","male");
insert into tin values(3,"atomdb","male");
insert into tin values(5,"atomdb","male");
insert into tin values(4,"atomdb","male");
select * from tin where id in (1,3,4);
select * from tin where id in (select id from tin);
自增用法:
create table tin(id int,name varchar(25),sex varchar(25)) engine=tianmu;
insert into tauto(name,sex) values("atom",1);
insert into tauto(name,sex) values("atom",2);
insert into tauto(name,sex) values("atom",3);
select * from tauto;
5.大数据量性能测试
create table t8(id int,
a varchar(10) comment "LOOKUP",
b varchar(10),
c varchar(10),
d varchar(10),
e varchar(10),
f varchar(10),
g varchar(10)
) ENGINE=tianmu;

delimiter ;;
create procedure idata8()
begin
declare i int;
set i=1;
while(i<=1000000)do
insert into t8 values(i, '1234567890','1234567890','1234567890','1234567890','1234567890','1234567890','1234567890');
set i=i+1;
end while;
commit;
end;;
delimiter ;
call idata8();

from mysql-server-mysql-8.0.30.

DandreChen avatar DandreChen commented on May 23, 2024

6.索引测试
非主键索引:
create database db1;
use db1;
create table tindex(id int, name varchar(25), index(name)) engine=tianmu;
insert into tindex values(1,"sss");
insert into tindex values(1,"zz");
insert into tindex values(1,"www");
select * from tindex where name="ss";

主键索引:
CREATE TABLE tauto (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(25) DEFAULT NULL,
sex varchar(25) DEFAULT NULL,
PRIMARY KEY id (id)
) ENGINE=tianmu DEFAULT CHARSET=utf8 ;
insert into tauto(name, sex) values("ss","sss");
insert into tauto(name, sex) values("zz","zzz");
insert into tauto(name, sex) values(:"ww","www");
select * from tautowhere name="ss";

7.varchar类型主键插入空值
CREATE TABLE haha
(name VARCHAR(25),
deptId INT(11),
salary FLOAT,
PRIMARY KEY(name)) engine=tianmu;
INSERT INTO haha(deptId,salary) values (13,888);

from mysql-server-mysql-8.0.30.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.