Date type date includes year, month, day, hour, minute, and second timestamp. This is an extended (timestamp) of the date data type of Oracle9i. The time of the date type is more accurate.
Date type date includes year, month, day, hour, minute, and second timestamp. This is an extended (timestamp) of the date data type of Oracle9i. The time of the date type is more accurate.
Date type
Date includes year, month, day, hour, minute, and second
Timestamp this is an extended (timestamp) timestamp of the date data type of Oracle9i.
Image Type
Blob binary data can store pictures and sounds for 4 GB
Oracle table management
Create a student TABLE statement
Create table student (
Xh number (4 ),
Xm varchar2 (20 ),
Sex char (2 ),
Birthday date,
Sal number (7,2)
);
Statement used to create a Tclass table
Create table Tclass (
Class_id number (2 ),
CName varchar2 (20)
);
Modify Table
Add a field class_id to the Student table.
Alter table student add (class_id number (2 ));
Modify a field xm in the Student table
Alter table student modify (xm varchar2 (30 ))
Delete a field xm in the Student table
Alter table student drop column xm;
How to change the default date in oracle (because the default date in oracle is "day month year ")
Alter session set nls_date_format = 'yy-mm-dd'
Use the is keyword to query null values
Select * from student where birthday is null;
Use the like keyword
Select * from student where xh like '% 100 ';
Update the birthday value of xh = 1234 in the student table to null.
Update student set birthday = null where xh = 1234
Delete data
Delete from student;
Oracle supports transaction rollback
Set savepoint;
Run the delete from student statement to delete all data in the table.
Then return to the point a we set.
Statement: rollback to;
After the execution, the data in the data table will return to the status before the deletion.
The structure of the table to be deleted using truncate is still in progress. No logs are written and the deleted records cannot be retrieved, but the deletion speed is fast.
Execution statement: truncate table student
Delete a table
Delete deletes the table structure. This table does not exist.