SQL

1.总起来就四个字CURD C=create U=update R=read D=delete

对应语句就是insert into | update | select | delete 

2.注意防止sql injection

txtNam = getRequestString("CustomerName");
txtAdd = getRequestString("Address");
txtCit = getRequestString("City");
txtSQL = "INSERT INTO Customers (CustomerName,Address,City) Values(@0,@1,@2)";
db.Execute(txtSQL,txtNam,txtAdd,txtCit);

这方法叫做参数化sql语句,先建立一个sql语句的样式pattern,可变部分作为参数传入。

3.第一次了解了foreign key 的用法

select customers.customerid,orders.orderdate,customers.city,customer.country

from customers inner join orders on customers.customerid=orders.customerid where customers.city=‘london‘ and orders.orderid <77

inner 所得的结果是join

SQL,布布扣,bubuko.com

SQL

上一篇:Sql Over的用法


下一篇:Qt中使用QProcess备份和恢复Mysql数据库