zoukankan      html  css  js  c++  java
  • 数据库表的创建、修改、清空、数据的插入、更新、删除 语句

    --创建表格

    create table test (name varchar2(8), age number(4), job varchar(8) ) ----------------------------------------------------------------------------------------------------------------------------- --修改表格
    alter table test
    --增加一列 add(hiredate date) alter table test --修改数据类型 modify(hiredate varchar(10)) select *from test alter table test -- 删除一列 drop(age) ------------------------------------------------------------------------------------------------------------------------------- --插入数据 insert into test (name,job,hiredate)values ('0000','哈哈','05-01-1998'); insert into test (name,job,hiredate)values ('0001','哈哈1','05-01-1998'); insert into test (name,job,hiredate)values ('0002','哈哈2','05-01-1998'); insert into test (name,job,hiredate)values ('0003','哈哈3','05-01-1998'); insert into test (name,job,hiredate)values ('0004','哈哈4','05-01-1998'); delete test where name='0000'--删除数据 ------------------------------------------------------------------------------------------------------------------------------- --更新数据
    update test
    set name='姓名' where name like '%00%' select *from test truncate table test -- 清空表内数据
    --
    drop table test --删除表
    执行完之后,表将不复存在,只能再次创建新表
  • 相关阅读:
    git 的常用命令(未完待补充)
    Mysql占用内存过高参数优化
    mysql安全基线设置
    redis安全基线设置
    centos7安全基线设置
    检查shell脚本
    redis安装和配置
    TIME_WAIT状态全是3306解决办法
    PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted 错误
    tcp的三次握手和四次挥手(二)
  • 原文地址:https://www.cnblogs.com/-strong/p/7195857.html
Copyright © 2011-2022 走看看