zoukankan      html  css  js  c++  java
  • 数据库SQL

      mySQL的安装和简单的命令

      show -uroot -p  进入mySQL

      show databases  查看所有库

      show tables  查看所有表

      use 表名  进入表

      create database 库名  创建一个库

      drop database 库名  删除一个库

      create database if not exists 库名 default charset utf8  创建一个库(如果他不存在)编码格式是utf-8

        create table if not exists 表名(

        ID int,

        name varchar(20));    创建一个表 

     select * from 表名  查看表的内容

      insert into 表名(ID,name) values();  往表中添加信息(或选择性添加属性)

      alter table 表名 add address varchar(20);  往表中添加新列address

      alter table 表名 change address Address varchar(20);  修改列( address改成 Address)

      alter table 表名 drop column address;  删除列(address)

      create table 新表 select * from 旧表  把旧表中的内容复制到新表中

      create table 新表 select * from 旧表 where 1=0  把旧表中的结构复制到新表中

      create index 索引名 on 表名(索引内容)  按索引内容索引

      alter table 表名 drop index 索引名  删除索引

      delete from 表名 where (条件)  删除行

      

  • 相关阅读:
    C#时间差
    centos8安装ffmpeg
    CentOS8同步时间
    安装Supervisor
    ajax 传递 token
    .net core 3.1 中 的跨域设置
    jaeger 本地编译
    Kubernates 环境搭建
    linux : find
    Linux: 文件分割和合并
  • 原文地址:https://www.cnblogs.com/k1024/p/5444625.html
Copyright © 2011-2022 走看看