• 数据库基本知识


    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='李四';
    二百个不间断的重复,只是让我看到了人的命运无法改变这一事实而已。
  • 相关阅读:
    3、字节流输入输出实现文件的copy
    2、io的读出数据到文件中的内容(文件字节输出流)
    1、io的读取文件中的内容(文件字节输入流)
    10 linux中运行jar
    Linux 部署 iSCSI 客户端配置(Linux)
    Linux 部署 iSCSI 服务端
    Linux上使用iSCSI概述
    SSH实现免密登陆
    源码安装Python3
    Windows(受控主机)上配置
  • 原文地址:https://www.cnblogs.com/dlexia/p/4438631.html
Copyright © 2020-2023  润新知