Skip to main content

Posts

Showing posts from July 2, 2019

Create Table in SQL

Create table in SQL: How to create table in SQL In this post , i'm going to explain that how you can create table in SQL easily: To create table in SQL, you can use CREATE Table command: Syntax for Create table: CREATE TABLE Table_Name( Column _Name1 Datatype, Column_Name2 Datatype.....etc); In above, to create table, First you need to define the action about what you are going to create so i have define command CREATE TABLE, this command will always be used if you are going to create Table. Then you need to give Table Name because every table must have their unique name. Then create column name like First_Name, Lasr_Name, Age whatever you required then every column must have their datatype define so that SQL can identify what type of values will be passed. Now look at below example: In this we are going to create a table for employee record like EMP table haveEmp_ID, Emp_Name, Emp_Age, DOJ and Salary. CREATE TABLE EMP (Emp_ID INT,   Emp_Name Varchar(20), ...

Insert values in SQL table

Insert Values in SQL table In this post, you will learn how to insert values in table by using INSERT Command. INSERT command is used to insert values in Table of your database. By using INSERT statement you can easily add value in your table: Syntax of INSERT statement: INSERT INTO Table_Name ( Column1, Column2, Column3....)  Values(values1, values2, values3 ....etc); Here first you need to use INSERT INTO command and then you need to specify table name in which you want to add values. Then you need to specify column name and then need to mentioned values based on datatype. Now lets see an example: I'm going to insert value in EMP table Emp_ID Emp_Name Emp_Age Emp_Salay Insert values in EMP table: INSERT INTO EMP (Emp_ID, Emp_Name, Emp_Age, Emp_Salary) Values (1, 'Mohan', 25, 25000); After executing this command, you will see result like: Emp_ID Emp_Name Emp_Age Emp_Salay 1 Mohan 25 25000 ...