You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aaaa/dbo.SC.Table.sql

29 lines
1.7 KiB

2 years ago
<EFBFBD><EFBFBD>USE [TEST]
GO
/****** Object: Table [dbo].[SC] Script Date: 2022/10/30 23:57:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SC](
[Sno] [int] NOT NULL,
[Cno] [int] NOT NULL,
[Grade] [int] NULL,
CONSTRAINT [PK_SC] PRIMARY KEY CLUSTERED
(
[Sno] ASC,
[Cno] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SC] WITH CHECK ADD CONSTRAINT [FK_SC_Course] FOREIGN KEY([Cno])
REFERENCES [dbo].[Course] ([Cno])
GO
ALTER TABLE [dbo].[SC] CHECK CONSTRAINT [FK_SC_Course]
GO
ALTER TABLE [dbo].[SC] WITH CHECK ADD CONSTRAINT [FK_SC_Student] FOREIGN KEY([Sno])
REFERENCES [dbo].[Student] ([Sno])
GO
ALTER TABLE [dbo].[SC] CHECK CONSTRAINT [FK_SC_Student]
GO