Saturday, April 18, 2009

MySQL - அடிநிலை SQL Queries பாகம் -2

அனைத்து தகவல்களயும் பெற


mysql> SELECT * FROM INFO;
+------+-------------+------+------------+------+
| ID | NAME | AGE | DEPT | EXP |
+------+-------------+------+------------+------+
| 1 | KARTHIKEYAN | 23 | TECHNOLOGY | NULL |
| 2 | ARUN | 23 | INFY | 1 |
+------+-------------+------+------------+------+
2 rows in set (0.00 sec)


இப்பொழுது exp என்ற களத்தில் karthikeyan என்ற பெயருக்கு NULL என்று இருக்கிறது, இதை மாற்ற

mysql> UPDATE INFO SET EXP="1" WHERE ID=1;
Query OK, 1 row affected (0.03 sec)
Rows matched: 1 Changed: 1 Warnings: 0

மாற்றிய பிறகு.

mysql> SELECT * FROM INFO;
+------+-------------+------+------------+------+
| ID | NAME | AGE | DEPT | EXP |
+------+-------------+------+------------+------+
| 1 | KARTHIKEYAN | 23 | TECHNOLOGY | 1 |
| 2 | ARUN | 23 | INFY | 1 |
+------+-------------+------+------------+------+
2 rows in set (0.00 sec)

1 comment:

  1. "Ullen aiyaa". excellent. following it. your effort is making us proud !

    ReplyDelete