当前位置:网站首页>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;
边栏推荐
- JVM parameter analysis Xmx, Xms, Xmn, NewRatio, SurvivorRatio, PermSize, PrintGC "recommended collection"
- The R language ggstatsplot package ggbarstats function visualizes bar charts, and adds hypothesis test results (including sample number, statistics, effect size and its confidence interval, significan
- Web自动化实战——Selenium4(自动化测试环境的搭建)
- 华医网冲刺港股:5个月亏2976万 红杉与姚文彬是股东
- Why is the field of hacking almost filled with boys?
- Unity中实现点选RenderTexture中的3D模型
- abaqus find contact pairs报错:surface name is already in use
- what exactly is json (c# json)
- 微信聊天记录中搜索红包
- 更新数据表update
猜你喜欢
随机推荐
Grafana安装后web打开报错
《微信小程序-进阶篇》Lin-ui组件库源码分析-Icon组件
org.apache.jasperException(could not initialize class org)
如何进行需求分析评审
Use of radiobutton
Excel快速对齐表格的中姓名(两个字姓名和三个字姓名对齐)
Web自动化实战——Selenium4(自动化测试环境的搭建)
更新数据表update
what exactly is json (c# json)
梅克尔工作室-第一次
最小费用最大流问题详解
基于最小二乘法和SVM从天气预报中预测太阳能发电量(Matlab代码实现)
NC | 中国农大草业学院杨高文组揭示发现多因子干扰会降低土壤微生物多样性的积极效应...
AVH Deployment Practice (1) | Deploying the Flying Paddle Model on Arm Virtual Hardware
OpenCV测量物体的尺寸技能 get~
公告
Word表格转到Excel中
PDF 拆分/合并
json到底是什么(c# json)
Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut