MySQL是一種常用的關(guān)系型數(shù)據(jù)庫管理系統(tǒng),其中增刪查改是最基本的操作。以下是MySQL中增刪查改的命令:
1. 插入數(shù)據(jù)INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);2. 更新數(shù)據(jù)UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition;3. 刪除數(shù)據(jù)DELETE FROM table_name WHERE condition;4. 查詢數(shù)據(jù)SELECT column1, column2, ... FROM table_name WHERE condition;
其中條件語句可以是等于、不等于、大于、小于等關(guān)系運(yùn)算符,也可以使用邏輯運(yùn)算符AND和OR進(jìn)行條件組合。另外還可以使用通配符LIKE進(jìn)行模糊查詢。
1. 等于:SELECT * FROM table_name WHERE column_name = value;2. 不等于:SELECT * FROM table_name WHERE column_name != value;3. 大于:SELECT * FROM table_name WHERE column_name >value;4. 小于:SELECT * FROM table_name WHERE column_name< value;5. AND條件組合:SELECT * FROM table_name WHERE column_name1 = value1 AND column_name2 >value2;6. OR條件組合:SELECT * FROM table_name WHERE column_name1 = value1 OR column_name2 >value2;7. 模糊查詢:SELECT * FROM table_name WHERE column_name LIKE '%value%';
以上就是MySQL中常用的增刪查改操作。在實(shí)際應(yīng)用中,需要根據(jù)具體的情況靈活使用這些命令。