How to Create a Database, a Table, as well as Insert to a greater extent than or less information using SQL?

How to Create a Database, a Table, together with Insert to a greater extent than or less information using SQL?

Using SQL Commands nosotros tin forcefulness out practice Databases, Tables, together with Insert information into Tables...

SQL Commands tin forcefulness out locomote divided inwards to iv categories,
1. Data definition Language
2. Data Manipulation Language
3. Data Control Language
4. Transaction Control Language

Step 1: Create a Database 
I
t is Data definition Language Operation.

Syntax:
Create Database Database_Name;

Example:
Create Database gcreddy;
-----------------------------------
Step 2: Create a Table inwards the Database

It is likewise Data definition Language Operation.

Before Create a tabular array origin Use/Select database...

Syntax:
Create Table table_name ( column1 datatype, column2 datatype, column3 datatype,
....
.;

Example:
Create Table abcd(
Id int,
Name varchar (50)
);
-----------------------------------
Step 3: Insert a Record inwards to the Table

It is Data Manipulation Language Operation.

Syntax:
Insert Into table_Name (column1, column2, colum3....)
Values (Value1, Value2, Value3...);

Example:
Insert Into abcd
(Id, Name)
Values (1, 'Ramesh');

Select * From abcd;
-----------------------------------
Step 4: Insert multiple Records...

Example:
Insert Into abcd
(Id, Name)
Values (2, 'Venkat'),
(3, 'Ramu'),
(4, 'Bhasha'),
(5, 'David')
;
-----------------------------------
Step 5: Check the Table using Select statement...

Syntax:
Select * From table_Name;

Example:
Select * From abcd;

Database Table alongside Records...

Example:
Insert Into abcd
(Id, Name)
Values (2, 'Venkat'),
(3, 'Ramu'),
(4, 'Bhasha'),
(5, 'David')
;
x

Sumber http://www.gcreddy.com/
Post a Comment (0)
Previous Post Next Post