MySQL是一種關(guān)系型數(shù)據(jù)庫管理系統(tǒng),廣泛應(yīng)用于各行各業(yè)。它可以對(duì)數(shù)據(jù)進(jìn)行創(chuàng)建、插入、更新、查詢等操作,下面是一些對(duì)數(shù)據(jù)的操作記錄:
CREATE DATABASE mydatabase; #創(chuàng)建數(shù)據(jù)庫 USE mydatabase; #使用數(shù)據(jù)庫 CREATE TABLE mytable ( #創(chuàng)建表格 id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, age INT(3) NOT NULL, email VARCHAR(50), reg_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); INSERT INTO mytable (name, age, email) VALUES ('Bob', '25', 'bob@gmail.com'); #插入數(shù)據(jù) UPDATE mytable SET age='26' WHERE name='Bob'; #更新數(shù)據(jù) SELECT * FROM mytable WHERE age >25; #查詢符合條件的數(shù)據(jù) DELETE FROM mytable WHERE age = '26'; #刪除數(shù)據(jù) DROP TABLE mytable; #刪除表格 DROP DATABASE mydatabase; #刪除數(shù)據(jù)庫
通過上述記錄,我們可以看到MySQL對(duì)于數(shù)據(jù)的操作非常靈活,可以隨時(shí)根據(jù)需求對(duì)數(shù)據(jù)進(jìn)行增刪改查等操作。