当前位置:网站首页>mysql black window ~ build database and build table
mysql black window ~ build database and build table
2022-07-31 15:20:00 【Life is so hard】
//Create a database
create database tablename;
For example create database drop_testdb;
//Show all data
show databases;
As follows:

// drop database
drop database
// View data in table
select * from `test`;
// Display the selected field content
SELECT `id`, `name` FROM `test` WHERE 1
// create a database
create database drop_database;
// Use the database
use drop_database;
// Show all tables in the database
show tables;
// if exists determine whether the database exists, no error will be generated
drop database if exists drop_database;
Create data table
create table user(
id int primary key auto_increment,
username varchar(20) not null default ' ',
passwd char(32) not null default ' ',
email varchar(50) not null default ' ',
gender char(1) not null default ' ',
age tinyint unsigned not null default 0
)enginemyisam charset utf8
// drop table
drop table table_name;
//Add data to the test table
INSERT INTO `test`(`id`, `name`) VALUES ('1','Li Si');
// View data in table
select * from `test`;
// Modify the data in the table
UPDATE `test` SET `id`='This is the modified id', `name`='This is the modified content'WHERE `id`=1;
// delete data from table
DELETE FROM `test` WHERE 1
//Add a field to a table
alter table user add email varchar(50) not null default ' ' after passwd;
// Set display character set
set names gbk;
边栏推荐
- 看交互设计如何集成到Scrum敏捷流程中
- Why don't you make a confession during the graduation season?
- TRACE32——C源码关联
- 安装Xshell并使用其进行Ymodem协议的串口传输
- Excel quickly aligns the middle name of the table (two-word name and three-word name alignment)
- ASP.NET Core 产生连续 Guid
- Introductory UnityShader learning (2) - the rendering pipeline
- WeChat chat record search in a red envelope
- [MySQL] Mysql paradigm and the role of foreign keys
- AVH部署实践 (一) | 在Arm虚拟硬件上部署飞桨模型
猜你喜欢
随机推荐
TRACE32 - SNOOPer-based variable logging
定时器的类型
NC | 中国农大草业学院杨高文组揭示发现多因子干扰会降低土壤微生物多样性的积极效应...
Efficient use of RecyclerView Section 2
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(legend、修改可视化图像的图例在整图中的位置)
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
删除 状态良好(恢复分区)的磁盘
thread_local 变量的析构顺序
Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
Efficient use of RecyclerView Section 1
leetcode303 Weekly Match Replay
Codeforces Round #796 (Div. 2) (A-D)
工程水文学试卷
梅克尔工作室-第一次
Public Key Retrieval is not allowed error solution when DBeaver connects to MySQL 8.x
《微信小程序-进阶篇》Lin-ui组件库源码分析-Icon组件
Trigonometric identity transformation formula
NC | 斯坦福申小涛等开发数据可重复分析计算框架TidyMass
Synchronized and volatile interview brief summary
01 Encounter typescript, build environment









