Professional Documents
Culture Documents
SQL - P2
SQL - P2
SQL - P2
SQL-02
1
Inserting Data
Inserting a record
SQL> INSERT INTO vehicleparts(cost, part_no, disc, price)
VALUES(100,'p223','honda engine',120.00);
4
Updating Multiple Rows in Multiple
Columns
SQL> UPDATE vehicleparts
SET
cost = 250.00,price=450
WHERE
part_no = 'P223';’;
5
Deleting data
• You cannot delete a part of rows.
• Instead, update the columns to NULL.
The WHERE clause determines which rows are to be
deleted.
If you forget the WHERE clause you will delete all
the rows.
6
Delete and limit
• Limit the number of row to delete.
• Must use the order by to clause to order records
before delete.
7
Deleting all records