zoukankan      html  css  js  c++  java
  • 建库和建表

    /*建库*/

    --主数据库文件--
    name = 'School', --主数据文件逻辑名
    fileName = 'D:projectSchool.mdf', --主数据文件物理逻辑名
    size = 5MB, --初始值大小
    maxsize = 100MB, --最大大小
    filegrowth = 15% --数据文件增长量
    )
    log on
    (
    --日志文件--
    name = 'School_log',
    filename = 'D:projectSchool_log.ldf',
    size = 2MB,
    filegrowth = 1MB
    )
    go

    /*建表*/
    use test
    create table student(
    学号 int primary key identity(001,1),
    性别 bit ,
    姓名 char(50),
    班级 int,
    专业 char(20)
    )

    /*查表 */
    select * from [dbo].[student]
    /*修改数据类型 */
    alter table[dbo].[student]
    alter column 姓名 varchar(50)

    /*插入数据 */
    insert into student(性别,姓名,班级,专业) values(1,'文',1,'大数据')
    insert into student(性别,姓名,班级,专业) values(1,'mmao',1,'大数据')
    insert into student(性别,姓名,班级,专业) values(1,'sfsfsd',1,'大数据')

  • 相关阅读:
    SpringBoot04-web
    springboot03-日志功能
    SpringBoot02-自动配置原理
    SpringBoot02
    SpringBoot01
    八大排序算法
    SpringSecurity04
    SpringSecurity03
    SpringSecurity02
    SpringSecurity01
  • 原文地址:https://www.cnblogs.com/mi-9/p/12623379.html
Copyright © 2011-2022 走看看