zoukankan      html  css  js  c++  java
  • 数据库练习

    create database k20150419  --创建一个名为k20150419的数据库
    go  --连接符
    use k20150419 --使用k20150419这个数据库
    go
    create table practice  --创建一个名为practice的表
    (
    tno int primary key identity(1,1),   --将tno设为主键
    name varchar(50) not null,
    country varchar(50),
    skills varchar(50) not null,
    age int,
    kg decimal(18,1),
    cm decimal(18,1)
    )
    go
    insert into practice values('宇智波鼬','火之国','月渎',19,58,178)   --插入一系列数据
    insert into practice values('我爱罗','风之国','砂暴大葬',21,50,173)
    insert into practice values('漩涡鸣人','火之国','九尾螺旋丸',17,55,175)
    insert into practice values('雏田','火之国','柔步双狮拳',17,44,164)
    insert into practice values('自来也','火之国','蛤蟆油炎弹',54,78,185)
    go
    select *from practice where name like '%也'  --查询practice表中名字像'%也'的 ,%可代替任意语言
    go
    select *from practice
    go
    update practice set skills='仙人模式' where skills='九尾螺旋丸'  --将skills='九尾螺旋丸'的修改为skills='仙人模式'

    go
    delete from practice where country='风之国'  --删除practice表中country='风之国'的。
    go
    insert into practice values('艾希','战争学院','魔法水晶箭',25,49,168) 
    go
    select *from practice where age between 18 and 20  --查询practice表中 age 在18和20之间的

  • 相关阅读:
    开发mis系统的技术
    Navicat软件与pymysql模块
    5.6作业
    mysql表的查询
    5.5作业
    约束条件
    mysql基本数据类型
    数据库
    网络编程项目
    并发编程四
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4439768.html
Copyright © 2011-2022 走看看