SQL Command เบื้องต้น

SQL Command เบื้องต้น
1. การเพิ่มข้อมูล

insert into table_name(filed1,filed2.filed3.....) values('filed1_data','filed2_data','filed3_data',....)
เช่น
insert into user (user,password,name) values('usernamd1','username1','user name')

2. การดูข้อมูล
select filed1_data,.... from table_name [where condition1 [and|or condition2 [and|or condition3 [....]]]]
เช่น
select user from user where user='username1'

3. การปรับปรุง
update table_name set filed1='filed1_data'[,filed2='filed2_data'[,filed3='filed3_data' [, ....]]]
เช่น
update user set name='นายรักดี จริง ๆ นะ' where user='username1'

4. การลบข้อมูบล ข้อมูล
delete from table_name [where condition1 [and|or condition2 [and|or condition3 [....]]]]
เช่น
delete from user where user='username1'

Rating

No votes yet