1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| USE [testDB] GO
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Score]( [StudentID] [int] NOT NULL, [Class] [nvarchar](50) NOT NULL, [TheScore] [int] NOT NULL ) ON [PRIMARY] GO
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Student]( [ID] [int] NOT NULL, [Name] [nvarchar](50) NOT NULL, [Sex] [nvarchar](50) NULL, [Age] [int] NULL ) ON [PRIMARY] GO INSERT [dbo].[Score] ([StudentID], [Class], [TheScore]) VALUES (1, N'國文', 100) GO INSERT [dbo].[Score] ([StudentID], [Class], [TheScore]) VALUES (1, N'英文', 60) GO INSERT [dbo].[Score] ([StudentID], [Class], [TheScore]) VALUES (2, N'國文', 50) GO INSERT [dbo].[Score] ([StudentID], [Class], [TheScore]) VALUES (2, N'英文', 40) GO INSERT [dbo].[Score] ([StudentID], [Class], [TheScore]) VALUES (3, N'國文', 60) GO INSERT [dbo].[Score] ([StudentID], [Class], [TheScore]) VALUES (3, N'英文', 80) GO INSERT [dbo].[Student] ([ID], [Name], [Sex], [Age]) VALUES (1, N'Bill', N'male', 25) GO INSERT [dbo].[Student] ([ID], [Name], [Sex], [Age]) VALUES (2, N'Mary', N'female', 30) GO INSERT [dbo].[Student] ([ID], [Name], [Sex], [Age]) VALUES (3, N'Tim', N'female', 30) GO INSERT [dbo].[Student] ([ID], [Name], [Sex], [Age]) VALUES (4, N'John', N'male', 28) GO
|