USE master
GO
IF NOT EXISTS (
SELECT name
FROM sys.databases
WHERE name = N'databaseName'
)
CREATE DATABASE [databaseName]
GO
USE [myTable]
IF OBJECT_ID('dbo.Posts', 'U') IS NOT NULL
DROP TABLE dbo.Posts
GO
CREATE TABLE dbo.Posts
(
postId INT NOT NULL PRIMARY KEY, -- primary key column
Title [NVARCHAR](50) NOT NULL,
Category [NVARCHAR](50) NOT NULL,
Content [NVARCHAR](50) NOT NULL
);
GO
INSERT INTO dbo.Customers
([postId],[Title], [Category], [Content])
VALUES
( 1, N'About apes', N'Animals', N'Apes are cool'),
( 2, N'Story', N'Articles', N'The story about dead women killer'),
( 3, N'Very important article', N'News', N'Not so important information'),
GO
SELECT * FROM dbo.Posts