1, the meaning of NULL in Oracle:
NULL does not represent a zero value, nor does it indicate a space, is used to represent a value value in the character field.
2. Create a grammar for the table:
CREATE TABLE Name (
Column Name 1 Data Type [Length] [Default] [Constraint],
Column 2 Data Type [Length] [Default] [Constraint],
Column 3 Data Type [Length] [Default] [Constraint],
Column 4 Data Type [Length] [Default] [Constraint],
Column 5 Data Type [Length] [Default] [Constraint]
. . . . . . . . .
);
Su: Create Table Testable
Men_code char (5) Primary Key,
Men_name Varhcar2 (20) Not Null,
Men_sex char (3) Default 'Men',
MEN_AGE NUMBER);
3, copy table
CREATE TABLE new table name AS
Create Table NewcopyTable as Select * from testable;
or
Create Table NewcopyTable2 As SELECT Column1, Column2 from Testable
or/
Create Table NewcopyTalble2 (Column1, Column2) AS SELECT Column1, Column2 from Testable
4, the main key
A. Have the same name
B. The same field specification
C. The value of the foreign key is the subset of the primary key or from the primary key. It is impossible to have an auditory value and have no main value.
5. DistINCT is used to delete a duplicate row. Note: It is necessary to be in front of the SELECT and the first column name.
Such as: Select Distinct Column1, Column2 from Table1;
6, WHERE and condition predicate
IN, OR, AND, BETWEEN, NOT IN, NOT BETWEEN, LIKE
Is Null, IS Not NULL
Where LIK can only be used in combination with a char or varchar data type.
Wildcard: _ means any single character such as: _AT will match 'cat'rrat', etc., but do not match 'Rate'.
% Represents a sequence of multi-characters.
7. Exchange data Grout By and Having
GROUP BY is used with the polymer function. Conditional retrieval by Having.
The difference between Having and WHERE, for the former for screening. The latter is only used for rows.
Common polymeric function
Count: Display the number or column value generated by the query. NULL value is also the same statistics
MAX: The maximum value of the column is displayed.
MIN: The minimum of the column is displayed.
AVG: The average value of the selected value is given.
SUM: Displays the arithmetic mean for the selected value.
Such as: SELECT COUNT (Distinct Column1) from Books;
8, ASC descending (default)
DESC ascending
9. Internet file system (IFS)
IterMediaà multimedia data access
WEBDBà based development tools based on HTML
10. User-defined data types ---- Object Type
Create an intersection type
Create or report.part_type as object (
ID integer,
Description varchar2 (40),
ON_HAND INTEGER,
Report_Point Integer, Member Function Part_ID (Desc in varchar2) Return Integer,
MEMBER FUNCTION Parts_ON_HAND (Part_ID in Integer) Return Integer,
MEMBER Procedure Order_Part (Part_id in Integer, Quantity In Integer,
MEMBER Procedure Return_Part (Part_id in Integer, Quantity In Integer
);