Java Reference
In-Depth Information
For example:
DROP TABLE Stock;
A.1.3
Adding Attributes
The required statement is ALTER TABLE . Syntax:
ALTER TABLE <TableName> ADD <fi eldName> <fi eldType>
{,<fi eldName> <fi eldType>};
For example:
ALTER TABLE Stock ADD supplier VARCHAR(30);
A.1.4
Removing Attributes
As above, the required statement is ALTER TABLE , but now with a DROP clause.
Syntax:
ALTER TABLE <TableName> DROP <fi eldName> {,<fi eldName>};
For example:
ALTER TABLE Stock DROP supplier;
A.2
DML Statements
These statements manipulate the rows (or 'tuples') of a database table. The primary
DML statements are:
SELECT
INSERT
DELETE
UPDATE
DELETE must be used in combination with a WHERE clause, which contains a
Boolean expression that specifi es which rows of the table are to be affected. SELECT
and UPDATE are also very often used with a WHERE clause for the same purpose,
but do not require one. If no WHERE clause is supplied, then the SELECT/UPDATE
acts upon all the rows of the specifi ed table. The next few sections give details and
examples relating to the four statements above.
Search WWH ::




Custom Search