DDL --Data Definition language
DML -Data manipulation language
DDL --Data Definition language:-To create alter drop the table in or database we use data Definition language. The DDL command is used to built or modify the structure of a database or a object in that for the database object are any data that store and create in database For-tables, Rows and View
1.Create Command
2.Alter Command
3.Drop Command
4.Rename Command
1.Create Command:-To create database objects like table or modify database we used create command, The create statement is use to the create any types of objects.
Syntax-Create table table name (column 1 data type (size), Column 2 datatype (size) ).
Create table students (Id int , name varchar (255));
To view the create structure we use describe command " describe the table name.
2.Alter Command:-One there table or database create we required to change a structure of the database or class object we use into the alter command. The key constant can also change by using alter command
syntax-Alter table table name add column datatype (size);
Eg-Alter table study add int (4). To view the change that we mode to than we use describe command.
3.Drop Command:-This command can be use to remove database or database objects permentantly, Drop command use the delete table to structure as will as table data.
Syntax-Drop table table name. Drop table study.
4.Rename Command:-By using rename command we can rename any table object any time.
Syntax-Rename table table name to new table name. Alter table employee rename column age to solar.
DML -Data manipulation language:-Data manipulation language command is used to insert data into table. delete data from table update table data in DML there manly there command.
1.Insert Command
2.Delete Command
3.Update Command
1.Insert Command:-The insert command is use to add record in the exsistance table.
Syntax-Insert into table name (column) column 2 column 3 ) values (value1 value2 value3).
insert into employee (id, name) values (1,'xyz') 2 insert into employee values (1,'xyz').
To display a record we use select statement
Syntax-Select *from employee.
2.Delete Command:-The delete statement is use to delete one or more rows from the existing table
Syntax:-Delete from table name where
Delete from employee where id=2;
Where we not write where condition then. All the record of table in delete
3.Update Command:-The update statement is use to modify the record present in existing table.
Syntax:-Update table name set column name value where condition.
Update employee set id=3 where id=2.
When we not write where condition then all data of this column is update.
Comments
Post a Comment