当前位置: 晴天网 > MYSQL > 第3页
  • 创建后表的修改:删除整个数据库

    基本形式:drop database 数据库名; 示例: 删除x_db数据库:drop database x_db;......[08-13]

  • 创建后表的修改:删除整张表

    基本形式:drop table 表名; 示例: 删除y表:drop table y;......[08-13]

  • 创建后表的修改:删除列

    基本形式:alter table 表名 drop 列名称; 示例: 删除birthday列:alter table students drop birthday;......[08-13]

  • 创建后表的修改:修改列

    基本形式:alter table 表名 change 列名称 列新名称 新数据类型; 示例: 将表tel列改名为phone:alter table students change tel phone char(13) default -; 将name列的数据类型改为char(16):alter table students ch......[08-13]

  • 创建后表的修改:添加列

    基本形式:alter table 表名 add 列名 列数据类型 [after 插入位置]; 示例: 在表的最后追加列address:alter table students add address char(60); 在名为age的列后插入列 birthday:alter table students add birt......[08-13]

  • 操作MYSQL数据库:删除表中的数据

    delete语句用于删除表中的数据,基本用法为: delete from 表名称 where 删除条件; 使用示例: 删除id为2的行:delete from students where id=2; 删除所有年龄小于19岁的数据:delete from students where......[08-13]

  • 操作MYSQL数据库:更新表中的数据

    update语句可用来修改表中的数据,基本的使用形式为: update 表名称 set 列名称=新值 where 更新条件; 使用示例: 将id为2的手机号改为默认的-:update students set tel=default where id=2; 将所有人......[08-13]

  • 操作MYSQL数据库:查询表中的数据

    select语句常用来根据一定的查询规则到数据库中获取数据,其基本的用法为: select 列名称 from 表名称 [查询条件]; 例如要查询students表中所有学生的名字和年龄,输入语句select name,age......[08-13]

  • 操作MYSQL数据库:向表中插入数据

    insert语句可以用来将一行或多行数据插到数据库表中,使用的一般形式如下: insert [into] 表名 [(列名1, 列名2, 列名3, ...)] values (值1, 值2, 值3, ...); 其中[]内的内容是可选的,例如,要给......[08-13]

  • 使用MYSQL数据库:创建数据库表

    使用create table语句可完成对表的创建,create table的常见形式: create table 表名称(列声明); 以创建students表为例, 表中将存放学号(id)、姓名(name)、性别(sex)、年龄(age)、联系电话(tel)这些内容......[08-13]