Surprise Me!

SQL SERVER 2017 : PART 3.1 (CREATE TABLE STATEMENT)

2018-05-23 13 Dailymotion

Well come to sql server tutorial part 3.1.<br />Today I will show you how to create and modify table in query editor, Using create table and alter table statement.<br />In part 3, I have talked about table, how to create it graphically and data types.<br /><br />In previous tutorial we have created customer table.<br />Now I am going to create same table using query editor. <br /><br /><br />USE TEST_DB<br /><br />CREATE TABLE Customer1<br />(<br /> [CustomerID] [int] NOT NULL,<br /> [FirstName] [varchar](50) NULL,<br /> [LastName] [nchar](10) NULL,<br /> [BirthDate] [date] NULL,<br /> )<br /><br />First login to sql server management studio.<br />Click new query.<br />Type use database name. <br />Under that database the table will be created.<br />For this tutorial test db is our database name.<br /><br />Now type create table and table name customer table.<br />Press enter then type opening and closing first bracket.<br />In between these bracket type column name data type and constraint.<br />Every column must be separated by a comma sign. <br /><br />Click execute.<br />Refresh database to view the newly created table.<br /><br />In practical environment you may need to modify table.<br />In sql, it is called alter table.<br /><br />Now I will show you how to add and delete column from an existing table.<br /><br />Type alter table and customer table as table name.<br />Then type add, column name and data type.<br />Click execute.<br />Select table.<br />Click refresh.<br />Expand to view newly added column.<br /><br />Now I will show you how to delete a column from a table.<br />Type drop column and column name.<br />Then click execute.<br /><br />COLUMN NAME joining date has been deleted.<br />That’s all for today. Please subscribe to my channel. Don’t forget to comment and like or dislike.

Buy Now on CodeCanyon