当前位置:网站首页>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;
边栏推荐
猜你喜欢
Public Key Retrieval is not allowed error solution when DBeaver connects to MySQL 8.x
工程力学复习资料
使用 GraphiQL 可视化 GraphQL 架构
思路迪医药冲刺港股:5个月亏2.9亿 泰格医药与先声药业是股东
基于极限学习机(ELM)进行多变量用电量预测(Matlab代码实现)
MySQL的相关问题
国内市场上的BI软件,到底有啥区别
使用 Chainlink Keepers 实现智能合约函数的自动化执行
Getting started with UnityShader (1) - GPU and Shader
腾讯云部署----DevOps
随机推荐
NC | 中国农大草业学院杨高文组揭示发现多因子干扰会降低土壤微生物多样性的积极效应...
AVH部署实践 (一) | 在Arm虚拟硬件上部署飞桨模型
Codeforces Round #796 (Div. 2)(A-D)
vb中如何连接mysql_vb怎么连接数据库「建议收藏」
435. 无重叠区间
四象限时间管理有多好用?
【MySQL】Mysql范式及外键作用
梅克尔工作室-第一次
STM32(十)------- SPI通信
R language test whether the sample conforms to normality (test whether the sample comes from a normally distributed population): shapiro.test function tests whether the sample conforms to the normal d
R language ggplot2 visualization: use the ggboxplot function of the ggpubr package to visualize the grouped box plot, use the ggpar function to change the graphical parameters (caption, add, modify th
border控件的使用
json到底是什么(c# json)
7. Summary of common interview questions
mysql黑窗口~建库建表
SIGABRT 报错时的注意事项和解决方法
更新数据表update
Efficient use of RecyclerView Section 1
删除表格数据或清空表格
R language ggplot2 visualization: use the ggboxplot function of the ggpubr package to visualize the box plot, use the font function to customize the font size, color, style (bold, italic) of the legen