Magazine
 
MySQL

1. The insert statement is used to add new
row to a table.

INSERT INTO <table name>
VALUES (<value 1>, ... <value n>);

Example:

INSERT INTO STUDENT VALUES (1001,
‘Ram’)
;

The inserted values must match the table structure exactly in the number of attributes and the data type of each attribute. Character type values are always enclosed in single quotes; number values are never in quotes; date values are often (but not always) in the
format ‘yyyy-mm-dd’ (for example, ‘2006-11- 30’).

2. The update statement is used to change values that are already in a table.

UPDATE <table name>
SET <attribute> = <expression>
WHERE <condition>;

Example:

UPDATE STUDENT SET Name = ‘Amar’
WHERE StudID=1001;

The update expression can be a constant, any computed value, or even the result of a SELECT statement that returns a single row and a single column.

3. The delete statement deletes row(s) from a table.

DELETE FROM <table name>
WHERE <condition>;
Example:
DELETE FROM STUDENT WHERE
StudID=1001;

If the WHERE clause is omitted, then every row of the table is deleted that matches with the specified condition.

 

4. The SELECT statement is used to form queries for extracting information out of the database.

SELECT <attribute>, …..,
<attribute n> FROM <table name>;

Example:

SELECT StudID, Name FROM STUDENT;

Apart from these statements, some statements are also used to control the transaction made by DML statements. The commands used for this purpose are called Transaction Control (TCL) statements. It allows statements to be grouped together into logical transactions. Some commands of TCL are:

  • COMMIT - save work done.
  • SAVEPOINT - identify a point in a
    transaction to which you can later roll
    back.
  • ROLLBACK - restore database to
    original since the last COMMIT.

In this lesson you will read about the configuration of MySQL. The MySQL server configuration normally started during installation process.

MySQL server configuration wizard window

To start the configuration wizard of MySQL, click the MySQL server instance configuration wizard entry that is available in the MySQL Server 5.0 section of the window’s start menu. Another way to start the configuration wizard, open the MySQLInstanceConfig.exe file directly from bin directory of your MySQL installation. The MySQL server configuration wizard sets configuration variables values in my.ini file in the installation directory for the MySQL server.

—defaults-file=”C:\Program
Files\MySQL\MySQL Server 5.0\my.ini”
Path “C:\Program Files\MySQL\MySQL Server
5.0” is installation directory of MySQL server.

     
Dec 2007 | Java Jazz Up | 21
 
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 , 82 ,

Download PDF