0% found this document useful (0 votes)
1 views2 pages

day4-1

For learning

Uploaded by

divyamudiraj2396
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views2 pages

day4-1

For learning

Uploaded by

divyamudiraj2396
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

alter command:- is used to modify the structure of the table.

a)add a column
b)drop a column
c)rename a column
d)modify the datatype.

patient --> patient_id,patient_name,patient_age,patient_mob,

add a new column -->patient_doj

syntax:- alter table tablename add columname datatype;

ex:- alter table patient add patient_doj date;

dropping a column -->patient_mob

syntax:- alter table tablename drop column columname;

ex:- alter table patient drop column patient_mob;

renaming a column -->patient_age --->pat_aged

syntax:- alter table tablename rename column oldname to newname;

ex:- alter table patient rename column patient_age to pat_aged;

modify the datatype:-


-------------------
syntax:- alter table tablename modify columname datatype;

ex:- alter table patient modify patient_id varchar2(5);

renaming a table
----------------
syntax:- rename oldname to newname;

patient--->active_patients

ex:- rename patient to active_patients;

dropping a table:- is used to drop the table

syntax:- drop table tablename;

ex:- drop table active_patients;

truncate a table:- is used to remove the records permanently.

syntax:- truncate table tablename;

dml(data manipulation language):-


--------------------------------
-is used to manipulate the data inside the table.

insert
update
delete
merge(manam matalakundam joins tharuvatha) meeku arthamuvuthunda.

Mudi

insert command:- is used to insert the record inside the table.

GURTHU pettukondi --> all dml commands act on the memory

syntax:- insert into tablename(columns) values(Value1,value2,......valuen);

update command:- is used to modify the data

syntax:- update tablename set column=value [where condition];

delete command:- is used to delete the records.

syntax:- delete from tablename [where condition];

note:- if we skip the where condition all the records will be deleted.

tcl(transaction control language):-

commit---save
rollback---undo

difference between truncate and delete.


truncate delete

1)ddl command dml command


2)specific deletion is not possible specific deletion is possible.
3)delete all records at once deletes row by row.
4)perment deletion temporary deletion
5)rollback is not possible rollback is possible
6)faster slower

drl(data retrieval language):-


----------------------------
select command:- is used to fetch data from the table.

You might also like