zoukankan      html  css  js  c++  java
  • 1 简单的命令集合

    show databases; 查看数据库

    begin; rollback; commit;

    use text; 切换数据库
    Database changed 数据库已经切换
    create database texts; 创建数据库

    drop database texts; 删除数据库

    create database text default character set utf8 collate utf8_general_ci; 创建数据库+字符集

    select * from student; #表的内容

    show tables; 查考表

    describe student #设计表
    或者 desc student;

    auto_increment; #自增长

    primary key; 主键

    alter table student rename student2; 改表名

    alter table student add id int ; 增加字段

    alter table student change id ids varchar not null; 更该字段名

    alter table student drop id ;(删除字段)

    alter table student add constraint pk-name primary key student (name); #添加主键

    alter table student add constraint fk-name foreign key (id) references person (id); #添加外键

    show engines #查看搜索引擎

    show variables like 'storage_engine%';

    insert into [表名] values (值);#插入数据

    create tabel 新表 ( select * from student );

    update 表名 ste 列名 = 更新值 where 更新条件;

    delete from 表名 where 条件;

    truncate table student; #删除字段

    select <列名|表达式|函数|常量>
    from <表名>
    where <条件>
    order by <排序的列名> [ ASC 或 DESC]

  • 相关阅读:
    Intellij IDEA13 创建多模块Maven项目
    oracle锁
    oracle rac负载均衡
    awk命令
    政务外网、政务专网、政务内网和互联网
    图片切换实现选中-未选中效果
    生成带logo 的二维码
    控制input为number时样式
    移动端适配的解决方法?
    input-checkbox选中及非选中样式设置
  • 原文地址:https://www.cnblogs.com/L-o-g-i-c/p/8278511.html
Copyright © 2011-2022 走看看