Posted by: ptilley125 on: March 23, 2009
SELECT * FROM table WHERE clause – grabs all information from the specified table based on the clause that is defined. For example if it the table contained students that hadn’t paid their tuition, a query can generate a list of people to remind (SELECT * FROM student WHERE payment tuition;)
INSERT into table VALUES() – adds data to the specified row. Use the term NULL to leave a field blank, separate each value using commas, and place any character value in quotes.
CREATE VIEW name AS SELECT… – Saves a query that can be recalled quickly and easily any time in the future.
UPDATE table SET value = new value WHERE clause – Change a specific value in a table when you want to make updates.
CREATE SEQUENCE name [START WITH number] [INCREMENT BY number] [CACHE | NO CACHE] – A sequence automatically creates the next number in a defined series. Using the INSERT command, use the sequence_name.NEXTVAL to allow a unique value. Use .CURRVAL after using .NEXTVAL to define the same number (i.e. a foreign key). Anything in brackets is an optional value to be defined.
Remember that all SQL lines should be ended by a semicolon (;).