|
||||||||||||||||||||||||||||||||||||||||||||||||||
SQL: a brief overview
|
SQL command | Meaning | ||||||||||||||||||||||||
SELECT select * from table |
select all the keys/fields from the table | ||||||||||||||||||||||||
select Distribute from table | select only the field Distribute from the table | ||||||||||||||||||||||||
select * from table where Name is 'Butch Grewe' |
Select all keys/fields from table where the key/field Name = Butch Grewe | ||||||||||||||||||||||||
INSERT insert into table |
Insert into the table, the data entry having the following
key/field entries in order: Name = James Bond Street Address = 1 Eiffel Tower City = Paris State = France (huh???) Distribute = Spy Software |
||||||||||||||||||||||||
UPDATE update table set age=6 where Name='Butch Grewe' |
updates any records with the name 'Butch Grewe' to have the value of 6 for the field age. | ||||||||||||||||||||||||
DELETE delete from table where age=10 |
From table, deletes all records/rows that have the field of age with the value 10. | ||||||||||||||||||||||||
DESCRIBE describe table |
List all of the keys/fields that makeup this table. | ||||||||||||||||||||||||
the where clause....
|
|||||||||||||||||||||||||
the order by clause select * from table order by name |
Order alpahbetically in descending order the records in the table, by their value stored in the column name. |
Using SQL*Plus to create a Tablebelow are two examples of creating tables. The second specifies the tablespace the table should appear in, used if you have more than one tablespace. It also specifies the initial size, how it grows in size and minimum number of extents allocated for it. |
SQL> create table customer(
|
SQL> create table products(
|
Using SQL*Plus to alter a TableUse the SQL alter command to add or drop columns in a table after it has been created.
|
To add a column tax_exempt_id SQL>alter table customer
|
To drop the column sales SQL> alter table customer
|