幾句簡單的不能再簡單的CRUD語句
插入語句:
一:不指定id序列值:
insert into t_user(username,balance) values('gaoge',1000);
二:指定id序列值:
insert into t_user(Id,username,balance) values(9,'gaoge',1000);
三:
insert into t_user values(19,'gaoge',1000);
更新語句:
update t_user set username='xuan' where Id=19;
刪除語句:
delete from t_user where id = 19;
刪除一張表:
drop table test_test;
向t_product表中插入數據(未指定ID序列):
insert into t_product(name,amount,user_id) values('AU1001',100,2);//前
提是t_user表中必須存在id爲2的user這條記錄。
查詢語句:
select * from t_user;
select * from t_product where user_id = 2;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.