MySQL数据类型
目录
MySQL数据类型
在本教程中,您将了解MySQL数据类型以及如何在MySQL中设计数据库时有效地使用它们。
数据库表包含具有特定数据类型(如数字或字符串)的多个列。 MySQL提供更多的数据类型,而不仅仅是数字或字符串。 MySQL中的每种数据类型都可以通过以下特征来确定:
- 它用来表示数据值。
- 占用的空间以及值是固定长度还是可变长度。
- 数据类型的值可以被索引。
- MySQL如何比较特定数据类型的值。
数据类型 | 指定值和范围 |
---|---|
char |
String(0~255) |
varchar |
String(0~255) |
tinytext |
String(0~255) |
text |
String(0~65536) |
blob |
String(0~65536) |
mediumtext |
String(0~16777215) |
mediumblob |
String(0~16777215) |
longblob |
String(0~4294967295) |
longtext |
String(0~4294967295) |
tinyint |
Integer(-128~127) |
smallint |
Integer(-32768~32767) |
mediumint |
Integer(-8388608~8388607) |
int |
Integer(-214847668~214847667) |
bigint |
Integer(-9223372036854775808~9223372036854775807) |
float |
decimal(精确到23位小数) |
double |
decimal(24~54位小数) |
decimal |
将double 转储为字符串形式 |
date |
YYYY-MM-DD |
datetime |
YYYY-MM-DD HH:MM:SS |
timestamp |
YYYYMMDDHHMMSS |
time |
HH:MM:SS |
enum |
选项值之一 |
set |
选项值子集 |
boolean |
tinyint(1) |
MySQL数值数据类型
在MySQL中,您可以找到所有SQL标准数字类型,包括精确数字数据类型和近似数字数据类型,包括整数,定点和浮点数。 此外,MySQL还具有用于存储位值的BIT数据类型。数字类型可以是有符号或无符号,但BIT
类型除外。
下表显示了MySQL中数字类型的总结:
数字类型 | 描述 |
---|---|
TINYINT | 一个很小的整数 |
SMALLINT | 一个小的整数 |
MEDIUMINT | 一个中等大小的整数 |
INT | 一个标准整数 |
BIGINT | 一个大整数 |
DECIMAL | 定点数 |
FLOAT |
单精度浮点数 |
DOUBLE |
双精度浮点数 |
BIT | 一个字节字段 |
MySQL布尔数据类型
MySQL没有内置的 BOOLEAN 或 BOOL 数据类型。所以要表示布尔值,MySQL使用最小的整数类型,也就是TINYINT(1)
。 换句话说,BOOLEAN
和BOOL
是TINYINT(1)
的同义词。
MySQL字符串数据类型
在MySQL中,字符串可以容纳从纯文本到二进制数据(如图像或文件)的任何内容。可以通过使用LIKE运算符,正则表达式和全文搜索,根据模式匹配来比较和搜索字符串。
下表显示了MySQL中的字符串数据类型:
字符串类型 | 描述 |
---|---|
char | 固定长度的非二进制(字符)字符串 |
varchar | 可变长度的非二进制字符串 |
BINARY |
一个固定长度的二进制字符串 |
VARBINARY |
一个可变长度的二进制字符串 |
TINYBLOB |
一个非常小的BLOB(二进制大对象) |
BLOB |
一个小的BLOB(二进制大对象) |
MEDIUMBLOB |
一个中等大小的BLOB(二进制大对象) |
LONGBLOB |
一个大的BLOB(二进制大对象) |
TINYTEXT | 一个非常小的非二进制字符串 |
TEXT | 一个小的非二进制字符串 |
MEDIUMTEXT | 一个中等大小的非二进制字符串 |
LONGTEXT | 一个很大的非二进制字符串 |
ENUM | 枚举; 每个列值可以被分配一个枚举成员 |
SET |
集合; 每个列值可以分配零个或多个SET 成员 |
MySQL日期和时间数据类型
MySQL提供日期和时间的类型以及日期和时间的组合。 此外,MySQL还支持时间戳数据类型,用于跟踪表的一行中的更改。如果只想存储没有日期和月份的年份数据,则可以使用YEAR
数据类型。
下表说明了MySQL日期和时间数据类型:
字符串类型 | 描述 |
---|---|
DATE | YYYY-MM-DD 格式的日期值 |
TIME | hh:mm:ss 格式的时间值 |
DATETIME | YYYY-MM-DD hh:mm:ss 格式的日期和时间值 |
TIMESTAMP | YYYY-MM-DD hh:mm:ss 格式的时间戳记值 |
YEAR |
YYYY 或YY 格式的年值 |
MySQL空间数据类型
MySQL支持许多包含各种几何和地理值的空间数据类型,如下表所示:
字符串类型 | 描述 |
---|---|
GEOMETRY | 任何类型的空间值 |
POINT | 一个点(一对X-Y坐标) |
LINESTRING | 曲线(一个或多个POINT 值) |
POLYGON | 多边形 |
GEOMETRYCOLLECTION | GEOMETRY 值的集合 |
MULTILINESTRING | LINESTRING 值的集合 |
MULTIPOINT | POINT 值的集合 |
MULTIPOLYGON | POLYGON 值的集合 |
JSON数据类型
MySQL 5.7.8
版本支持原生JSON数据类型,可以更有效地存储和管理JSON文档。 本机JSON数据类型提供JSON文档的自动验证和最佳存储格式。
在本教程中,您学习了各种MySQL数据类型,可帮助您确定在创建表时应使用哪些数据类型。
移动端:请扫描本页面底部(右侧)二维码并关注微信公众号,回复:”教程” 选择相关教程阅读
lexapro pills lexapro uk purchase naltrexone online cheap
lasix brand order generic lasix 40mg order albuterol 2mg pills
strattera online buy zoloft price buy generic sertraline 50mg
ursodiol 300mg for sale brand ursodiol 300mg order zyrtec 5mg online
buy azithromycin 250mg online prednisolone buy online buy generic gabapentin
benefits of taking hydrochloric acid mucosal healing supplements prescription medicine for flatulance
oral deltasone 5mg prednisone 20mg cost amoxicillin 250mg over the counter
virtual birth control prescription delay ejaculation pills review walmart last longer pills
phenergan online order buy stromectol 12mg covid and ivermectin
order cymbalta 40mg without prescription buy generic duloxetine buy generic modafinil over the counter
lamisil toenail fungus success rate can you use abreva on genital herpes 4 deadly blood pressure medicines
cyproheptadine online buy order cyproheptadine 4mg sale buy ketoconazole medication
buy herpes drugs drugs to treat prediabete best diabetes drug without injection
buy medroxyprogesterone 10mg pill how to get praziquantel without a prescription buy hydrochlorothiazide 25mg for sale
best supplements for quitting smoking oral medication to stop smoking list of opioid medications
letrozole 2.5 mg oral femara over the counter aripiprazole 30mg uk
virtual visit online physician insomnia get sleep medication online the strongest weight loss pill
buy cheap uroxatral alfuzosin 10mg generic best medicine in stomach pain
minomycin order online generic minocin ropinirole for sale
Đến nay, OnCredit là đơn vị chuyên cung cấp dịch vụ tư vấn vay tiền, hỗ trợ hàng nghìn đơn đăng ký vay tiền nhanh online chuyển khoản 24 24 mỗi ngày. Rất nhiều khách hàng đã và đang đánh giá cao về chất lượng dịch vụ tại OnCredit. Đăng ký tư vấn vay tiền online ngay để trải nghiệm những ưu đãi chỉ có ở OnCredit! Cho vay phục vụ chính sách phát triển nông nghiệp nông thôn theo Nghị định 55 2015 NĐ-CP của Thủ tướng Chính phủ Hiện nay ở Việt Nam lãi suất không vượt quá 20% năm với sản phẩm vay ngắn hạn. Khi đăng ký vay tiền online bạn có thể nhận được ưu đãi vay tiền lãi suất 0%.
http://www.lovedolles.com/bbs/board.php?bo_table=free&wr_id=363335
Nhờ chương trình cho vay tiền online không cần gặp mặt chuyển tiền qua ngân hàng chỉ cần CMND, giờ đây khách hàng có thể dễ dàng huy động số tiền lên đến 15.000.000 VND trong 30 phút chỉ vài thao tác đăng ký website app vay tiền hỗ trợ nợ xấu uy tín trên Vay tiền trả góp theo tháng chỉ cần CMND là hình thức vay tín chấp, theo đó người vay sẽ không cần phải dùng các tài sản để đảm bảo, hay chứng minh thu nhập. Mà người vay chỉ cần sử dụng CMND của mình để tiến hành vay trả góp theo tháng. Vay tiền mặt, kỳ hạn trả góp 3, 6, 9, 12 tháng. Giải ngân là một thật ngữ quen thuộc khi vay vốn ngân hàng. Bạn đã hiểu rõ giải ngân là gì và cách thủ tục giải ngân khi vay vốn ngân hàng chưa? Nếu nắm rõ quy trình và thủ tục thì hồ sơ vay vốn của bạn sẽ được ngân hàng tiến hành nhanh chóng, và bạn sẽ nhận tiền vay sớm. Trong bài viết sau, Timo sẽ cung cấp đầy đủ thông tin giải ngân là gì, các thủ tục giải ngân và những điều cần lưu ý khi giải ngân.
body acne causes in adults strongest acne over the counter buy oxcarbazepine 300mg for sale
where to buy clonidine without a prescription buy meclizine pills spiriva sale
rocaltrol 0.25 mg sale buy tricor generic buy fenofibrate tablets
amoxicillin 250mg sale anastrozole 1 mg cost order biaxin 250mg pills
get assignments done online free slot machine games online gambling real money
write me a essay cefixime 100mg pills cheap suprax 200mg
aspirin 75mg us online gambling sites casino free spin
where can i buy terbinafine order terbinafine online casino online games
trazodone online order desyrel for sale clindamycin oral
buy cefuroxime cheap purchase cefuroxime generic buy robaxin pill
buy tadalafil generic buy cambia tablets buy indocin 50mg generic
buy nolvadex online buy nolvadex 20mg without prescription where can i buy symbicort
buy tretinoin cream generic buy avanafil 200mg sale order avanafil pill
brand clindamycin cheap erythromycin 500mg buy fildena generic
lamictal 50mg for sale minipress cost buy nemazole pills for sale
generic flagyl 400mg buy bactrim 960mg generic cephalexin online
order sildenafil 50mg aurogra 100mg drug estrace for sale
fluconazole price order fluconazole 100mg generic buy cipro tablets
buy dissertation online pay for term paper college essay writing help
buy spironolactone 25mg aldactone 25mg usa buy propecia cheap
order domperidone pill order generic tetracycline tetracycline for sale online
tamsulosin 0.4mg pill zofran for sale buy simvastatin without a prescription
buy buspirone 10mg pills cordarone 200mg drug amiodarone 200mg pills
ranitidine cost order mobic sale celecoxib cost
buy zyloprim no prescription buy clobetasol no prescription cheap crestor 10mg
imitrex 50mg pill order levofloxacin 500mg online cheap buy cheap generic avodart
order esomeprazole 40mg sale topamax 100mg price order topamax 200mg sale
buy astelin 10ml generic buy generic azelastine 10 ml avalide for sale online
pepcid 20mg sale order tacrolimus 1mg prograf brand
xenical drug asacol 800mg drug buy diltiazem 180mg
buy coumadin for sale paxil online cheap reglan
buy nortriptyline 25 mg sale order pamelor 25mg generic buy panadol 500mg pills
brand inderal motrin 600mg tablet plavix pill
amaryl 1mg over the counter arcoxia 120mg usa arcoxia online buy
buy generic fosamax for sale cost fosamax generic macrodantin 100 mg
order baclofen generic buy toradol for sale ketorolac oral
buy loratadine without a prescription claritin price priligy 30mg price
cost lioresal elavil sale how to buy ketorolac
buy phenytoin without prescription order oxybutynin 2.5mg for sale order oxybutynin 5mg pills
aceon 4mg usa purchase allegra generic allegra 180mg pill
vardenafil 10mg over the counter digoxin 250mg over the counter tizanidine over the counter
Today, classic slot machines are sometimes referred to as fruit slots, due to the commonly used fruit symbols which players need to try and match. Classic slots are enjoyed all around the world and are a staple both online and on land. For simplicity, familiarity and grind-ability, classic slots are simply the best! As far as slots go – Casino Classic is very well-equipped. However, we would like to see a bit more variety in the overall game selection, and some new live games would be a welcomed addition. – Easy to play with multiple slots features – Individual reel stop, Auto spin and classic slot lever At Bovada Casino, we know how to keep the good times rolling. With over 250 casino games to choose from and a ton of promotions that are sure to suit everyone’s style, Bovada Casino is the number one choice of thousands of players. It’s time to elevate your online gaming experience.
https://juliusxwtq306306.bloggactif.com/1520286/400-poker-chip-set
If you’re used to playing blackjack in a retail casino, then the live dealer version should be pretty familiar. For the most part, blackjack gameplay is the same. If playing with a real person sounds exciting, that’s because it truly is. You have come to the right place for all the latest information and news about live dealer casinos in Pennsylvania. The sections below will guide you to the best and brightest that Pennsylvania’s live dealer casinos have to offer. Live dealer casino games have taken the online casino experience to the next level. Unlike the standard online casino games that rely on random number generators to provide the outcome, live dealer games emulate the action from physical casinos. That said, the Blackjack variations include American Blackjack, European, Atlantic City, Vegas Strip, Classic Blackjack, etc. Interestingly, you can play the Multi-hand versions of these games. If the thrill of beating a croupier excites you, the operator has a live casino to quench your thirst. So, the games in this category include Infinite Blackjack, Party Blackjack, VIP, Diamond VIP, Diamond Blackjack, etc. While playing, you can enjoy fast payouts and stellar customer support to boot.
buy methylprednisolone uk medrol 16mg for sale triamcinolone where to buy
purchase clomid for sale buy serophene where to buy azathioprine without a prescription
casino bonus hard rock casino online order generic levothroid
order amantadine generic order avlosulfon dapsone 100 mg ca
online slots for real money stromectol 6mg uk price of ivermectin liquid
free roulette ventolin pills order allergy pills
pantoprazole 40mg cost pantoprazole 20mg usa order pyridium for sale
casino game poker sites furosemide order online
buy atorvastatin 10mg generic cost albuterol amlodipine price
order generic azipro 500mg buy cheap azipro order neurontin 600mg online
order generic isotretinoin purchase accutane sale buy zithromax 500mg generic
order omnicef 300mg sale buy prevacid 30mg without prescription cheap lansoprazole 15mg
buy provigil 100mg online cheap buy phenergan tablets deltasone 5mg tablet
buy cenforce 100mg without prescription chloroquine without prescription aralen us
cialis for daily use tadalafil medication buy sildenafil
micardis 80mg usa plaquenil uk generic molnupiravir 200 mg
order prilosec 10mg order montelukast 5mg pill metoprolol 100mg usa
premarin 0.625mg sale premarin 0.625mg over the counter viagra pharmacy
purchase betahistine pills order xalatan sale buy probenecid cheap
how to buy latanoprost zovirax eye drops cheap rivastigmine
vasotec canada lactulose usa buy lactulose without a prescription
buy ferrous 100mg sale ferrous sulfate 100mg pills order betapace 40 mg generic
where to buy mestinon without a prescription mestinon 60mg cost rizatriptan 10mg cheap
prasugrel price buy prasugrel pills for sale detrol tablet
etodolac sale cheap pletal 100 mg buy cilostazol paypal
fludrocortisone 100 mcg over the counter buy generic fludrocortisone 100 mcg order loperamide 2 mg
duphaston online purchase dapagliflozin buy empagliflozin no prescription
order melatonin 3mg sale buy danocrine for sale order danazol
buy aspirin medication aspirin 75mg tablet order imiquad creams
acarbose 50mg price cheap fulvicin griseofulvin 250mg usa
mintop us minoxytop cost free samples of ed pills
buy zaditor 1mg generic buy imipramine 75mg online cheap imipramine 75mg pills
brand tadalafil viagra 100mg pills viagra professional
order tricor 160mg pills buy fenofibrate generic oral fenofibrate