Mysql 基础命令 - 2023年5月24日
初学mysql时常用的命令
初学mysql时常用的命令
CREATE DATABASE IF NOT EXISTS mydatabase;
DROP DATABASE IF EXISTS mydatabase;
CREATE TABLE IF NOT EXISTS mytable (
id INT AUTO_INCREMENT,
name VARCHAR(100),
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS mytable;
INSERT INTO mytable (name) VALUES ('John');
SELECT * FROM mytable;
UPDATE mytable SET name = 'Jane' WHERE id = 1;
DELETE FROM mytable WHERE id = 1;