SQL Server 2012 Step-by-step: Create a Database and a table
Install Microsoft SQL Server 2012.
Open SQL Server Management Studio.Enter your server name.Connect to Database Engine.
At left side there is an Databases option.Select and right click on them than add new Database.
Write Database name as (MyFirstDataBase) and File Name write on first row MyFirstDataBase on second row write MyFirstDataBase_log now Click OK.
Right click on databases refresh them first.Your Database has been created.
Now see how to create Database tables.
Choose your Database (MyFirstDataBase) open them right click on the table option select New Table.
Now fill the Table with specific columns.Make the Id of table as primary key by right click on id column and select set primary key.
Go to their properties and do identity specification Yes.
Save this table as table name UserAccount.
Now again done all these steps to create another table as table name Order after fill column and set primary key.
Now add the primary key of UserAccount table as column name in Order table.Now made it foreign key of order table as select the row, right click and select relationships.
Click on Add choose Tables and Columns Specification.
On primary key table choose as UserAccount and column as A_ID. In foreign key table choose column as A_ID Click on OK than Close.
Do identity specification Yes.Click to save table as TBL_order.
Now your DATABASE and its TABLES has been created.
Another way to create your Database is by executing Query.
Select from top as New Query Write on them
CREATE DATABASE MyFirstDataBase
Now execute this query your Database would be generated.