创建数据库
CREATE DATABASE dra
ON PRIMARY
(
NAME = 'd_data',
FILENAME = 'D:\Draper\d_data.mdf',
SIZE = 5MB,
MAXSIZE = 100MB,
FILEGROWTH = 10%
)
LOG ON
(
NAME = 'd_log',
FILENAME = 'D:\Draper\d_log.ldf',
SIZE = 5MB,
MAXSIZE = 100MB,
FILEGROWTH = 10%
)
新建表
USE dra
GO
CREATE TABLE people
(
id int PRIMARY KEY,
name nvarchar(10)
)
查询
SELECT TOP 10 学号
,课程号
,成绩
FROM xsgl.dbo.cj
插入
INSERT INTO xsgl.dbo.cj
(学号,课程号,成绩)
VALUES
(2003030307,'j003',43)