当前位置:网站首页>An important term in MySQL -- CRUD
An important term in MySQL -- CRUD
2022-06-28 06:58:00 【Xiaobinbin &】
mysql Database operation , It mainly performs a series of operations on the files in the database , abbreviation CRUD, The following is a list of commonly used CRUD Instructions
C:create establish
Create database :create database Library name
Create table : create table Table name ( Field attribute .....)
Create foreign keys :alter table The name of this table constraint Foreign key name foreign key Fields in this table references Table name ( Field );
Create index :create index Index name on Table name ( Field )
R :retrive check ( retrieval )
Check all databases :show databases;
Check the number of tables in the database :show tables;
Field format in lookup table : desc Library name
Look up the complete format of the fields in the table :show full fields from Table name
Look up the field definition format in the table : show create table Table name
Look at the data in the table select * from Table name
U: update modify , to update
Modify the data in the table :update table Table name set Field = value where Conditions
Add fields alter table Table name add Field attribute ;
Modifying the properties of fields in a table : alter table Table name modify Field name attribute
Modify the names and attributes of fields in the table : alter table Table name change Old field name , new field name attribute
D:delete
Delete database : drop database Library name
Delete table : drop table Table name
Delete data :delete table Table name where Conditions
truncat table Table name
Delete foreign key :alter table Table name drop foreign key Foreign key name
Delete index :alter table Table name drop index Index name
边栏推荐
猜你喜欢
ROS rviz_ Satellite function package visualizes GNSS track and uses satellite map
面经---测试工程师web端自动化---大厂面试题
强化学习——格子世界
RN7302三相电量检测(基于STM32单片机)
Integer promotion and size side byte order
Freeswitch uses Mod_ Shot module plays mp3
Hungry for a long time, the brain will enter the "power saving mode"! Your senses are weakened and you can't see clearly
小小一款代码编辑器竟然也可以有程序运行之功能——Sublime Text3运行各种语言程序的总结
[staff] arpeggio mark
最后的二十九天
随机推荐
三极管驱动无刷电机
Freeswitch sets the maximum call duration
记JPA使用自定义VO接收 JPQL查询结果
C language tutorial
FPGA - 7系列 FPGA SelectIO -09- 高级逻辑资源之IO_FIFO
自律挑战30天
Integer promotion and size side byte order
力扣515.在每棵树行中找最大值
2 startup, interrupt and system call
Rn7302 three-phase electric quantity detection (based on STM32 single chip microcomputer)
Server body 18: understanding and thinking of UDP reliable transmission (feeling from reading Yunfeng blog)
Is it safe to open a stock account? How to open a stock account?
【Rust日报】 2020-04-23 Rust 1.43.0 发布
LeetCode+ 51 - 55 回溯、动态规划专题
编译配置in文件
Teach you how to use UCOS
Students who do not understand the code can also send their own token. The current universal dividend model can be divided into BSC and any generation B
Linked list (I) - remove linked list elements
[interval DP] stone consolidation
It will cost 700 yuan to realize this issue. Does anyone do it?