mysql主键和外键

    MySQL 主键和外键

    之前对多表查询没重视,现在根据自己的理解重新分析总结一下

    主键和主键约束

    主键和外键的存在都是为了保证数据的完整性;
    在我的理解中,主键和外键相对,是语义上的;主键约束和外键约束相对,即语法上的
    - 主键: 挑选出来,用来唯一标识某一行的字段;数值要求非空唯一
    - 主键分为自然主键和代理主键:自然主键是指,该字段除了表示该行唯一之外,存储的数据还有其他的作用,比如身份证(非空唯一);代理主键只起到标识唯一的作用,一般自增生成或者UUID生成,没有其他特定含义;
    - 另外,主键可以是几列一起形成联合主键,比如,学生的学号和课程编号一起成为主键,用来标识成绩相关的数据
    - 主键约束: 数据库自动对主键进行约束,即唯一非空
    添加主键约束的方法为

    添加主键约束的几种方式

    1.在创建表时创建主键,在字段后面加上 primary key.

    create table tablename(
        id int primary key,
        .......
    )
     
     
     
     
    • 1
    • 2
    • 3
    • 4

    2.在创建表时创建主键,在表创建的最后来指定主键

    create table tablename(
    id int,
    .......,
    primary key(id)
    )
     
     
     
     
    • 1
    • 2
    • 3
    • 4
    • 5

    3.删除主键:以为一个表的主键只有一个,所以只要指定表名就可以删除主键了

    alter table 表名 drop primary key;
     
     
     
     
    • 1

    4.主键自动增长:一般主键是自增长的字段,不需要指定。
    实现添加自增长语句,主键字段后加auto_increment(只适用MySQL)

    外键和外键约束

    • 外键: 使两张表形成关联的字段,有外键字段的被称为从表,与此对应的被称为主表;
    • 外键约束: mysql添加外键约束后,如果主表中的行与从表的数据产生关联,name就不能删除
    声明外键约束的方法
    alter table 从表 add constraint 外键名称 foreign key (从表外键字段名) references 主表 (主表的主键);
     
     
     
     
    • 1

    [外键名称] 用于删除外键约束的,一般建议“_fk”结尾
    需要注意的是,两个字段名都需要加括号

    删除外键的方法

    alter table 从表 drop foreign key 外键名称
     
     
     
     
    • 1

    如果不准备删除,可以不给外键命名,可以使用下面这种简单的方式

    alter table 从表名 add  foreign key (从表外键字段名) references 主表名 (主表的主键);
     
     
     
     
    • 1
                <link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-e44c3c0e64.css" rel="stylesheet">
                    </div>
    </article>
    
    <div class="comment-edit-box d-flex">
    	<a id="commentsedit"></a>
    	<div class="user-img">
    		<a href="javascript:void(0);" target="_blank">
    			<img class="show_loginbox" src="//g.csdnimg.cn/static/user-img/anonymous-User-img.png">
    		</a>
    	</div>
    	<form id="commentform">
    		<input type="hidden" id="comment_replyId">
    		<textarea class="comment-content" name="comment_content" id="comment_content" placeholder="想对作者说点什么"></textarea>
    		<div class="opt-box"> <!-- d-flex -->
    			<div id="ubbtools" class="add_code">
    				<a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
    			</div>
    			<input type="hidden" id="comment_replyId" name="comment_replyId">
    			<input type="hidden" id="article_id" name="article_id" value="79525513">
    			<input type="hidden" id="comment_userId" name="comment_userId" value="">
    			<input type="hidden" id="commentId" name="commentId" value="">
    			<div style="display: none;" class="csdn-tracking-statistics tracking-click" data-report-click="{&quot;mod&quot;:&quot;popu_384&quot;,&quot;dest&quot;:&quot;&quot;}"><a href="#" target="_blank" class="comment_area_btn">发表评论</a></div>
    			<div class="dropdown" id="myDrap">
    				<a class="dropdown-face d-flex align-items-center" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
    				<div class="txt-selected text-truncate">添加代码片</div>
    				<svg class="icon d-block" aria-hidden="true">
    					<use xlink:href="#csdnc-triangledown"></use>
    				</svg>
    				</a>
    				<ul class="dropdown-menu" id="commentCode" aria-labelledby="drop4">
    					<li><a data-code="html">HTML/XML</a></li>
    					<li><a data-code="objc">objective-c</a></li>
    					<li><a data-code="ruby">Ruby</a></li>
    					<li><a data-code="php">PHP</a></li>
    					<li><a data-code="csharp">C</a></li>
    					<li><a data-code="cpp">C++</a></li>
    					<li><a data-code="javascript">JavaScript</a></li>
    					<li><a data-code="python">Python</a></li>
    					<li><a data-code="java">Java</a></li>
    					<li><a data-code="css">CSS</a></li>
    					<li><a data-code="sql">SQL</a></li>
    					<li><a data-code="plain">其它</a></li>
    				</ul>
    			</div>  
    			<div class="right-box">
    				<span id="tip_comment" class="tip">还能输入<em>1000</em>个字符</span>
    				<input type="button" class="btn btn-sm btn-cancel d-none" value="取消回复">
    				<input type="submit" class="btn btn-sm btn-red btn-comment" value="发表评论">
    			</div>
    		</div>
    	</form>
    </div>
    
    	<div class="comment-list-container">
    	<a id="comments"></a>
    	<div class="comment-list-box">
    	</div>
    	<div id="commentPage" class="pagination-box d-none"></div>
    	
    </div>
    
    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_59" data-pid="59" data-track-view="{&quot;mod&quot;:&quot;kp_popu_59-860&quot;,&quot;con&quot;:&quot;,,SQL&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_59-860&quot;,&quot;con&quot;:&quot;,,SQL&quot;}" data-report-view="{&quot;mod&quot;:&quot;kp_popu_59-860&quot;,&quot;keyword&quot;:&quot;SQL&quot;}" data-report-click="{&quot;mod&quot;:&quot;kp_popu_59-860&quot;,&quot;keyword&quot;:&quot;SQL&quot;}"><iframe src="https://kunpeng-sc.csdnimg.cn/#/preview/109?positionId=59&amp;queryWord=SQL" frameborder="0" width="100%" height="75px" scrolling="no"></iframe></div></div>
    
    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_60" data-pid="60" data-track-view="{&quot;mod&quot;:&quot;kp_popu_60-43&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_60-43&quot;,&quot;con&quot;:&quot;,,&quot;}" data-report-view="{&quot;mod&quot;:&quot;kp_popu_60-43&quot;,&quot;keyword&quot;:&quot;&quot;}" data-report-click="{&quot;mod&quot;:&quot;kp_popu_60-43&quot;,&quot;keyword&quot;:&quot;&quot;}"><div class="mediav_ad"><newsfeed class="newsfeed QIHOO__WEB__SO__1565322702738_113" id="QIHOO__WEB__SO__1565322702738_113" style="display:block;margin:0;padding:0;border:none;width:900px;height:84px;overflow-y:hidden;overflow-x:hidden;position:relative;text-align:left;"><info-div id="QIHOO__WEB__SO__1565322702738_113-info" style="zoom:1"><info-div class="QIHOO__WEB__SO__1565322702738_113 singleImage clk" data-href="https://ssxd.mediav.com/s?type=2&amp;r=20&amp;mv_ref=blog.csdn.net&amp;enup=CAABfM2e8ggAAvKezXwA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b4376c087d&amp;price=AAAAAF1M7dAAAAAAAAIqWEMqFUs4PYgNFskKbg==&amp;finfo=DAABCAABAAAASAgAAgAAAD0EAAM/UY/Lcqx6zwAIAAIAAAADCgADDIbzpG+idqAIAAQAAABDBgAGG4sGAAoAAAgADgAAACUKAA8AAAAAAAsjkwA&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbsovropPPvsg0VAAAA&amp;uai=FeTGlAIlAhUEFvjfj9OPo/WGGRXyCCWzvb/hBCUAFRoUABwWtNPMzISU3otMFQAAAA&amp;ubi=FejnJBWkhJ4CFaD1xhUVwI36WBUGFRwWuonH+hQW+N+kupnp+YYZNAIWqOAQJQYVvci32AMVngEVACQUFujnJAA&amp;clickid=0&amp;cpx=__OFFSET_X__&amp;cpy=__OFFSET_Y__&amp;cs=__EVENT_TIME_START__&amp;ce=__EVENT_TIME_END__&amp;ldtype=2&amp;csign2=aV75QrTCu0Z=&amp;url=http%3A%2F%2Fbaidu.code.jjyx.com%2Fhtmlcode%2F24889.html%3Fsourceid%3D%7Bsource_id%7D" data-pv="https://ssxd.mediav.com/s?type=1&amp;r=20&amp;tid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;finfo=DAABCAABAAAASAgAAgAAAD0EAAM/UY/Lcqx6zwAIAAIAAAADCgADDIbzpG+idqAIAAQAAABDBgAGG4sGAAoAAAgADgAAACUKAA8AAAAAAAsjkwA&amp;mv_ref=blog.csdn.net&amp;enup=CAABfM2e8ggAAvKezXwA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b4376c087d&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbsovropPPvsg0VAAAA&amp;uai=FeTGlAIlAhUEFvjfj9OPo/WGGRXyCCWzvb/hBCUAFRoUABwWtNPMzISU3otMFQAAAA&amp;ubi=FejnJBWkhJ4CFaD1xhUVwI36WBUGFRwWuonH+hQW+N+kupnp+YYZNAIWqOAQJQYVvci32AMVngEVACQUFujnJAA&amp;ds=1&amp;price=AAAAAF1M7dAAAAAAAAIqWEMqFUs4PYgNFskKbg==,https://max-l.mediav.com/rtb?type=2&amp;ver=1&amp;v=CGQSEDEzODRhOWI0Mzc2YzA4N2QYsqOKASCisEUoAWIXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTmIAQA&amp;k=jC92AwAAAAA=&amp;w=AAAAAF1M7dAAAAAAAAIqgE_cxELWHLgFLii0bg&amp;i=OLWZaQtF9J3J&amp;exp=BQBECgBECAFEAQJEEgJEEABDJQBD&amp;z=1" data-clk="https://max-l.mediav.com/rtb?type=3&amp;ver=1&amp;v=CGQSEDEzODRhOWI0Mzc2YzA4N2QYsqOKASCisEUoAWIXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTlwAA&amp;k=1wepnwAAAAA=&amp;i=OLWZaQtF9J3J&amp;exp=BQBECgBECAFEAQJEEgJEEABDJQBD&amp;x=__OFFSET_X__&amp;y=__OFFSET_Y__&amp;st=__EVENT_TIME_START__&amp;et=__EVENT_TIME_END__&amp;adw=__ADSPACE_W__&amp;adh=__ADSPACE_H__&amp;tc=&amp;turl=">
    <info-div class="wrap">
        <info-div class="singleImage-img singleImage-img-left">
            <info-div class="img" style="background-image:url(https://s3m.mediav.com/galileo/301556-27e49e469ababbb79563a62c9f9d2bab.gif)"><info-div class="ads-tag"></info-div></info-div>
        </info-div>
        <info-div class="singleImage-body singleImage-body-left">
            <info-div class="singleImage-title">陈小春坦言:这游戏不充钱都能当全服大哥,找到充值入口算我输!</info-div>
            <info-div class="singleImage-desc">贪玩游戏 · 顶新</info-div>
        </info-div>
    
    		<div class="recommend-item-box blog-expert-recommend-box" style="">
    		<div class="d-flex">
    			<div class="blog-expert-recommend">
    				<div class="blog-expert">
    					<div class="blog-expert-flexbox"></div>
    				</div>
    			</div>
    		</div>
    	</div>
    
    mysql 数据库 操作 获取某一个表的所有信息 主键 外键 类型

    10-07 阅读数 2476

    SELECT* FROMinformation_schema.columnsaJOIN information_schema.TABLESbONa.table_schema=b.table_schem... 博文 来自: sinat_19528249的博客

    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_61" data-pid="61" data-track-view="{&quot;mod&quot;:&quot;kp_popu_61-557&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_61-557&quot;,&quot;con&quot;:&quot;,,&quot;}" data-report-view="{&quot;mod&quot;:&quot;kp_popu_61-557&quot;,&quot;keyword&quot;:&quot;&quot;}" data-report-click="{&quot;mod&quot;:&quot;kp_popu_61-557&quot;,&quot;keyword&quot;:&quot;&quot;}"><div class="mediav_ad"><newsfeed class="newsfeed QIHOO__WEB__SO__1565322702793_432" id="QIHOO__WEB__SO__1565322702793_432" style="display:block;margin:0;padding:0;border:none;width:852px;height:60px;overflow-y:hidden;overflow-x:hidden;position:relative;text-align:left;"><info-div id="QIHOO__WEB__SO__1565322702793_432-info" style="zoom:1"><info-div class="QIHOO__WEB__SO__1565322702793_432 singleImage clk" data-href="https://ssxd.mediav.com/s?type=2&amp;r=20&amp;mv_ref=blog.csdn.net&amp;enup=CAABJG52VAgAAlR2biQA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b430e82725&amp;price=AAAAAF1M7dAAAAAAAAOL3Rhf+NWqW2h9yXRRQw==&amp;finfo=DAABCAABAAAAHwgAAgAAAB0EAAM/TX4r+uhWJAAIAAIAAAADCgADDnptgNasvsoIAAQAAAAiBgAGK4UGAAoAAAgADgAAABcKAA8AAAAAAAS68AA&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbN2JPajK/EhWkVAAAA&amp;uai=FaixkwIlAhUEFvjf1uKVmrL6HBXyCCWxtO+eCiUAFRoUABwWgpSh/ofL6pxMFQAAAA&amp;ubi=FZCnLxXG4MICFayMlhcVvOySWBUGFRwWhJvTwRQW+N/ryZ/gtvocNAIWqMAQJQYV2sm/pQQV/gQVADbNw4jTuKGHrt0BAA&amp;clickid=0&amp;cpx=__OFFSET_X__&amp;cpy=__OFFSET_Y__&amp;cs=__EVENT_TIME_START__&amp;ce=__EVENT_TIME_END__&amp;csign2=aIBSdpX6D1-=&amp;url=http%3A%2F%2F5a960afed3532.site.mvad.com%2F" data-pv="https://ssxd.mediav.com/s?type=1&amp;r=20&amp;tid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;finfo=DAABCAABAAAAHwgAAgAAAB0EAAM/TX4r+uhWJAAIAAIAAAADCgADDnptgNasvsoIAAQAAAAiBgAGK4UGAAoAAAgADgAAABcKAA8AAAAAAAS68AA&amp;mv_ref=blog.csdn.net&amp;enup=CAABJG52VAgAAlR2biQA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b430e82725&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbN2JPajK/EhWkVAAAA&amp;uai=FaixkwIlAhUEFvjf1uKVmrL6HBXyCCWxtO+eCiUAFRoUABwWgpSh/ofL6pxMFQAAAA&amp;ubi=FZCnLxXG4MICFayMlhcVvOySWBUGFRwWhJvTwRQW+N/ryZ/gtvocNAIWqMAQJQYV2sm/pQQV/gQVADbNw4jTuKGHrt0BAA&amp;ds=1&amp;price=AAAAAF1M7dAAAAAAAAOL3Rhf+NWqW2h9yXRRQw==,https://max-l.mediav.com/rtb?type=2&amp;ver=1&amp;v=CGQSEDEzODRhOWI0MzBlODI3MjUY1NiJASCisEUoAWIXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTmIAQA&amp;k=7vsdowAAAAA=&amp;w=AAAAAF1M7dAAAAAAAAOMGAi_rO9Ryz1Q6-HuSg&amp;i=CQ_EqMtF9Jgy&amp;exp=BQBECgBECAFEAQJEEgJEEABDIwBD&amp;z=1" data-clk="https://max-l.mediav.com/rtb?type=3&amp;ver=1&amp;v=CGQSEDEzODRhOWI0MzBlODI3MjUY1NiJASCisEUoAWIXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTlwAA&amp;k=3THyrwAAAAA=&amp;i=CQ_EqMtF9Jgy&amp;exp=BQBECgBECAFEAQJEEgJEEABDIwBD&amp;x=__OFFSET_X__&amp;y=__OFFSET_Y__&amp;st=__EVENT_TIME_START__&amp;et=__EVENT_TIME_END__&amp;adw=__ADSPACE_W__&amp;adh=__ADSPACE_H__&amp;tc=&amp;turl=">
    <info-div class="wrap">
        <info-div class="singleImage-img singleImage-img-left">
            <info-div class="img" style="background-image:url(https://p4.ssl.qhimgs0.com/dmsmty/180_100_100/t019ec1b1926ea48f46.jpg)"><info-div class="ads-tag"></info-div></info-div>
        </info-div>
        <info-div class="singleImage-body singleImage-body-left">
            <info-div class="singleImage-title">喜讯:~面对众多笔记本内存品牌,一招解决如何选购.</info-div>
            <info-div class="singleImage-desc">xiyi · 顶新</info-div>
        </info-div>
    
    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_62" data-pid="62" data-track-view="{&quot;mod&quot;:&quot;kp_popu_62-556&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_62-556&quot;,&quot;con&quot;:&quot;,,&quot;}" data-report-view="{&quot;mod&quot;:&quot;kp_popu_62-556&quot;,&quot;keyword&quot;:&quot;&quot;}" data-report-click="{&quot;mod&quot;:&quot;kp_popu_62-556&quot;,&quot;keyword&quot;:&quot;&quot;}"><div class="mediav_ad"><newsfeed class="newsfeed QIHOO__WEB__SO__1565322702810_573" id="QIHOO__WEB__SO__1565322702810_573" style="display:block;margin:0;padding:0;border:none;width:852px;height:60px;overflow-y:hidden;overflow-x:hidden;position:relative;text-align:left;"><info-div id="QIHOO__WEB__SO__1565322702810_573-info" style="zoom:1"><info-div class="QIHOO__WEB__SO__1565322702810_573 singleImage clk" data-href="https://ssxd.mediav.com/s?type=2&amp;r=20&amp;mv_ref=blog.csdn.net&amp;enup=CAABfM2e8ggAAvKezXwA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b4376c087d&amp;price=AAAAAF1M7dAAAAAAAAIq3RAk80z9Tx8LrGKjuQ==&amp;finfo=DAABCAABAAAANAgAAgAAADkEAAM/TCVlundo2wAIAAIAAAADCgADDIb8vaqXe9oIAAQAAAA8BgAGG4sGAAoAAAgADgAAACUKAA8AAAAAAAsjkgA&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbsovropPPvsg0VAAAA&amp;uai=FeTGlAIlAhUEFvjfj9OPo/WGGRXyCCWzvb/hBCUAFRoUABwWtNPMzISU3otMFQAAAA&amp;ubi=FeLnJBXaoK8CFZ69sxYVpPumWxUGFSIW/oHH+hQW+N+5oaOv/oYZNAQWqOAQJQYV0I6j+QMVngEVACQUFuLnJAA&amp;clickid=0&amp;cpx=__OFFSET_X__&amp;cpy=__OFFSET_Y__&amp;cs=__EVENT_TIME_START__&amp;ce=__EVENT_TIME_END__&amp;ldtype=2&amp;csign2=ELYW1NkCL3Z=&amp;url=http%3A%2F%2Fbaidu.code.mytanwan.com%2Fhtmlcode%2F26374.html" data-pv="https://ssxd.mediav.com/s?type=1&amp;r=20&amp;tid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;finfo=DAABCAABAAAANAgAAgAAADkEAAM/TCVlundo2wAIAAIAAAADCgADDIb8vaqXe9oIAAQAAAA8BgAGG4sGAAoAAAgADgAAACUKAA8AAAAAAAsjkgA&amp;mv_ref=blog.csdn.net&amp;enup=CAABfM2e8ggAAvKezXwA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b4376c087d&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbsovropPPvsg0VAAAA&amp;uai=FeTGlAIlAhUEFvjfj9OPo/WGGRXyCCWzvb/hBCUAFRoUABwWtNPMzISU3otMFQAAAA&amp;ubi=FeLnJBXaoK8CFZ69sxYVpPumWxUGFSIW/oHH+hQW+N+5oaOv/oYZNAQWqOAQJQYV0I6j+QMVngEVACQUFuLnJAA&amp;ds=2&amp;price=AAAAAF1M7dAAAAAAAAIq3RAk80z9Tx8LrGKjuQ==,https://max-l.mediav.com/rtb?type=2&amp;ver=1&amp;v=CGQSEDEzODRhOWI0Mzc2YzA4N2QYsqOKASCisEUoAmIXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTmIAQA&amp;k=DMNvPQAAAAA=&amp;w=AAAAAF1M7dAAAAAAAAIrAHHJhXS8LAACLhnAJQ&amp;i=OLmZaQtF9Jgi&amp;exp=BQBECgBECAFEAQJEEgJEEABDJQBD&amp;z=1" data-clk="https://max-l.mediav.com/rtb?type=3&amp;ver=1&amp;v=CGQSEDEzODRhOWI0Mzc2YzA4N2QYsqOKASCisEUoAmIXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTlwAA&amp;k=eOSL8gAAAAA=&amp;i=OLmZaQtF9Jgi&amp;exp=BQBECgBECAFEAQJEEgJEEABDJQBD&amp;x=__OFFSET_X__&amp;y=__OFFSET_Y__&amp;st=__EVENT_TIME_START__&amp;et=__EVENT_TIME_END__&amp;adw=__ADSPACE_W__&amp;adh=__ADSPACE_H__&amp;tc=&amp;turl=">
    <info-div class="wrap">
        <info-div class="singleImage-img singleImage-img-left">
            <info-div class="img" style="background-image:url(https://s3m.mediav.com/galileo/301553-267cf6b7dafaed55b2b9d4f69f1ede29.gif)"><info-div class="ads-tag"></info-div></info-div>
        </info-div>
        <info-div class="singleImage-body singleImage-body-left">
            <info-div class="singleImage-title">别再玩假传奇了!这款传奇爆率9.8,你找到充值入口算我输!</info-div>
            <info-div class="singleImage-desc">贪玩游戏 · 顶新</info-div>
        </info-div>
    
    MySql入门之一:DDL操作创建表(添加主键, 外键约束以及基本的数据类型)

    03-05 阅读数 7060

    创建外键,声明主键的方式小结,mysql,主键,外键,数据类型,5.mysql数据类型 博文 来自: duoluodezhu0826的博客

    mysql如何对联合主键建立外键
    10-29

    如题 论坛

    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_63" data-pid="63" data-track-view="{&quot;mod&quot;:&quot;kp_popu_63-555&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_63-555&quot;,&quot;con&quot;:&quot;,,&quot;}" data-report-view="{&quot;mod&quot;:&quot;kp_popu_63-555&quot;,&quot;keyword&quot;:&quot;&quot;}" data-report-click="{&quot;mod&quot;:&quot;kp_popu_63-555&quot;,&quot;keyword&quot;:&quot;&quot;}"><div class="mediav_ad"><newsfeed class="newsfeed QIHOO__WEB__SO__1565322702827_265" id="QIHOO__WEB__SO__1565322702827_265" style="display:block;margin:0;padding:0;border:none;width:852px;height:60px;overflow-y:hidden;overflow-x:hidden;position:relative;text-align:left;"><info-div id="QIHOO__WEB__SO__1565322702827_265-info" style="zoom:1"><info-div class="QIHOO__WEB__SO__1565322702827_265 singleImage clk" data-href="https://ssxd.mediav.com/s?type=2&amp;r=20&amp;mv_ref=blog.csdn.net&amp;enup=CAABJG52VAgAAlR2biQA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b430e82725&amp;price=AAAAAF1M7dAAAAAAAAOMq9Yc3Ob752q7VUBAOA==&amp;finfo=DAABCAABAAAAFwgAAgAAABgEAAM/RVqtuzQX9AAIAAIAAAADCgADDnp2mWtnm2EIAAQAAAAjBgAGLbcGAAoAAAgADgAAABcKAA8AAAAAAAOCcAA&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbN2JPajK/EhWkVAAAA&amp;uai=FaixkwIlAhUEFvjf1uKVmrL6HBXyCCWxtO+eCiUAFRoUABwWgpSh/ofL6pxMFQAAAA&amp;ubi=FeLwVhWA7+oCFfbN3hgV/JbfWxUEFSIW0pfJrRcW+N+Asammu/ocNAQWqMAQJQYVlpiunwQVpgQVADbM89+c44/ztZABAA&amp;clickid=0&amp;cpx=__OFFSET_X__&amp;cpy=__OFFSET_Y__&amp;cs=__EVENT_TIME_START__&amp;ce=__EVENT_TIME_END__&amp;ldtype=2&amp;csign2=UOlBKuNDpi2=&amp;url=http%3A%2F%2Fyhbb.wfc810.com%2Findex.php%3Fm%3DOrder%26id%3DD5360post1%26uid%3D1%26tpl%3Ddetail%26ac%3Dw118.2" data-pv="https://ssxd.mediav.com/s?type=1&amp;r=20&amp;tid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;finfo=DAABCAABAAAAFwgAAgAAABgEAAM/RVqtuzQX9AAIAAIAAAADCgADDnp2mWtnm2EIAAQAAAAjBgAGLbcGAAoAAAgADgAAABcKAA8AAAAAAAOCcAA&amp;mv_ref=blog.csdn.net&amp;enup=CAABJG52VAgAAlR2biQA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b430e82725&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbN2JPajK/EhWkVAAAA&amp;uai=FaixkwIlAhUEFvjf1uKVmrL6HBXyCCWxtO+eCiUAFRoUABwWgpSh/ofL6pxMFQAAAA&amp;ubi=FeLwVhWA7+oCFfbN3hgV/JbfWxUEFSIW0pfJrRcW+N+Asammu/ocNAQWqMAQJQYVlpiunwQVpgQVADbM89+c44/ztZABAA&amp;ds=2&amp;price=AAAAAF1M7dAAAAAAAAOMq9Yc3Ob752q7VUBAOA==,https://max-l.mediav.com/rtb?type=2&amp;ver=1&amp;v=CGQSEDEzODRhOWI0MzBlODI3MjUY1NiJASCisEUoAmIXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTmIAQA&amp;k=s+6YGQAAAAA=&amp;w=AAAAAF1M7dAAAAAAAAOM8pl2sqE8YuYCfE6oqg&amp;i=CQHEqMtF9JgR&amp;exp=BQBECgBECAFEAQJEEgJEEABDIwBD&amp;z=1" data-clk="https://max-l.mediav.com/rtb?type=3&amp;ver=1&amp;v=CGQSEDEzODRhOWI0MzBlODI3MjUY1NiJASCisEUoAmIXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTlwAA&amp;k=uYJJzwAAAAA=&amp;i=CQHEqMtF9JgR&amp;exp=BQBECgBECAFEAQJEEgJEEABDIwBD&amp;x=__OFFSET_X__&amp;y=__OFFSET_Y__&amp;st=__EVENT_TIME_START__&amp;et=__EVENT_TIME_END__&amp;adw=__ADSPACE_W__&amp;adh=__ADSPACE_H__&amp;tc=&amp;turl=">
    <info-div class="wrap">
        <info-div class="singleImage-img singleImage-img-left">
            <info-div class="img" style="background-image:url(https://s3m.mediav.com/galileo/711729-6f3512474389dc21467d95812ebb94bb.jpg)"><info-div class="ads-tag"></info-div></info-div>
        </info-div>
        <info-div class="singleImage-body singleImage-body-left">
            <info-div class="singleImage-title">我发誓:这酒比1500元的酒还要好喝!</info-div>
            <info-div class="singleImage-desc">五分场健康 · 顶新</info-div>
        </info-div>
    
    mysql 外键(foreign key)的使用,同一个table的两个外键对应一个table的主键

    02-10 阅读数 6200

    官方语法:[CONSTRAINT[symbol]]FOREIGNKEY[index_name](index_col_name,...)REFERENCEStbl_name(index_col_name... 博文 来自: Kirito_j的博客

    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_64" data-pid="64" data-track-view="{&quot;mod&quot;:&quot;kp_popu_64-81&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_64-81&quot;,&quot;con&quot;:&quot;,,&quot;}" data-report-view="{&quot;mod&quot;:&quot;kp_popu_64-81&quot;,&quot;keyword&quot;:&quot;&quot;}" data-report-click="{&quot;mod&quot;:&quot;kp_popu_64-81&quot;,&quot;keyword&quot;:&quot;&quot;}"><div class="mediav_ad"><newsfeed class="newsfeed QIHOO__WEB__SO__1565322702860_802" id="QIHOO__WEB__SO__1565322702860_802" style="display:block;margin:0;padding:0;border:none;width:852px;height:60px;overflow-y:hidden;overflow-x:hidden;position:relative;text-align:left;"><info-div id="QIHOO__WEB__SO__1565322702860_802-info" style="zoom:1"><info-div class="QIHOO__WEB__SO__1565322702860_802 singleImage clk" data-href="https://ssxd.mediav.com/s?type=2&amp;r=20&amp;mv_ref=blog.csdn.net&amp;enup=CAABfM2e8ggAAvKezXwA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b4376c087d&amp;price=AAAAAF1M7dAAAAAAAAIrW21h6UZBFj8vfUClBw==&amp;finfo=DAABCAABAAAANwgAAgAAACIEAAM/VQIPj9g9SQAIAAIAAAADCgADDIcF1WS0hhsIAAQAAAAmBgAGG4sGAAoAAAgADgAAACUKAA8AAAAAAAsjkQA&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbsovropPPvsg0VAAAA&amp;uai=FeTGlAIlAhUEFvjfj9OPo/WGGRXyCCWzvb/hBCUAFRoUABwWtNPMzISU3otMFQAAAA&amp;ubi=FZDmJBW+2sYCFdbnqBcVnue+WBUGFSIWmo3H+hQW+N/OiK31gocZNAYWqOAQJQYVnMTE/gUVngEVACQUFpDmJAA&amp;clickid=0&amp;cpx=__OFFSET_X__&amp;cpy=__OFFSET_Y__&amp;cs=__EVENT_TIME_START__&amp;ce=__EVENT_TIME_END__&amp;ldtype=2&amp;csign2=OpO4Um1u22-=&amp;url=http%3A%2F%2Fy.code.17tanwan.com%2Fhtmlcode%2F37386.html" data-pv="https://ssxd.mediav.com/s?type=1&amp;r=20&amp;tid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;finfo=DAABCAABAAAANwgAAgAAACIEAAM/VQIPj9g9SQAIAAIAAAADCgADDIcF1WS0hhsIAAQAAAAmBgAGG4sGAAoAAAgADgAAACUKAA8AAAAAAAsjkQA&amp;mv_ref=blog.csdn.net&amp;enup=CAABfM2e8ggAAvKezXwA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b4376c087d&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbsovropPPvsg0VAAAA&amp;uai=FeTGlAIlAhUEFvjfj9OPo/WGGRXyCCWzvb/hBCUAFRoUABwWtNPMzISU3otMFQAAAA&amp;ubi=FZDmJBW+2sYCFdbnqBcVnue+WBUGFSIWmo3H+hQW+N/OiK31gocZNAYWqOAQJQYVnMTE/gUVngEVACQUFpDmJAA&amp;ds=3&amp;price=AAAAAF1M7dAAAAAAAAIrW21h6UZBFj8vfUClBw==,https://max-l.mediav.com/rtb?type=2&amp;ver=1&amp;v=CGQSEDEzODRhOWI0Mzc2YzA4N2QYsqOKASCisEUoA2IXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTmIAQA&amp;k=+zFJJQAAAAA=&amp;w=AAAAAF1M7dAAAAAAAAIrixg6F0yaJ7MeigX_NQ&amp;i=O_PZaQtF9J3p&amp;exp=BQBECgBECAFEAQJEEgJEEABDJQBD&amp;z=1" data-clk="https://max-l.mediav.com/rtb?type=3&amp;ver=1&amp;v=CGQSEDEzODRhOWI0Mzc2YzA4N2QYsqOKASCisEUoA2IXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTlwAA&amp;k=JvUjigAAAAA=&amp;i=O_PZaQtF9J3p&amp;exp=BQBECgBECAFEAQJEEgJEEABDJQBD&amp;x=__OFFSET_X__&amp;y=__OFFSET_Y__&amp;st=__EVENT_TIME_START__&amp;et=__EVENT_TIME_END__&amp;adw=__ADSPACE_W__&amp;adh=__ADSPACE_H__&amp;tc=&amp;turl=">
    <info-div class="wrap">
        <info-div class="singleImage-img singleImage-img-left">
            <info-div class="img" style="background-image:url(https://s3m.mediav.com/galileo/301448-abeeb273809c18bd15e1df9bcf4a4f25.gif)"><info-div class="ads-tag"></info-div></info-div>
        </info-div>
        <info-div class="singleImage-body singleImage-body-left">
            <info-div class="singleImage-title">陈小春哭诉:北京土豪怒砸2亿请他代言这款0充值正版传奇!真经典!</info-div>
            <info-div class="singleImage-desc">贪玩游戏 · 顶新</info-div>
        </info-div>
    
    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_65" data-pid="65" data-track-view="{&quot;mod&quot;:&quot;kp_popu_65-84&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_65-84&quot;,&quot;con&quot;:&quot;,,&quot;}" data-report-view="{&quot;mod&quot;:&quot;kp_popu_65-84&quot;,&quot;keyword&quot;:&quot;&quot;}" data-report-click="{&quot;mod&quot;:&quot;kp_popu_65-84&quot;,&quot;keyword&quot;:&quot;&quot;}"><div class="mediav_ad"><newsfeed class="newsfeed QIHOO__WEB__SO__1565322702873_261" id="QIHOO__WEB__SO__1565322702873_261" style="display:block;margin:0;padding:0;border:none;width:852px;height:60px;overflow-y:hidden;overflow-x:hidden;position:relative;text-align:left;"><info-div id="QIHOO__WEB__SO__1565322702873_261-info" style="zoom:1"><info-div class="QIHOO__WEB__SO__1565322702873_261 singleImage clk" data-href="https://ssxd.mediav.com/s?type=2&amp;r=20&amp;mv_ref=blog.csdn.net&amp;enup=CAABJG52VAgAAlR2biQA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b430e82725&amp;price=AAAAAF1M7dAAAAAAAAONTNEAYkaXukh5Rc0/0A==&amp;finfo=DAABCAABAAAADwgAAgAAAB0EAAM/QJFjCuqrCgAIAAIAAAADCgADDnp/sfUtruwIAAQAAAAdBgAGF2UGAAoAAAgADgAAABcKAA8AAAAAAALmMQA&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbN2JPajK/EhWkVAAAA&amp;uai=FaixkwIlAhUEFvjf1uKVmrL6HBXyCCWxtO+eCiUAFRoUABwWgpSh/ofL6pxMFQAAAA&amp;ubi=FdClLxWU6N8CFZzT1RgVnqfQWxUGFSIWqrDR8RMW+N+VmLPsv/ocNAYWqMAQJQYVuKKm1gcVngEVADaP4tXNluKAjkcA&amp;clickid=0&amp;cpx=__OFFSET_X__&amp;cpy=__OFFSET_Y__&amp;cs=__EVENT_TIME_START__&amp;ce=__EVENT_TIME_END__&amp;ldtype=2&amp;csign2=XdBw06H8tf-=&amp;url=https%3A%2F%2Fdev.tg.wan.360.cn%2F%3Fchannel%3D224440034%26placeid%3D%26creativeid%3D%7Bcreativeid%7D" data-pv="https://ssxd.mediav.com/s?type=1&amp;r=20&amp;tid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;finfo=DAABCAABAAAADwgAAgAAAB0EAAM/QJFjCuqrCgAIAAIAAAADCgADDnp/sfUtruwIAAQAAAAdBgAGF2UGAAoAAAgADgAAABcKAA8AAAAAAALmMQA&amp;mv_ref=blog.csdn.net&amp;enup=CAABJG52VAgAAlR2biQA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b430e82725&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbN2JPajK/EhWkVAAAA&amp;uai=FaixkwIlAhUEFvjf1uKVmrL6HBXyCCWxtO+eCiUAFRoUABwWgpSh/ofL6pxMFQAAAA&amp;ubi=FdClLxWU6N8CFZzT1RgVnqfQWxUGFSIWqrDR8RMW+N+VmLPsv/ocNAYWqMAQJQYVuKKm1gcVngEVADaP4tXNluKAjkcA&amp;ds=3&amp;price=AAAAAF1M7dAAAAAAAAONTNEAYkaXukh5Rc0/0A==,https://max-l.mediav.com/rtb?type=2&amp;ver=1&amp;v=CGQSEDEzODRhOWI0MzBlODI3MjUY1NiJASCisEUoA2IXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTmIAQA&amp;k=iuu0HQAAAAA=&amp;w=AAAAAF1M7dAAAAAAAAONg9q7zTWef9olXlzcEg&amp;i=CLhEqMtF9JhN&amp;exp=BQBECgBECAFEAQJEEgJEEABDIwBD&amp;z=1" data-clk="https://max-l.mediav.com/rtb?type=3&amp;ver=1&amp;v=CGQSEDEzODRhOWI0MzBlODI3MjUY1NiJASCisEUoA2IXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTlwAA&amp;k=fvV52wAAAAA=&amp;i=CLhEqMtF9JhN&amp;exp=BQBECgBECAFEAQJEEgJEEABDIwBD&amp;x=__OFFSET_X__&amp;y=__OFFSET_Y__&amp;st=__EVENT_TIME_START__&amp;et=__EVENT_TIME_END__&amp;adw=__ADSPACE_W__&amp;adh=__ADSPACE_H__&amp;tc=&amp;turl=">
    <info-div class="wrap">
        <info-div class="singleImage-img singleImage-img-left">
            <info-div class="img" style="background-image:url(https://s3m.mediav.com/galileo/387432-12c23c475fd15774d7bbb0203f02a354.gif)"><info-div class="ads-tag"></info-div></info-div>
        </info-div>
        <info-div class="singleImage-body singleImage-body-left">
            <info-div class="singleImage-title">全天无限刷BOSS,装备靠打,交易自由,错过这款,再等一年!</info-div>
            <info-div class="singleImage-desc">热血战歌创世 · 顶新</info-div>
        </info-div>
    
    mysql 表基本操作(创建表、添加主键外键、非空约束、唯一性约束、默认约束、自动增加)

    06-17 阅读数 3076

    1、单字段主键:createtabletb_emp(idint(11)primarykey,namevarchar(25),depIdint(11),salaryfloat);primarykey指定... 博文 来自: qq_33792097的博客

    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_66" data-pid="66" data-track-view="{&quot;mod&quot;:&quot;kp_popu_66-87&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_66-87&quot;,&quot;con&quot;:&quot;,,&quot;}" data-report-view="{&quot;mod&quot;:&quot;kp_popu_66-87&quot;,&quot;keyword&quot;:&quot;&quot;}" data-report-click="{&quot;mod&quot;:&quot;kp_popu_66-87&quot;,&quot;keyword&quot;:&quot;&quot;}"><div class="mediav_ad"><newsfeed class="newsfeed QIHOO__WEB__SO__1565322702886_545" id="QIHOO__WEB__SO__1565322702886_545" style="display:block;margin:0;padding:0;border:none;width:852px;height:60px;overflow-y:hidden;overflow-x:hidden;position:relative;text-align:left;"><info-div id="QIHOO__WEB__SO__1565322702886_545-info" style="zoom:1"><info-div class="QIHOO__WEB__SO__1565322702886_545 singleImage clk" data-href="https://ssxd.mediav.com/s?type=2&amp;r=20&amp;mv_ref=blog.csdn.net&amp;enup=CAABfM2e8ggAAvKezXwA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b4376c087d&amp;price=AAAAAF1M7dAAAAAAAAIr3SxEvUIsW+EZ4T65mw==&amp;finfo=DAABCAABAAAASQgAAgAAACEEAAM/YDebj/xtSAAIAAIAAAADCgADDIcO7fiCxPEIAAQAAAAlBgAGG4sGAAoAAAgADgAAACUKAA8AAAAAAAsjkAA&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbsovropPPvsg0VAAAA&amp;uai=FeTGlAIlAhUEFvjfj9OPo/WGGRXyCCWzvb/hBCUAFRoUABwWtNPMzISU3otMFQAAAA&amp;ubi=Fb6sNxXgh8YCFeTipRcV0ujGWhUGFRwW3Nef/xUW+N/j77a7h4cZNAgWqOAQJQYVjIO48QYVngEVACQOFr6sNwA&amp;clickid=0&amp;cpx=__OFFSET_X__&amp;cpy=__OFFSET_Y__&amp;cs=__EVENT_TIME_START__&amp;ce=__EVENT_TIME_END__&amp;ldtype=2&amp;csign2=ELYW1NkCL3Z=&amp;url=http%3A%2F%2Fbaidu.code.mytanwan.com%2Fhtmlcode%2F37123.html" data-pv="https://ssxd.mediav.com/s?type=1&amp;r=20&amp;tid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;finfo=DAABCAABAAAASQgAAgAAACEEAAM/YDebj/xtSAAIAAIAAAADCgADDIcO7fiCxPEIAAQAAAAlBgAGG4sGAAoAAAgADgAAACUKAA8AAAAAAAsjkAA&amp;mv_ref=blog.csdn.net&amp;enup=CAABfM2e8ggAAvKezXwA&amp;mvid=NzgxMDUzNjg3NTAxNjA5MzAwNjAwMTk&amp;bid=1384a9b4376c087d&amp;ugi=FcTgigEVyNtrTBUCFSgVKBUAABXAr9JdJcgBFoDQ2Pvi6ccFHBbsovropPPvsg0VAAAA&amp;uai=FeTGlAIlAhUEFvjfj9OPo/WGGRXyCCWzvb/hBCUAFRoUABwWtNPMzISU3otMFQAAAA&amp;ubi=Fb6sNxXgh8YCFeTipRcV0ujGWhUGFRwW3Nef/xUW+N/j77a7h4cZNAgWqOAQJQYVjIO48QYVngEVACQOFr6sNwA&amp;ds=4&amp;price=AAAAAF1M7dAAAAAAAAIr3SxEvUIsW+EZ4T65mw==,https://max-l.mediav.com/rtb?type=2&amp;ver=1&amp;v=CGQSEDEzODRhOWI0Mzc2YzA4N2QYsqOKASCisEUoBGIXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTmIAQA&amp;k=rIlwawAAAAA=&amp;w=AAAAAF1M7dAAAAAAAAIr_mbEdAsXlBUmVUytSw&amp;i=O_WZaQtF9J3H&amp;exp=BQBECgBECAFEAQJEEgJEEABDJQBD&amp;z=1" data-clk="https://max-l.mediav.com/rtb?type=3&amp;ver=1&amp;v=CGQSEDEzODRhOWI0Mzc2YzA4N2QYsqOKASCisEUoBGIXNzgxMDUzNjg3NTAxNjA5MzAwNjAwMTlwAA&amp;k=GO19lwAAAAA=&amp;i=O_WZaQtF9J3H&amp;exp=BQBECgBECAFEAQJEEgJEEABDJQBD&amp;x=__OFFSET_X__&amp;y=__OFFSET_Y__&amp;st=__EVENT_TIME_START__&amp;et=__EVENT_TIME_END__&amp;adw=__ADSPACE_W__&amp;adh=__ADSPACE_H__&amp;tc=&amp;turl=">
    <info-div class="wrap">
        <info-div class="singleImage-img singleImage-img-left">
            <info-div class="img" style="background-image:url(https://s3m.mediav.com/galileo/453407-422303c83f37f67075642b39a2de926f.gif)"><info-div class="ads-tag"></info-div></info-div>
        </info-div>
        <info-div class="singleImage-body singleImage-body-left">
            <info-div class="singleImage-title">这变态传奇你卸载算我输!爆率9.8,不花一分钱,刀刀爆橙装!</info-div>
            <info-div class="singleImage-desc">贪玩游戏 · 顶新</info-div>
        </info-div>
    
    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_67" data-pid="67" data-track-view="{&quot;mod&quot;:&quot;kp_popu_67-653&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_67-653&quot;,&quot;con&quot;:&quot;,,&quot;}" data-report-view="{&quot;mod&quot;:&quot;kp_popu_67-653&quot;,&quot;keyword&quot;:&quot;&quot;}" data-report-click="{&quot;mod&quot;:&quot;kp_popu_67-653&quot;,&quot;keyword&quot;:&quot;&quot;}"><div class="mediav_ad"><newsfeed class="newsfeed QIHOO__WEB__SO__1565322702902_924" id="QIHOO__WEB__SO__1565322702902_924" style="display:block;margin:0;padding:0;border:none;width:900px;height:84px;overflow-y:hidden;overflow-x:hidden;position:relative;text-align:left;"><info-div id="QIHOO__WEB__SO__1565322702902_924-info" style="zoom:1"></info-div></newsfeed></div>
    
    查看mysql所有的主键外键约束名称

    09-08 阅读数 1万+

    select * from INFORMATION_SCHEMA.KEY_COLUMN_USAGE 博文 来自: flymoringbird的博客

    <div class="recommend-item-box recommend-ad-box"><div id="kp_box_68" data-pid="68" data-track-view="{&quot;mod&quot;:&quot;kp_popu_68-654&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_68-654&quot;,&quot;con&quot;:&quot;,,&quot;}" data-report-view="{&quot;mod&quot;:&quot;kp_popu_68-654&quot;,&quot;keyword&quot;:&quot;&quot;}" data-report-click="{&quot;mod&quot;:&quot;kp_popu_68-654&quot;,&quot;keyword&quot;:&quot;&quot;}"><div class="mediav_ad"><newsfeed class="newsfeed QIHOO__WEB__SO__1565322702924_747" id="QIHOO__WEB__SO__1565322702924_747" style="display:block;margin:0;padding:0;border:none;width:900px;height:84px;overflow-y:hidden;overflow-x:hidden;position:relative;text-align:left;"><info-div id="QIHOO__WEB__SO__1565322702924_747-info" style="zoom:1"></info-div></newsfeed></div>
    
                <div class="recommend-item-box type_hot_word">
                                <div class="content clearfix" style="width: 712px;">
                    <div class="word float-left">
                                                            <span>
                        <a href="https://edu.csdn.net/courses/o5329_s5330_k " target="_blank">
                        机器学习教程                    </a></span>
                                                                                <span>
                        <a href="https://edu.csdn.net/courses/o280_s351_k " target="_blank">
                        Objective-C培训                    </a></span>
                                                                                <span>
                        <a href="https://edu.csdn.net/combos/o7115_s388_l0_t " target="_blank">
                        交互设计视频教程                    </a></span>
                                                                                <span>
                        <a href="https://edu.csdn.net/course/play/5599/104252 " target="_blank">
                        颜色模型                    </a></span>
                                                                                <span>
                        <a href="https://edu.csdn.net/combos/o363_l0_t " target="_blank">
                        设计制作学习                    </a></span>
                                                            </div>
                </div>
                                                <div class="content clearfix" style="width: 712px;">
                    <div class="float-left">
                                        <span>
                        <a href="https://www.csdn.net/gather_24/MtTaEg3sMDM5MS1ibG9n.html" target="_blank">
                        mysql关联查询两次本表</a>
                    </span>
                                        <span>
                        <a href="https://www.csdn.net/gather_10/MtjaIg3sMTUzMy1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
                        native底部 react</a>
                    </span>
                                        <span>
                        <a href="https://www.csdn.net/gather_1b/Ntzagg1sOTU3LWRvd25sb2Fk.html" target="_blank">
                        extjs glyph 图标</a>
                    </span>
                                        <span>
                        <a href="https://www.csdn.net/gather_4a/MtjaUg2sODAtZWR1.html" target="_blank">
                        数据库课程表的外键</a>
                    </span>
                                        <span>
                        <a href="https://www.csdn.net/gather_4a/MtTaQg0sMDItZWR1.html" target="_blank">
                        数据库课程表的外键</a>
                    </span>
                                        </div>
                </div>
                                </div>
                            <div class="recommend-loading-box">
                <img src="https://csdnimg.cn/release/phoenix/images/feedLoading.gif">
            </div>
            <div class="recommend-end-box">
                <p class="text-center">没有更多推荐了,<a href="https://blog.csdn.net/" class="c-blue c-blue-hover c-blue-focus">返回首页</a></p>
            </div>
        </div>
    </main>
    
    <aside>
    <div id="asideProfile" class="aside-box">
    <!-- <h3 class="aside-title">个人资料</h3> -->
    <div class="profile-intro d-flex">
        <div class="avatar-box d-flex justify-content-center flex-column">
            <a href="https://blog.csdn.net/cuixiaoming1994">
              <img src="https://avatar.csdn.net/B/9/0/3_cuixiaoming1994.jpg" class="avatar_pic">
                              <img src="https://g.csdnimg.cn/static/user-reg-year/2x/1.png" class="user-years">
                          </a>
            
        </div>
        <div class="user-info d-flex justify-content-center flex-column">
            <p class="name csdn-tracking-statistics tracking-click" data-report-click="{&quot;mod&quot;:&quot;popu_379&quot;}">
                <a href="https://blog.csdn.net/cuixiaoming1994" class="" id="uid">cuixiaoming1994</a>
            </p>
                    </div>
                <div class="opt-box d-flex justify-content-center flex-column">
            <span class="csdn-tracking-statistics tracking-click" data-report-click="{&quot;mod&quot;:&quot;popu_379&quot;}">
                                    <a class="btn btn-sm btn-red-hollow attention" id="btnAttent">关注</a>
                            </span>
        </div>
            </div>
    <div class="data-info d-flex item-tiling">
                <dl class="text-center" title="33">
                        <dt><a href="https://blog.csdn.net/cuixiaoming1994?t=1">原创</a></dt>
            <dd><a href="https://blog.csdn.net/cuixiaoming1994?t=1"><span class="count">33</span></a></dd>
                    </dl>
        <dl class="text-center" id="fanBox" title="5">
            <dt>粉丝</dt>
            <dd><span class="count" id="fan">5</span></dd>
        </dl>
        <dl class="text-center" title="21">
            <dt>喜欢</dt>
            <dd><span class="count">21</span></dd>
        </dl>
        <dl class="text-center" title="2">
            <dt>评论</dt>
            <dd><span class="count">2</span></dd>
        </dl>
    </div>
    <div class="grade-box clearfix">
        <dl>
            <dt>等级:</dt>
            <dd>
                <a href="https://blog.csdn.net/home/help.html#level" title="3级,点击查看等级说明" target="_blank">
                    <svg class="icon icon-level" aria-hidden="true">
                        <use xlink:href="#csdnc-bloglevel-3"></use>
                    </svg>
                </a>
            </dd>
        </dl>
        <dl>
            <dt>访问:</dt>
            <dd title="26313">
                2万+            </dd>
        </dl>
        <dl>
            <dt>积分:</dt>
            <dd title="539">
                539            </dd>
        </dl>
        <dl title="137383">
            <dt>排名:</dt>
            <dd>13万+</dd>
        </dl>
    </div>
        <div class="personal-home-page"><a target="_blank" href="https://me.csdn.net/cuixiaoming1994">TA的个人主页 &gt;</a></div>
    

    最新评论

    	<div class="aside-box">
    		<div id="kp_box_57" data-pid="57" data-track-view="{&quot;mod&quot;:&quot;kp_popu_57-77&quot;,&quot;con&quot;:&quot;,,&quot;}" data-track-click="{&quot;mod&quot;:&quot;kp_popu_57-77&quot;,&quot;con&quot;:&quot;,,&quot;}" data-report-click="{&quot;mod&quot;:&quot;kp_popu_57-77&quot;,&quot;keyword&quot;:&quot;&quot;}"><script type="text/javascript">
    (function() {
        var s = "_" + Math.random().toString(36).slice(2);
        document.write('<div style="" id="' + s + '"></div>');
        (window.slotbydup = window.slotbydup || []).push({
            id: "u3163270",
            container:  s
        });
    })();
    

    			<div class="aside-box">
    		<div class="persion_article">
    		<div class="right_box footer_box csdn-tracking-statistics" data-report-view="{&quot;mod&quot;:&quot;popu_475&quot;}">        <div class="contact-box" id="footer-contact-box"><div class="img-box"><a href="https://edu.csdn.net?utm_source=csdn_footer" target="_blank"><img src="https://csdnimg.cn/pubfooter/images/edu-QR.png" alt="CSDN学院" style="padding: 6px;"></a><p class="app-text">CSDN学院</p></div><div class="img-box fr"><img style="padding:6px;" src="https://csdnimg.cn/pubfooter/images/job-QR.png" alt="CSDN企业招聘"><p class="app-text">CSDN企业招聘</p></div></div>        <div class="contact-info">        <p><svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.167 2h11.666C14.478 2 15 2.576 15 3.286v9.428c0 .71-.522 1.286-1.167 1.286H2.167C1.522 14 1 13.424 1 12.714V3.286C1 2.576 1.522 2 2.167 2zm-.164 3v1L8 10l6-4V5L8 9 2.003 5z" fill="#5c5c5c" fill-rule="evenodd"></path></svg><a href="mailto:webmaster@csdn.net" target="_blank"><span class="txt">kefu@csdn.net</span></a>        <em class="width126"><svg t="1538013544186" width="17" height="17" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23556" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M902.60033922 650.96445566c-18.0718526-100.84369837-94.08399771-166.87723736-94.08399771-166.87723737 10.87530062-91.53186599-28.94715402-107.78733693-28.94715401-107.78733691C771.20003413 93.08221664 517.34798062 98.02553561 511.98620441 98.16348824 506.65661791 98.02553561 252.75857992 93.08221664 244.43541101 376.29988138c0 0-39.79946279 16.25547094-28.947154 107.78733691 0 0-75.98915247 66.03353901-94.0839977 166.87723737 0 0-9.63372291 170.35365477 86.84146124 20.85850523 0 0 21.70461757 56.79068296 61.50407954 107.78733692 0 0-71.1607951 23.19910867-65.11385185 83.46161052 0 0-2.43717093 67.16015592 151.93232126 62.56172014 0 0 108.5460788-8.0932473 141.10300432-52.14626271H526.33792324c32.57991817 44.05301539 141.10300431 52.1462627 141.10300431 52.14626271 154.3235077 4.59843579 151.95071457-62.56172013 151.95071457-62.56172014 6.00095876-60.26250183-65.11385185-83.46161053-65.11385185-83.46161052 39.77647014-50.99665395 61.4810877-107.78733693 61.4810877-107.78733692 96.45219231 149.49514952 86.84146124-20.85850523 86.84146125-20.85850523" p-id="23557" fill="#5c5c5c"></path></svg><a href="http://wpa.b.qq.com/cgi/wpa.php?ln=1&amp;key=XzgwMDE4MDEwNl80ODc3MzVfODAwMTgwMTA2XzJf" class="qqcustomer_s" target="_blank"><span class="txt">QQ客服</span></a></em></p>        <p><em class="width126"><svg t="1538012951761" width="17" height="17" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23083" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M466.4934485 880.02006511C264.6019863 859.18313878 107.13744214 688.54706608 107.13744214 481.14947309 107.13744214 259.68965394 286.68049114 80.14660493 508.14031029 80.14660493s401.00286817 179.54304901 401.00286814 401.00286816v1.67343191C908.30646249 737.58941724 715.26799489 943.85339507 477.28978337 943.85339507c-31.71423369 0-62.61874229-3.67075386-92.38963569-10.60739903 30.09478346-11.01226158 56.84270313-29.63593923 81.5933008-53.22593095z m-205.13036267-398.87059202a246.77722444 246.77722444 0 0 0 493.5544489 0 30.85052691 30.85052691 0 0 0-61.70105383 0 185.07617062 185.07617062 0 0 1-370.15234125 0 30.85052691 30.85052691 0 0 0-61.70105382 0z" p-id="23084" fill="#5c5c5c"></path></svg><a href="http://bbs.csdn.net/forums/Service" target="_blank"><span class="txt">客服论坛</span></a></em>        <svg t="1538013874294" width="17" height="17" style="" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23784" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M1031.29689505 943.85339507h-863.70679012A71.98456279 71.98456279 0 0 1 95.60554212 871.86883228v-150.85178906c0-28.58329658 16.92325492-54.46750945 43.13135785-65.93861527l227.99160176-99.75813425c10.55341735-4.61543317 18.24580594-14.0082445 20.72896295-25.23643277l23.21211998-105.53417343a71.95757195 71.95757195 0 0 1 70.28414006-56.51881307h236.95255971c33.79252817 0 63.02360485 23.5090192 70.28414004 56.51881307l23.21211997 105.53417343c2.48315701 11.25517912 10.17554562 20.62099961 20.72896296 25.23643277l227.99160177 99.75813425a71.98456279 71.98456279 0 0 1 43.13135783 65.93861527v150.85178906A71.98456279 71.98456279 0 0 1 1031.26990421 943.85339507z m-431.85339506-143.94213475c143.94213474 0 143.94213474-48.34058941 143.94213474-107.96334876s-64.45411922-107.96334877-143.94213474-107.96334877c-79.51500637 0-143.94213474 48.34058941-143.94213475 107.96334877s0 107.96334877 143.94213475 107.96334876zM1103.254467 296.07330247v148.9894213a35.97878598 35.97878598 0 0 1-44.15700966 35.03410667l-143.94213473-33.57660146a36.0057768 36.0057768 0 0 1-27.80056231-35.03410668V296.1002933c-35.97878598-47.98970852-131.95820302-71.98456279-287.91126031-71.98456279S347.53801649 248.11058478 311.53223967 296.1002933v115.385829c0 16.73431906-11.52508749 31.25538946-27.80056233 35.03410668l-143.94213473 33.57660146A35.97878598 35.97878598 0 0 1 95.63253297 445.06272377V296.07330247C162.81272673 152.13116772 330.77670658 80.14660493 599.47049084 80.14660493s436.63077325 71.98456279 503.81096699 215.92669754z" p-id="23785" fill="#5c5c5c"></path></svg>400-660-0108 </p>        <p style="text-align:center">工作时间 8:30-22:00</p>        </div>        <div class="bg-gray">            <div class="feed_copyright">            <p><a class="right-dotte" href="//www.csdn.net/company/index.html#about" target="_blank">关于我们</a><a href="//www.csdn.net/company/index.html#recruit" target="_blank" class="right-dotte">招聘</a><a href="//www.csdn.net/company/index.html#contact" target="_blank" class="right-dotte">广告服务</a>            <a href="https://www.csdn.net/gather/A" target="_blank" class="footer_baidu">            网站地图</a></p>            <p class="fz12_baidu"><a href="https://zn.baidu.com/cse/home/index" target="_blank"><svg width="13" height="14" xmlns="http://www.w3.org/2000/svg"><path d="M8.392 7.013c1.014 1.454 2.753 2.8 2.753 2.8s1.303 1.017.47 2.98c-.833 1.962-3.876.942-3.876.942s-1.122-.36-2.424-.072c-1.303.291-2.426.181-2.426.181s-1.523.037-1.957-1.888c-.434-1.927 1.52-2.982 1.666-3.161.145-.183 1.159-.873 1.81-1.963.653-1.09 2.608-1.962 3.984.181zm1.23 5.706V9.346H8.64v2.534h-.937s-.3-.044-.356-.285V9.33l-.925.015v2.518s.042.627.925.855h2.277zm-3.685.013V7.951l-.896-.014v1.295H3.987s-1.054.086-1.422 1.28c-.129.798.114 1.266.156 1.368.043.099.383.682 1.238.852h1.978zm-2.433-1.45c-.087-.286.013-.613.057-.741.042-.128.228-.427.61-.54h.855v1.948h-.797s-.555-.029-.725-.668zm6.877-8.775c-.143.909-.865 2.108-1.99 1.962-1.121-.144-1.375-1.16-1.267-2.179C7.214 1.458 8.21.18 9.007.364c.796.18 1.52 1.235 1.374 2.143zm-4.09-.345c0 1.197-.68 2.164-1.52 2.164S3.25 3.36 3.25 2.162C3.25.967 3.932 0 4.77 0c.842 0 1.52.967 1.52 2.162zm4.854 2.09c1.34 0 1.701 1.309 1.701 1.743 0 .438.182 2.29-1.485 2.326-1.667.037-1.737-1.126-1.737-1.96 0-.874.179-2.11 1.52-2.11zm-7.93.581c.045.398.253 2.217-1.27 2.544C.427 7.704-.14 5.947.028 5.124c0 0 .18-1.78 1.412-1.89.98-.085 1.7.986 1.774 1.6z" fill="#999" fill-rule="evenodd"></path></svg><em>百度提供站内搜索</em></a>&nbsp;<a href="http://www.miibeian.gov.cn/publish/query/indexFirst.action" target="_blank" class="ml14">京ICP备19004658号</a></p>            <p class="fz12_baidu">©1999-2019 北京创新乐知网络技术有限公司 </p>            </div>        </div>        <div class="allow-info-box">        <p><a href="https://csdnimg.cn/cdn/content-toolbar/csdn-ICP.png" target="_blank">经营性网站备案信息</a>        <em class="width126"><a href="http://www.cyberpolice.cn/" target="_blank"><span>网络110报警服务</span></a></em></p>        <p><a href="http://www.bjjubao.org/" target="_blank"><span>北京互联网违法和不良信息举报中心</span></a></p>        <p><a href="http://www.12377.cn/" target="_blank"><span>中国互联网举报中心</span></a><a href="https://download.csdn.net/index.php/tutelage/" target="_blank"><span style="margin-left:8px">家长监护</span></a><a href="https://blog.csdn.net/blogdevteam/article/details/90369522" target="_blank"><span style="margin-left:8px">版权申诉</span></a></p>        </div>        </div></div>
    	</div>
    </div>
    
    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值