当前位置:首页 » 编程语言 » tsql编程题及答案
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

tsql编程题及答案

发布时间: 2023-06-09 07:05:44

① SQL编程题的答案是什么

1.
CREATE TABLE `student` (
`Sno` int(5) NOT NULL,
`Sname` varchar(6) NOT NULL,
`Ssex` varchar(2) NOT NULL,
`Sdept` char(255),
`Sage` int(2) CHECK (value BETWEEN 15 AND 25),
PRIMARY KEY (`Sno`)
)
2.select * from student where Sname like '张%';
3.没有SC表结构
4.insert into student values(95020,"陈冬","男","CS",18)
5.猜的表结构,update set 学分=3 where cno='3';

② 使用T-SQL语句实现下列功能(数据库):

1.

USE [master]
GO
CREATE DATABASE [active] ON PRIMARY
( NAME = N'arch1', FILENAME = N'D:\arch1.mdf' , SIZE = 5120KB , MAXSIZE = 51200KB , FILEGROWTH = 1024KB )
LOG ON
( NAME = N'archlog1', FILENAME = N'D:\archlog1.ldf' , SIZE = 1024KB , MAXSIZE = 51200KB , FILEGROWTH = 1024KB )
COLLATE Chinese_PRC_CI_AS
GO

2.

USE [master]
GO
DROP DATABASE active

3.
USE [master]
GO
CREATE DATABASE 学生 ON PRIMARY
( NAME = N'学生', FILENAME = N'D:\学生.mdf' , SIZE = 5120KB , MAXSIZE = 51200KB , FILEGROWTH = 1024KB )
LOG ON
( NAME = N'学生_log', FILENAME = N'D:\学生_log.ldf' , SIZE = 1024KB , MAXSIZE = 5120KB, FILEGROWTH = 1024KB )
COLLATE Chinese_PRC_CI_AS
GO
USE [学生]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[学生信息](
[RID] [int] NULL
) ON [PRIMARY]

几个表的创建方式都一样 不在赘述... 希望有点帮助