USE [Users_mdb]
GO

IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'tblComputerComponent')
BEGIN

CREATE TABLE [dbo].[tblComputerComponent](
	[nID] [int] NOT NULL,
	[tName] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	CONSTRAINT [PK_tblComputerComponent] PRIMARY KEY NONCLUSTERED ( [nID] ASC))

END
	
GO

IF NOT EXISTS(SELECT * FROM [tblComputerComponent] WHERE nID=1)
	INSERT [dbo].[tblComputerComponent] ([nID], [tName]) VALUES (1, N'Hard Disk');
	
IF NOT EXISTS(SELECT * FROM [tblComputerComponent] WHERE nID=2)
	INSERT [dbo].[tblComputerComponent] ([nID], [tName]) VALUES (2, N'CPU');

IF NOT EXISTS(SELECT * FROM [tblComputerComponent] WHERE nID=3)
	INSERT [dbo].[tblComputerComponent] ([nID], [tName]) VALUES (3, N'Fan');

IF NOT EXISTS(SELECT * FROM [tblComputerComponent] WHERE nID=4)
	INSERT [dbo].[tblComputerComponent] ([nID], [tName]) VALUES (4, N'Computer Case');

IF NOT EXISTS(SELECT * FROM [tblComputerComponent] WHERE nID=5)
	INSERT [dbo].[tblComputerComponent] ([nID], [tName]) VALUES (5, N'Network Card');
	
IF NOT EXISTS(SELECT * FROM [tblComputerComponent] WHERE nID=6)
	INSERT [dbo].[tblComputerComponent] ([nID], [tName]) VALUES (6, N'Motherboard');

IF NOT EXISTS(SELECT * FROM [tblComputerComponent] WHERE nID=7)
	INSERT [dbo].[tblComputerComponent] ([nID], [tName]) VALUES (7, N'Memory');
	
IF NOT EXISTS(SELECT * FROM [tblComputerComponent] WHERE nID=8)
	INSERT [dbo].[tblComputerComponent] ([nID], [tName]) VALUES (8, N'Video Card');

IF NOT EXISTS(SELECT * FROM [tblComputerComponent] WHERE nID=9)
	INSERT [dbo].[tblComputerComponent] ([nID], [tName]) VALUES (9, N'Power Supply');

IF NOT EXISTS(SELECT * FROM [tblComputerComponent] WHERE nID=10)
	INSERT [dbo].[tblComputerComponent] ([nID], [tName]) VALUES (10, N'Sound Card');

IF NOT EXISTS(SELECT * FROM [tblComputerComponent] WHERE nID=11)
	INSERT [dbo].[tblComputerComponent] ([nID], [tName]) VALUES (11, N'CD/DVD/Blue-Ray');

GO

