DATABASE DDL DML Commands
DATABASE DDL DML Commands
Database
Important of Database
It helps you understand your customers, track your inventory, and make informed decisions.
But without proper database management, your data can quickly become disorganized and
unusable. Database management is the process of organizing and storing data in a way that
makes it easy to find, use, and analyze
DATABASE LANGUAGES
CREATE
SYNTAX FOR CREATING DATABASE USING SQL EXAMPLE FOR CREATING A DATABASE USING SQL
INSERT
SYNTAX FOR INSERTING A EXAMPLE FOR INSERTING A
TABLE USING SQL TABLE USING SQL
1.INSERT INTO table_n 1.INSERT INTO Stude
ame nts
2.( 2.(
3.column_Name1 , 3.Stud_id,
4.column_Name2 , 4.First_name,
5.column_Name3 , 5.Last_name,
6..... 6.Age,
7.column_NameN 7.Marks Stud_id First_name Last_name Age Marks
8. ) 8.)
9.VALUES 9.VALUES 1 Anil Kumar 25 95
10.( 10.(
11.value_1, 11.01,
12.value_2, 12.'Anil’,
13.value_3, 13.'Kumar’,
14..... 14.25,
15.value_N 15.95
16.) ; 16.);
DATA MANIPULATION LANGUAGE
SELECT
Retrieving The Data Using Select
Command
1.SELECT
2.column_Name_1, 1.SELECT
3.column_Name_2, 2.Stud_id,
4.….., 3.First_name,
5.column_Name_N 4.Marks
6.FROM 5.FROM
7.Name_of_table; 6.Students;
Update
SYNTAX FOR UPDATING TABLE USING SQL EXAMPLE FOR UPDATING TABLE USING SQL
ALTER
ADD ALTER
DROP RENAME
SYNTAX FOR ADDING INTO A TABLE USING SQL EXAMPLE FOR ADDING INTO A TABLE USING SQL
Contact
Stud_id First_name Last_name Age Marks
No
1 Nithin Kumar 26 95
SYNTAX FOR DROPING TABLE USING SQL EXAMPLE FOR DROPRING TABLE USING SQL
Total_Mark
Stud_id First_name Last_name Age
s
1 Nithin Kumar 26 95
DATA DEFINITION LANGUAGE
DELETE
SYNTAX FOR DELETING A ROW IN A TABLE USING SQL EXAMPLE FOR DELETING A ROW IN A TABLE USING SQL
2 Sathish Sagar 24 90
3 Venu Kumar 24 89
4 Vinod Sethi 24 98
5 Sidhi Sampath 28 97
Truncate:
Syntax:
Example:
After running the above query Student table will be truncated, i.e, the data will be deleted but the structure
will remain in the memory for further operations.
Rename:
Syntax:
Example :