zoukankan      html  css  js  c++  java
  • mysql建表测试

    drop table if exists news; --如果存在表则删除
    create table news  --创建表
    (
            id int unsigned not null auto_increment,
            title varchar(30) not null default '' comment '新闻标题',
            class_id int unsigned not null default '0' comment '所属分类的id',
            content text not null comment '详情',
            primary key(id),
            index `i_title`(title), index `i_class_id`(class_id)
    ) engine='innodb' default charset utf8 comment = '新闻表';--设置引擎为innodb  默认编码为utf8
    drop table if exists  news_class;
    create table news_class
    (
            id int unsigned not null auto_increment,
            class_name varchar(10) not null default '' comment '分类名称',
            primary key(id),
            index `i_class_name`(class_name)
    ) engine='innodb' default charset utf8 comment="新闻分类表";
    -- 分类, php新闻 id=1  linux新闻 id=2  mysql新闻 id=3 其下 新闻
    insert into news_class (class_name) values ('php新闻'),('Linux新闻'),('Mysql新闻');--插入数据库3条数据
    insert into news(title,class_id,content) values --批量插入数据
    ('php新闻1','1','详情'),
    ('php新闻2','1','详情'),
    ('linux新闻1','2','详情'),
    ('linux新闻2','2','详情'),
    ('未知分类新闻','4','详情');
    --以下是参考写入数据的方法replace into news_class(class_name) values('测试')
    insert into news_class set class_name='abc';

  • 相关阅读:
    WinDbg 图形界面功能(一)
    WinDbg的安装、配置和功能
    windbg调试托管代码 .Net clr
    win32线程栈溢出问题 (二)
    win32线程栈溢出问题 (一)
    WinDbg常用命令系列---查看线程调用栈命令K*简介
    BCD码
    Intel 80386 CPU
    Intel 80286 CPU
    Intel 8086 CPU
  • 原文地址:https://www.cnblogs.com/ghjbk/p/6681020.html
Copyright © 2011-2022 走看看