当前位置:网站首页>Chapter 4 of getting started with MySQL: creation, modification and deletion of data tables
Chapter 4 of getting started with MySQL: creation, modification and deletion of data tables
2022-07-01 14:34:00 【getupos】
1. Create database
Data table belongs to database , Before creating the database , You should use use < Database name > Specify the database in which the operation is performed .
1.1 Use create Statement create data table
Examples are as follows
First create and select the database

2. Look at the data table structure
2.1 View table basic structure
Use describe/desc Statement to view table field information .
Illustrate with examples
Enter the following code

2.2 Look at the detailed structure of the table

3. Modify data sheet
After the data table is created , You can also modify the data table according to the actual needs
3.1 Modify data table name
Table names are uniquely defined in a database , The database system distinguishes different tables by table names
Data table update code format
for example
take company In the database emp Change the table to emps
Input sql sentence

3.2 Modify field data type
Change the data type of the field , Is to convert the data type of a field into another data type . stay MySQL The syntax format of modifying the field data type in is as follows :
The main parameters are introduced as follows .
Table name : Refers to the name of the table where the field of the data type to be modified is located .
Field name : Refers to the field to be modified .
data type : Refers to the new data type of the modified field .
give an example
Check the data table before operation name type

modify name

3.4 Modify the field name of the data table
After the field names in the data table are set , It's not static , You can modify the field name as needed .MySQL The syntax format of modifying the table field name in is as follows :
The main parameters are introduced as follows .
Table name : The data table of the field name to be modified . Old field name : Refers to the field name before modification .
new field name : Refers to the modified field name .
New data types : Refers to the modified data type , If you don't need to modify the data type of the field , You can set the new data type to be the same as the original , But the data type cannot be empty .
give an example
边栏推荐
- 【R语言数据科学】:机器学习常见评估指标
- Research Report on the development trend and competitive strategy of the global commercial glassware industry
- Research Report on the development trend and competitive strategy of the global aviation leasing service industry
- Realize queue with stack and stack with queue (C language \leetcode\u 232+225)
- Is the futures company found on Baidu safe? How do futures companies determine the regularity
- phpcms实现订单直接支付宝支付功能
- El form item regular verification
- Microservice development steps (Nacos)
- 原来程序员搞私活这么赚钱?真的太香了
- Research Report on the development trend and competitive strategy of the global chemical glassware industry
猜你喜欢

After being laid off for three months, the interview ran into a wall everywhere, and the mentality has begun to collapse

Build your own website (21)

Websocket (simple experience version)

The integration of computing and Internet enables the transformation of the industry, and the mobile cloud lights up a new roadmap for the future of digital intelligence

"National defense seven sons" funding soared, with Tsinghua reaching 36.2 billion yuan, ranking second with 10.1 billion yuan. The 2022 budget of national colleges and universities was made public
![[commercial terminal simulation solution] Shanghai daoning brings you Georgia introduction, trial and tutorial](/img/44/b65aaf11b1e632f2dab55b6fc699f6.jpg)
[commercial terminal simulation solution] Shanghai daoning brings you Georgia introduction, trial and tutorial

C#学习笔记(5)类和继承

微服务大行其道的今天,Service Mesh是怎样一种存在?

【牛客网刷题系列 之 Verilog快速入门】~ 多功能数据处理器、求两个数的差值、使用generate…for语句简化代码、使用子模块实现三输入数的大小比较

sqlilabs less10
随机推荐
Research Report on the development trend and competitive strategy of the global display filter industry
Pat 1121 damn single (25 points) set
使用net core 6 c# 的 NPOI 包,读取excel..xlsx单元格内的图片,并存储到指定服务器
[IOT completion. Part 2] stm32+ smart cloud aiot+ laboratory security monitoring system
How to view the state-owned enterprises have unloaded Microsoft office and switched to Kingsoft WPS?
phpcms实现订单直接支付宝支付功能
2022-2-15 learning the imitation Niuke project - post in Section 2
Use lambda function URL + cloudfront to realize S3 image back to source
光環效應——誰說頭上有光的就算英雄
那个很努力的学生,高考失败了……别慌!你还有一次逆袭机会!
What problems should be considered for outdoor LED display?
既不是研发顶尖高手,也不是销售大牛,为何偏偏获得 2 万 RMB 的首个涛思文化奖?
生成随机数(4位、6位)
【修复版】仿我爱看电影网站模板/海洋CMS影视系统模板
Websocket (simple experience version)
Research Report on the development trend and competitive strategy of the global electromagnetic flowmeter industry
Don't want to knock the code? Here comes the chance
Open source internship experience sharing: openeuler software package reinforcement test
Semiconductor foundation of binary realization principle
Is it reasonable and safe for securities companies to open accounts for 10000 free securities? How to say