INSERT IGNORE INTO cmdev.dept

VALUES (500, 'MIS', DEFAAULT);

 

SELECT *

FROM cmdev.travel

WHERE empno = 7900 AND

            location = 'BOSTON'

 

INSERT INTO cmdev.travel

VALUES (7900, 'BOSTON',1);

 

UPDATE cmdev.travel

SET counter = counter +1

WHERE empno = 7900 AND

            location = 'BOSTON'

 

INSERT INTO cmdev.travel

VALUES (7900. 'BOSTON' , 1)

ON DUPLICATE KEY UPDATE counter = counter +1

 

 

INSERT INTO cmdev.dept

VALUES (50, 'MIS',DEFAULT)

 

INSERT  IGNORE INTO cmdev.dept

VALUES (50, 'MIS',DEFAULT)

 

REPLACE INTO cmdev.dept

VALUES (50, 'MIS',DEFAULT)

 

 

UPDATE cmdev.up

SET  salary = salary

ORDER BY salary

 

UPDATE cmdev.emp

SET salary = salary +100

Limit 3

 

DELETE FROM cmdev.emp

WHERE salary < 1500

 

DELETE FROM cmdev.emp

ORDER BY salary

 

DELETE FROM cmdev.emp

ORDER BY salary DESC

LIMIT 3

 

TRUNCATE TABLE cmdev.emp

 

Edit  preference  Sql  editor  > safe updates

 

START TRANSACTION;

DELETE FROM CMDEV.EMP WHERE EMPNO = 8002;

ROLLBACK;(回復)

COMMIT; (確認)

 

show varibles like 'datadir';

 

 

arrow
arrow
    文章標籤
    MySQL
    全站熱搜
    創作者介紹
    創作者 Joe&Nah生活筆記 的頭像
    Joe&Nah生活筆記

    Joe&Nah 生活筆記

    Joe&Nah生活筆記 發表在 痞客邦 留言(0) 人氣()