Clarification of Answer by
willie-ga
on
10 Oct 2002 01:24 PDT
I just realised that your question could be read two ways. Do you want
to know how to do other SQL commands on the table?
If so, here are the basics
To create the empty table use CREATE
eg
CREATE TABLE FAMILY
(name VARCHAR(15),
address VARCHAR(1),
ID# SMALLINT(3),
fam VARCHAR(2)
);
To populate your table, do this for each row, changing the data
eg
INSERT INTO FAMILY
VALUES ('Bob','A', 1,);
or
INSERT INTO FAMILY
VALUES ('Mary','A',2,'1');
(NOTE that to insert a null, you just leave a blank after the ,
To update the table use the UPDATE command
eg to change Marks address to B
UPDATE FAMILY
SET Address = 'B'
WHERE name='Mark';
To get data from table use SELECT
eg
SELECT name, fam FROM table
WHERE fam is NOT NULL;
Would return
Mary, 1
Vickie, 3
When you've used the statements (called DML - Database Manipulation
Language statements) such as INSERT, UPDATE and DELETE during a SQL
session you must 'finalise' the changes you've made to the table by
using the COMMIT command:
An example of your SQL session might look like this
DELETE FROM FAMILY
WHERE name='Joe';
1 row deleted
COMMIT;
commit completed
Hope I'm not teaching granny to suck eggs.
The tutorial I referred to in the answer goes through it all nice and
easily
and theres a nice neat overview of the basic commands at
http://www.dragonlee.co.uk/sql02.html
Willie