Data insert, modify, delete operations for 1.MySQL database tables SQL syntax format:
1 CREATE DATABASEdb0504;2 3 Usedb0504;4 5 CREATE TABLEStudent (6SnoVARCHAR(Ten) not NULL UNIQUE PRIMARY KEY,7SnameVARCHAR( -) not NULL,8Ssex enum ('male','female') not NULL DEFAULT 'male',9 Sbirth Date,TenSclassVARCHAR(Ten), OneZnoCHAR(4) A)DEFAULTCharSet=gb2312; - #添加操作 - INSERT intoStudent the VALUES('2012010713','Ding warm','female','1993-9-9','Internet of Things 12-1','z002'); - - INSERT intoStudent (Sno,sname,ssex,sbirth,sclass,zno) - VALUES('2011010503','Kong Chao','male','1993-9-19','Automation 11-1','z006'); + - INSERT intostudent (Sno, sname, Ssex, ZnO) + VALUES('2011010521','Han Mei','female','z006'); A at INSERT intostudent (sname, ZnO, Sno) - VALUES('Han Mei 2','z006','2011010522'); - - INSERT intoStudentVALUES -('2011010501','Kong Chao 1','male','1993-9-19','Automation 11-1','z006'); -('2011010505','Kong Chao 2','male','1993-9-19','Automation 11-1','z006'); in('2011010504','Kong Chao 3','male','1993-9-19','Automation 11-1','z006'); -('2011010505','Kong Chao 4','male','1993-9-19','Automation 11-1','z006'); to #修改操作 + UPDATEStudent - SETSname= 'Zhang San', Sbirth= '1993-6-19' the WHERESname= 'Ding warm'; * $ UPDATEStudentSETZno= Left(ZnO,3);Panax Notoginseng #删除操作 - Delete fromStudent the whereSname='Zhang San'; + A #清空表操作 the truncatestudent; #高效 + Delete fromstudent; - $ SELECT * fromStudent
Inserting: Insert
Modified: Update
Remove: Delete
2. Example development
MySQL database table data Insert, modify, delete operation and instance application