当前位置:网站首页>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;
边栏推荐
- mysql黑窗口~建库建表
- org.apache.jasperException(could not initialize class org)
- 安装Xshell并使用其进行Ymodem协议的串口传输
- Word表格转到Excel中
- WPF project - basic usage of controls entry, you must know XAML
- RecyclerView的高效使用第一节
- The use of border controls
- R语言ggstatsplot包ggbarstats函数可视化条形图、并添加假设检验结果(包含样本数、统计量、效应大小及其置信区间、显著性、组间两两比较、贝叶斯假设)、检验结果报告符合APA标准
- OpenShift 4 - Customize RHACS security policies to prevent production clusters from using high-risk registry
- 使用 PyTorch 检测眼部疾病
猜你喜欢

MySQL的相关问题

TRACE32——基于SNOOPer的变量记录

TRACE32——常用操作

Getting Started with TextBlock Control Basic Tools Usage, Get Started

名创优品斥资6.95亿购买创始人叶国富所持办公楼股权

The meaning of node_exporter performance monitoring information collection in Prometheus

Word表格转到Excel中

TRACE32 - Common Operations

使用 PyTorch 检测眼部疾病

Word table to Excel
随机推荐
工程力学复习资料
Getting Started with TextBlock Control Basic Tools Usage, Get Started
工程水文学名词解释总结
border控件的使用
WPF项目--控件入门基础用法,必知必会XAML
基于极限学习机(ELM)进行多变量用电量预测(Matlab代码实现)
abaqus find contact pairs报错:surface name is already in use
更新数据表update
浏览器自带的拾色器
ASP.NET Core 产生连续 Guid
button控件的使用
RecyclerView高效使用第三节
Internet banking stolen?This article tells you how to use online banking safely
最小费用最大流问题详解
为什么黑客领域几乎一片男生?
mysql黑窗口~建库建表
Use of radiobutton
Web自动化实战——Selenium4(自动化测试环境的搭建)
Matlab矩阵基本操作(定义,运算)
SIGABRT 报错时的注意事项和解决方法