2016年12月4日
摘要: 高级查询1.连接查询:select*from info第一个形式,select* from info, nation #形成一个笛卡尔积 适合数据量小的时候使用select*from info, nation where [info.nation]info表中的nation列=nation.code 阅读全文
posted @ 2016-12-04 10:01 甘冬冬 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 查询:1.最简单查询:( 查所有数据)select * from 表名;注:*在这代表所有的列select * from info2.查询指定列select code ,name from info3.修改结果集的列名select code as '代号',name as '姓名' from inf 阅读全文
posted @ 2016-12-04 10:00 甘冬冬 阅读(495) 评论(0) 推荐(0) 编辑
摘要: 【关键字 】paimary key 【代表主键】,not null【 非空 】foreign key【 代表外键】 (zhu) references【引用】 zhu ( code)[ 建立外键关系 ]auto_increment【自动递增】注释语法:用#注释、创建表create table test 阅读全文
posted @ 2016-12-04 09:58 甘冬冬 阅读(1825) 评论(0) 推荐(0) 编辑