当前位置:网站首页>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
边栏推荐
- Distributed dynamic (collaborative) rendering / function runtime based on computing power driven, data and function collaboration
- This paper introduces an implementation scheme to enhance the favorite transaction code management tool in SAP GUI
- Using CMD to repair and recover virus infected files
- 原来程序员搞私活这么赚钱?真的太香了
- Basis of target detection (NMS)
- Research Report on the development trend and competitive strategy of the global ultrasonic scalpel system industry
- Research Report on the development trend and competitive strategy of the global navigation simulator industry
- Advanced C language
- 户外LED显示屏应该考虑哪些问题?
- How to pass array parameters in get request
猜你喜欢

【修复版】仿我爱看电影网站模板/海洋CMS影视系统模板

241. 为运算表达式设计优先级

SQLAchemy 常用操作

Using CMD to repair and recover virus infected files

TDengine 连接器上线 Google Data Studio 应用商店

C 语言基础

Use the right scene, get twice the result with half the effort! Full introduction to the window query function and usage scenarios of tdengine

如何看待国企纷纷卸载微软Office改用金山WPS?

Vnctf2022 open web gocalc0

JVM performance tuning and practical basic theory part II
随机推荐
C 语言进阶
[Verilog quick start of Niuke series] ~ multi function data processor, calculate the difference between two numbers, use generate... For statement to simplify the code, and use sub modules to realize
Buuctf reinforcement question ezsql
Research Report on the development trend and competitive strategy of the global CCTV robot industry
Distributed dynamic (collaborative) rendering / function runtime based on computing power driven, data and function collaboration
Using CMD to repair and recover virus infected files
Guess lantern riddles, not programmers still can't understand?
111. Minimum depth of binary tree
[零基础学IoT Pwn] 复现Netgear WNAP320 RCE
Summary of leetcode's dynamic programming 5
Semiconductor foundation of binary realization principle
Research Report on the development trend and competitive strategy of the global indexable milling cutter industry
Use of Oracle database objects
2022 PMP project management examination agile knowledge points (6)
微服务开发步骤(nacos)
Pat 1065 a+b and C (64bit) (20 points) (16 points)
So programmers make so much money doing private work? It's really delicious
SWT / anr problem - how to capture performance trace
SQLAchemy 常用操作
【R语言数据科学】:机器学习常见评估指标