(E) structured query language SQL - 3

4. Update data

1) increase

The corresponding INSERT statement. Format INSERT INTO T [(A1, ..., Ak)] VALUES (C1, ..., Ck), where A represents the attribute table T, C for a constant, A may be the default, then C must be strictly defined according to the basic table T attribute provides a corresponding sequence of values, or a may be in any order, and may also be incomplete, i.e., several attributes can include only the base table. Such as inserting an enrollment record, student number is 20142480135 students enrolled in the course curriculum number MA302,

INSERT INTO SC (Sno,Cno)

VALUES ('20142480135','MA302');

Basic usage is simple, but with inserted = more advanced usage, that is inserted into the query results, that the above VALUES statement to a SELECT statement, SELECT select only the attributes you want to insert and attributes remain the same.

NOTE: When a SELECT statement appears constant, the value of each tuple in the query result will be to take the average value.

2) deleted

The corresponding DELETE statement. The basic format for the DELETE FROM T [WHERE <deletion condition>],

3) change

 

Guess you like

Origin www.cnblogs.com/lbrs/p/11330161.html