SQL Day 3: Creating Tables & Enforcing Primary and Foreign Key

LO1: Creating the Tables LO2: Enforcing Primary and Foreign Key Prerequisite: Creating a Database Creating Tables You can create a table by two ways. By Graphically : Expand the Database in Object Explorer and right click on Tables folder and click on New Table Give the Column Name, Data Type and check Allow Nulls. Column Name: This is going to be your column name and this column name should be unique in the table. Data Type: For which type of data will be contained in the column. For example int, nvarchar, float, image etc. Allow Nulls: This is a check box which tells us that the column will contain null values or not. Primary Key allows you to uniquely identify the row in the table and it does not allow null. Must Remember: Primary key can be applied to one single column or group of the column to uniquely identify a record/row in the table but only one primary key allows in the table. To make the primary key graphically y...