keronshops.blogg.se

Idatabase examples
Idatabase examples





IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'.') AND type in (N'U')) BEGIN CREATE TABLE. ( NOT NULL, NOT NULL, CONSTRAINT PRIMARY KEY CLUSTERED ( ASC, ASC )WITH (IGNORE_DUP_KEY = OFF) ON ) ON END GO - Create the Course table. ( IDENTITY(1,1) NOT NULL, NOT NULL, NOT NULL, (3, 2) NULL, CONSTRAINT PRIMARY KEY CLUSTERED ( ASC )WITH (IGNORE_DUP_KEY = OFF) ON ) ON END GO - Create the CourseInstructor table. ( NOT NULL, nvarchar(100) NOT NULL, CONSTRAINT PRIMARY KEY CLUSTERED ( ASC )WITH (IGNORE_DUP_KEY = OFF) ON ) ON END GO -Create the StudentGrade table. ( NOT NULL, nvarchar(50) NOT NULL, nvarchar(50) NOT NULL, NOT NULL, CONSTRAINT PRIMARY KEY CLUSTERED ( ASC )WITH (IGNORE_DUP_KEY = OFF) ON ) ON END GO - Create the OnlineCourse table. ( IDENTITY(1,1) NOT NULL, nvarchar(50) NOT NULL, nvarchar(50) NOT NULL, NULL, NULL, nvarchar(50) NOT NULL, CONSTRAINT PRIMARY KEY CLUSTERED ( ASC )WITH (IGNORE_DUP_KEY = OFF) ON ) ON END GO - Create the OnsiteCourse table. ( NOT NULL, nvarchar(50) NOT NULL, NOT NULL, NOT NULL, NULL, CONSTRAINT PRIMARY KEY CLUSTERED ( ASC )WITH (IGNORE_DUP_KEY = OFF) ON ) ON END GO - Create the Person table. SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO - Create the Department table. Copy the following SQL into the new query, then right-click on the query and select Execute.Right-click on the database in Server Explorer and select New Query.If you are using Visual Studio 2012 or newer.The new database will now appear in Object Explorer.Select OK and you will be asked if you want to create a new database, select Yes.Select Databases in the Object Explorer, right click and select New Database….Open Microsoft SQL Server Management Studio.Here are the steps to create the database: It is based on the the version supplied by Microsoft. You can use this script to create the School sample database.







Idatabase examples