/** 鼠标样式 **/

musql基础函数+流程函数+加常用语句

1.字符串函数

image

2.数值函数
image

3.日期函数

image

4.流程函数

image

image

-- show databases;
-- create table test.class(id VARCHAR(10));
-- use test;
-- show tables;
-- create table qw(name VARCHAR(5));
-- show databases;
-- show create table class;
-- alter table class add na VARCHAR(10);
-- alter table class change na aaa VARCHAR(10);
-- alter table class drop aaa;
-- use test;
-- rename table qw to te;
-- insert into class(id,name)values(66,'zz');
-- insert into class values(100,'12');
-- update class set id=666 where name=13;
-- delete from class;
-- insert into class values(11,'55');
-- truncate class;
-- desc class;
-- select name from class;
-- insert into class values('中国','男')
-- alter table class change id 国家 VARCHAR(10);
-- ALTER TABLE class CHANGE name sex VARCHAR(10);
-- select sex as se from class;
-- select CONCAT(国家,sex) from class;
-- select group_CONCAT(国家,sex) from class;
-- select distinct sex from class;
-- alter table class add age VARCHAR(10);
-- insert into class values('美国','女','20'),('日本','女','25');

-- select age from class where not age =10;
-- select age from class where age!=10;
-- select age from class where age BETWEEN 10 and 22;
-- select age from class where not age =10;
-- select age from class where age like '%0';
-- select age from class where age like '%1_';
-- select 国家,age from class where age in (10,20);
-- select COUNT(age)from class; -- sum min max avg

-- select sex,count()from class group by sex;
-- select sex,count(
)from class group by sex having count(*)>2;

-- select * from class order by age asc;
-- select * from class order by age desc ,sex asc;

-- select * from class limit 1,2;
-- use mysql;
-- select * from user;
-- create user zzz@'%' identified by '123456';
-- alter user 'zzz'@'%' identified by '1234';
-- drop user zzz@'%';
-- use mysql;
-- select * from user;

-- show grants for root@'localhost';
-- grant all on test.* to root@'localhost';
-- revoke all on test.* from root%'localhost';
-- alter user root@'localhost' identified by '1234';

show DATABASES;

posted @ 2024-03-26 10:49  aliex23k65  阅读(12)  评论(0)    收藏  举报