美文网首页
数据库的基础内容

数据库的基础内容

作者: 坏坏坏坏坏 | 来源:发表于2018-11-12 20:43 被阅读0次
  • -- 注释 SUE 执行
  • 创建表单
create table 表名(
            字段名 字段类型,
            字段名 字段类型                          
);
  • 删除数据行
    select*from 表名
    delete from 表名 where 字段名
  • 删除数据列:alert table 表名 drop column 字段名
  • 删除表: drop table 表名
  • 修改表名:exec sp_rename ‘旧表名’,‘新表名’
  • 增加一列新行默认值设置为当前日期:alter table 表名 add 字段名 字段类型 default getdate();
  • 表格添加数据:insert into 表名 values();
  • 将表格类型显现出来:select*from 表名;
  • 修改表格内容:update 表名 set 字段名=修改内容 where 字段名=指定内容;
  • 添加新的列数:alter table 表名 add 字段名(字段类型)

相关文章

网友评论

      本文标题:数据库的基础内容

      本文链接:https://www.haomeiwen.com/subject/faqhfqtx.html