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 --删除表
    执行完之后,表将不复存在,只能再次创建新表
  • 相关阅读:
    redhat 5 中文乱码
    生成树
    交换机端口模式
    链路聚合
    AP注册
    信息收集
    Python 25 Django跨域请求
    Python 24 Django之csrf中间件
    Python 23 Django基础
    Python 21 Flask(三)第三方组件
  • 原文地址:https://www.cnblogs.com/-strong/p/7195857.html
Copyright © 2011-2022 走看看