MySQL之資料型別與運算元據表

2021-08-02 23:16:50 字數 541 閱讀 1979

檢視資料庫:

show databases;

建立資料庫:

create database test;

進入開啟資料庫:

use test;

檢視當前在哪個資料庫:

select database();

建立乙個表:

create table th1(

column_name data_type,

...)

檢視資料表

show tables;

檢視某個資料庫中的所有表

show tables from mysql;

檢視資料表結構

show columns from tb1;

插入記錄

insert tb1 values('tom',25,7863.25);

給某一部分字段賦值

insert tb1(username,salary) values('john',4500.69);

檢視插入的記錄

select * from tb1;

MySQL 資料型別與運算元據表 二

一 資料型別 整型 浮點型 日期時間型別 字元型 建立資料表 creater table if not exist table name column name data type,檢視資料表 show tables from db name like pattern where expr 檢視資料...

MySQL資料型別和運算元據表

tinyint 1位元組 有符號值 128到127 2 7 到 2 7 1 無符號值 0 到 255 0 到 2 8 1 smallint 2位元組 有符號值 3278 到 32767 2 15 到 2 15 1 無符號值 0 到 65535 0 到 2 16 1 mediumint 3位元組 有符...

MySQL 2 資料型別與運算元據表

mysql資料型別之整型 資料型別 決定資料儲存格式,代表不同的資訊型別。整型 有符號位 數字最高位01表示正負 mysql資料型別之浮點型 注意m和d,一定m d mysql資料型別之日期時間型 列型別 儲存需求 year 1 time 3 data 3 datetime 8 timesstamp...