MySql資料庫的查詢、刪除、增加、修改語句
- IT科技
- 關注:2.74W次
介紹mysql資料庫的基本查詢、刪除、增加、修改語句等常用資料庫語句。
方法
第一步,查詢語句:
select* from table_name;
或
select * from table_name where [條件]
第二步,增加語句或插入資料
insert into table_name (clus...) values(values...)
例項如圖:
修改資料:update tablename set xx=xx,xxx=xx where xxx=xxx and xxx=xxx;
第四步, 刪除語句
delete table_name where 條件
例項如圖:
注意事項
注意沒行末尾的分號不能漏掉!
查詢時注意*好不能亂用,否則會導致資料庫執行負擔。最好是需要什麼欄位就查詢什麼欄位。
- 文章版權屬於文章作者所有,轉載請註明 https://shqsg.com/dianzi/zzo3y8.html