C++ Primer学习_第1章】的更多相关文章

源文件后缀 在大多数的系统中,源文件的名字以一个后缀为结尾,后缀是由一个句点后接一个或多个字符组成的.后缀告诉系统这个文件是一个C++程序.不同编译器使用不同的后缀命名约定,最常见的包括.cc..cxx..cpp..cp及.C. 头文件后缀 通常使用.h作为头文件后缀,但也有程序员习惯.H..hpp..hxx.标准库头文件通常不带后缀.编译器一般不关心头文件名的形式,但有的IDE对此有要求. 类似于while(cin>>value),当我们使用istream作为条件时,其效果是检测流的状态.当…
第22章:使用视图,视图是虚拟的表,以表形式呈现的是你查询的结果.并不是说在数据库里面真的存在这个表,但是是真的存在这些数据. select cust_name,cust_contact from customers ,orders,orderitems where customers.cust_id=orders.cust_id and orderitems.orderitems.order_num=orders.order_num and prod_id='tnt2'; P158 creat…
第20章:更新和删除数据 P140 update customers set_emails='elmer@fudd.com' where cust_id=10005; 更新多个列,用逗号隔开.注意被指定的词有引号,null不用引号. #为什么cust_name不能是空值# ##删除一个列,把一个列的值改为空值## P141删除数据 select from customers where cust_id=10006; #删除cust_id=10006的的行所有信息#…
第19章 插入数据 P132 insert into customers VALUES(NULL,'Pep E.Lapew','100 Main Street',,Los Angeles','CA','90046','USA',NULL,NULL); #customers表中刚好有9个维度(一定要对应上),9个值会对应这9个维度,维度的次序由表定义# insert into customers (cust_name,cust_address,cust_city,cust_state,cust_z…
第18章 全文本搜索 P121  #创建一个新表,对表的列进行定义,定义之后,MySQL自动维护该索引# create table productnotes ( note_id  int   NOT NULL  AUTO_INCREMENT, prod_id char(10)  NOT NULL  , note_date datetime  NOT NULL , note_text text NULL, PRIMARY KEY(note_id), FULLTEXT (note_text ) )E…
第17章:组合查询 P114 select vend_id ,prod_id,prod_price from products where prod_price <=5 ; select vend_id ,prod_id,prod_price from products where vend_id in (1001,1002); P115 组合上面的两个语句. select vend_id ,prod_id,prod_price from products where prod_price <…
第16章:创建高级联结. P106 select concat(RTrim(vend_name),'(',RTrim(vend_country),')') as vend_title from vendors order by vend_name;   #concat()函数合并两列,并重新命名合并的列为vend_name.# select cust_name,cust_contact from customers as c,orders as o,orderitems as oi where…
第15章:联结表 P98 外键:外键为某个表的一列A,同时这一列包含另一个表的主键值B(B属于A,等于或者小于的关系) P99 select vend_name,prod_name,prod_price from vendors,products where vendors.vend_id =products.vend_id order by vend_name,prod_name; # 选择的vend_name,prod_name只是在products表格中出现,所以无须指明是哪个表,这个的语…
第14章:使用子查询. 子查询是镶嵌在其他查询里面,相当其他的select查询的条件来. P91 select order_num from where prod_id='tnt2';   #检索条件为prod_id=tnt2的order_num# select cust_id from orders where order_num in (20005,20007);    #检索满足条件 order_num在范围(20005,20007)的cust_id# select cust_id fro…
第13章:分组过滤. P83 select count(*) as num_prods from products where vend_id=1003; #返回vend_id=1003的产品数目总值# P84 select count(*) as num_prods from products group by vend_id; #返回各个vend_id所提供的产品数量,不需要指定计算每个组,因为用了group by ,系统会自动完成# 注意:group by必须在where 之后,order…