Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
叶伟斌.sql 1.34 KB
Copy Edit Raw Blame History
新之助 authored 2021-09-02 09:09 . 1
CREATE database Func
use Func
drop table
create table user
(
UID int PRIMARY key auto_increment,
UNameID int UNIQUE,
UName VARCHAR(25) ,
UCode VARCHAR(25) ,
UCost DECIMAL not null,
UCState VARCHAR(25) not null,
Uptime datetime not null,
Uamend datetime not NULL
)
create table depot
(
DID int PRIMARY key auto_increment,
UNameID int UNIQUE,
Dquantity int not null,
FOREIGN key (UNameID) REFERENCES user(UNameID)
)
select ABS(UCost) from user
select CEIL(888.55)
select ceiling(888.22)
select FLOOR(55.22)
select RAND(5)
select ROUND(555.55)
select ROUND(555.34)
SELECT LENGTH('555555')
select CHAR_LENGTH('665222')
select REPLACE('54321',1,0)
SELECT INSERT('987654321',3,2,'2')
SELECT LEFT('987654321',1)
SELECT RIGHT('987654321',1)
select SUBSTRING('987654321',2,3)
select CONCAT('987654321','asd')
select LOWER('ASD')
select UPPER('asd')
select REVERSE('123456789')
SELECT TRIM(' sdf ')
SELECT LTRIM(' sdf ')
SELECT RTRIM(' sdf ')
SELECT REPLACE(' sd f ',' ','')
SELECT NOW()
SELECT FROM_UNIXTIME('10086'),UNIX_TIMESTAMP('2021-09-02 16:44:09')
SELECT IF(UCost>1000,'土豪','土狗') from user
SELECT CASE UCState
WHEN 1 THEN
'在线'
WHEN 2 THEN
'离线'
ELSE
'未知状态'
END
from user
SELECT IFNULL(UCost,'0') from user
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化