當前位置:首頁 » 編程語言 » 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]

幾個表的創建方式都一樣 不在贅述... 希望有點幫助