zoukankan      html  css  js  c++  java
  • 字段修改表关系回顾

    昨日回顾

    1.字段修改
    alter modify
    alter change
    alter add ''|first|after
    alter drop
    
    2.表关系
    一对一:外键存在两边都可以
    	一对多:外键存在多的一方
    	多对多:外键必须存在第三张关系表
    	外键:外键是表的一个字段,值可以重复也可以唯一,值是被关联表被关联字段的值,被关联字段必须有唯一键
        foreign key(外键字段) references 被关联表(被关联字段)
    	
    	create table book(
    		id int not null primary key auto_increment,
    		name varchar(64) unique
    	);
    	create table author(
    		id int not null primary key auto_increment,
    		name varchar(64) unique
    	);
    	create table book_author(
    		id int not null primary key auto_increment,
    		book_name varchar(64),
    		author_name varchar(64),
    		foreign key(book_name) references book(name)
    		on update cascade
    		on delete cascade,
    		foreign key(author_name) references author(name)
    		on update cascade
    		on delete cascade
    	);
    
  • 相关阅读:
    (转载)MySQL日期时间函数大全
    Tcl commands
    Toplevel
    tk 8.4 commands
    iwidgets
    Options for Buttontype widgets
    Text Widget Options
    tk options
    itk_option
    Widget Options
  • 原文地址:https://www.cnblogs.com/aden668/p/11585372.html
Copyright © 2011-2022 走看看