Adding record in MySQL

Syntax : INSERT INTO namatable (field1,field2,..,fieldn) VALUES (value1,value2,..,valuen);

Example : INSERT INTO Barang (KdBarang,NmBarang,Satuan,Harga) VALUES (‘B0001’,’Rejoice 250 ml’,’Botol’,12000);

In addition to the above, can also directly give the value (value) without specifying any field that will be added data, but we must know the sequence of table fields that will be added data.
Example:
INSERT INTO Barang VALUES (‘B0002’,’Rejoice sachet’,’Sachet’,500);

No comments:

Post a Comment