USE hongzh1
SHOW TABLES
CREATE TABLE namelist(num INT,age INT,NAME VARCHAR(10),salary DOUBLE,yearSalary DOUBLE,departmentName VARCHAR(10));
DESC namelist;
SELECT *FROM namelist;
INSERT INTO namelist (num,age,NAME,salary,yearSalary,departmentName)VALUES(1,24,'洪泽海',20000,400000,'光学组');
INSERT INTO namelist (num,age,NAME,salary,yearSalary,departmentName)VALUES(2,24,'evan',20000,400000,'材料组');
INSERT INTO namelist (num,age,NAME,salary,yearSalary,departmentName)VALUES(3,24,'mark',20000,400000,'光学组');
INSERT INTO namelist (num,age,NAME,salary,yearSalary,departmentName)VALUES(4,24,'bill',20000,400000,'电子组');
ALTER TABLE namelist ADD asd INT;
ALTER TABLE namelist CHANGE asd dsa INT;
ALTER TABLE namelist MODIFY dsa VARCHAR(10);
ALTER TABLE namelist DROP dsa;
UPDATE namelist SET NAME = '猪崽宝宝' WHERE NAME = '洪泽海';
DELETE FROM namelist WHERE NAME ='猪崽宝宝';
UPDATE namelist SET age = 27 WHERE id = 3;
ALTER TABLE namelist CHANGE num id INT;
sql语句1:基础增删改查
最新推荐文章于 2024-07-15 10:51:55 发布