SQL server is the most popular database of microsoft company which was develop in 1989. SQL stands for Structure Query Language. It is RDBMs so in this case record is store in tabular format. It is platform dependent because it runs only on windows operating system.
SQL CREATE TABLE Statement
SQL CREATE TABLE statement is use to create table in a database is knows as Create table.
Syntax
The simple syntax to create the table
create table “tablename”
(“column1” “data type”,
“column2” “data type”,
“column3” “data type”,
———–
“columnN” “data type”);
Example of SQL CREATE TABLE
CREATE TABLE Per ( id INT, LastName varchar(50), FirstName varchar(50), Address varchar(255), phone varchar (12) );
Output of SQL CREATE TABLE
SELECT Table Statement SQL
The SELECT statement is the most common use command in SQL. The Select statement is use to select dat from a database is knows as SELECT statement SQL.
Syntax
The simple syntax to SELECT Table
QuerySELECT Column_Name_1, Column_Name_2, ...., Column_Name_N FROM Table_Name;
Example of Select Statement SQL
SELECT Name FROM person;
Output of Select Statement SQL
The SQL DROP TABLE Statement
The Drop Table statement is use to drop an existing table in a database is knows as SQL DROP TABLE Statement.
Syntax
The simple syntax to Drop Table
DROP TABLE table_name;
Example of SQL DROP TABLE Statement
DROP TABLE personal;
Output of SQL DROP TABLE Statement
emty
SQL DELETE TABLE Statement
The DELETE statement is used to delete rows from a table is knows as SQL DELETE TABLE Statement.
Syntax
The simple syntax to Delete table
DELETE FROM table_name [WHERE condition];
TRUNCATE TABLE Statement in SQL
A truncate SQL is use to remove all rows. It is similar to the DELETE statement is knows as Truncate table
Syntax
The simple syntax to Truncate table
TRUNCATE TABLE table_name;
Example of SQL Truncate table Statement
TRUNCATE TABLE person;
Output of SQL Truncate table Statement
Alter TABLE Statement in SQL
The ALTER TABLE statement in Structure Query Language. It is use to add, modify, and delete columns of an existing table is knows as Alter TABLE Statement.
Syntax
ALTER TABLE table_name
Syntax of ALTER TABLE ADD Column statement in SQL
ALTER TABLE table_name ADD column_name datatype;
Example of ADD Column Statement SQL
Output of ADD Column Statement SQL
If you have any queries regarding this article or if I have missed something on this topic, please feel free to add in the comment down below for the audience. See you guys in another article.
To know more about SQL please Wikipedia click here .
Stay Connected Stay Safe, Thank you
0 Comments