Basic Clauses

Rate: 1 Star Rate: 2 Stars Rate: 3 Stars Rate: 4 Stars Rate: 5 Stars

Love it / Hate it

Comments + Likes

Basic Clauses

Programming / Mysql

Basic Clauses

Describes how to perform basic actions using sql syntax
Basic Clauses was posted by listylister and has had 516 view(s) with an overall rating of 5
Chris's Profile Picture

Posted by listylister

Their Website http://www.phptutor...

This Tutorial has had 516 Views

INSERT Clause

INSERT INTO `tablename`('column2', 'column1', 'column4', 'column3') VALUES ('value2', 'value1', 'value4', 'value3');


Or you can insert data into the table using the following statement. The difference being that the database must be in the same order as the columns.

INSERT INTO `tablename` VALUES ('value1', 'value2', 'value3', 'value4');


UPDATE Clause

UPDATE `tablename` SET `column2` = 'newvalue2' WHERE `column1` = 'value1';


This basically updates a row in the table and tells the DBMS to set column2 to newvalue2 where a certain condition is true. In this case where column1 is equal to value1.
DELETE Clause

DELETE FROM `tablename` WHERE `column1` = 'value1';


This allows a user to delete a certain row in the table where a certain condition is true. Sometimes the LIMIT statement is also used with this to prevent loss of data should the syntax be incorrect.
These are the 3 most widely used SQL Statements and should be used with caution as to not cause inconsistencies in other records. Always double check your syntax before running it

created on 14/12/2009 @ 17:07, last updated on 30/05/2010 @ 16:00
aProject.info Twitter RSS

  Copyright PHPTutorials.co © 2009 - 2010