zoukankan      html  css  js  c++  java
  • 数据库基本知识

    create database s2015041--创建数据库
    drop database XXXXXX--删除数据库
    use master--使用master数据库
    go--语句与语句的链接符号
    create table abb
    (
      code int not null,--列
      name varchar(50) not null,--列
      sex int,
      degree decimal(18,2) not null--列
    )
      go
      insert into abb values(1,'张三',0,99);
      insert into abb values(2,'李四',1,79);--主键设置完成后需要保存后才能被识别,防止重复
      insert into abb(code,name,degree) values(4,'王五',97);--指定列添加
      go
      select *from abb  --查询
      update abb set sex=1--修改所有的行中的sex列的值
      update abb set sex=1 where code=4--加where条件筛选修改code=3那一行的sex
      update abb set name='田七',sex=0,code=3,degree=99 where code=4
      delete from abb--删除所有数据
      delete from abb where code=1
      
      create table abc--修改表内信息需要重新执行一下表
      (
      no int primary key identity(1,1),
      name varchar(50) not null,
      sex varchar(50) not null,
      age int not null,
      high int not null,
      [weight] int not null,
      id int not null,
      [address] varchar(50)not null
      )
      go
    insert into abc values('李四','',18,173,75,37030319,'亚特兰蒂斯')
    insert into abc values('小二','',21,163,60,37030319,'远离一切之理想乡')
    insert into abc values('王五','',18,183,85,37030317,'阿尔托利亚')
    insert into abc values('蕾蕾','',18,189,68,37039011,'圣安地列斯')
    insert into abc values('小黄','',16,155,48,37099006,'楼兰古国')
    insert into abc values('小花','',24,161,50,37099307,'亚历山大')
     select *from abc
     delete from abc
    update abc set name='张三' where name='李四';
    二百个不间断的重复,只是让我看到了人的命运无法改变这一事实而已。
  • 相关阅读:
    c#调用c++动态链接库的问题
    “LC.exe”已退出,代码为 -1
    MVC部署到iis
    计算机上没有找到was服务
    无法查找或打开pdb文件
    用WCF服务来动态的获取本地XML省市区文档
    关于使用条码打印机指令打印汉字的问题
    关于SQL SERVER导出数据的问题!
    应用CLR的线程池
    所有的异常都要使用try catch 语句捕获?
  • 原文地址:https://www.cnblogs.com/dlexia/p/4438631.html
Copyright © 2011-2022 走看看