Sat Apr 07, 2007 6:55 pm
INSERT INTO <tablename> [<column list>]
VALUES (<expression>{[,<expression>]})
Insert new STAFF memeber into the STAFF table with the following properties:
STAFF id=1 and STAFF SALARY= 2000
INSERT INTO STAFF VALUES (1,'ALI',2000,NULL);
INSERT INTO STAFF VALUES (2,'EHAB',1000,NULL);
INSERT INTO STAFF VALUES (3,'MARWA',3000,NULL);
INSERT INTO STAFF VALUES (4,'ALI',4000,NULL);
UPDATE <tablename>
SET <column name>=<expression>[,<column name>=<expression>]
[WHERE <Condition>]
UPDATE STAFF
SET STAFF_SALARY=STAFF_SALARY * 1.05;
UPDATE STAFF
SET STAFF_NAME='AHMED'
WHERE STAFF_ID=1;
UPDATE STAFF
SET STAFF_NAME='ALI',
STAFF_SALARY = 3000
WHERE STAFF_ID = 1;
DELETE
FROM <table name>
[WHERE <Condition>]
DELETE FROM STAFF;
DELETE FROM STAFF
WHERE STAFF_ID=2;
DELETE from STAFF
WHERE STAFF_ID=1
OR STAFF_ID=2;
DELETE from STAFF
WHERE STAFF_ID IN (1,2);
SELECT <Column list>
FROM <table names>
[WHERE <Condition>]
Select * from STAFF;
SELECT STAFF_ID , STAFF_NAME
FROM STAFF;
SELECT *
FROM STAFF
WHERE STAFF_NAME LIKE '%H%';
SELECT DISTINCT STAFF_NAME
From STAFF;
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.