MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

MySQL

Insert in MySQL
Previous Home Next

This command is use to insert the data into database according to the define manner or the sequence in which the table column is define in which we are inserting the data.

In the below SQL query we have "aid" which is a "FOREIGN KEY" from its corresponding table "studinfo" and we haven't define Null value, so its column value needs to insert in each row value insertion.

Syntax

INSERT INTO 
Tablename(col1, col2, col3) 
VALUES(val1, val2, val3)

 

Example

INSERT INTO 				//insert values into studadr
studadr(said, aid, blck, hno, 
street, locatn, state, country)		//studadr is a tablename
VALUES (413,110,'f',40,'jhilmil',
'south','pune','Australia');		//ordering order is given

Example

INSERT INTO 				//insert some values into studadr
studadr (aid, blck, hno, 
street, locatn, state, country)		//studadr is a tablename
VALUES (112,'s',410,
'whashington','central','DC','America');

Note: In the above code we have skip "said" value ,which is AUTO_INCREMENT and PRIMARY KEY also. so the value we want to insert gives the column name along with its values

Example

INSERT INTO 			//insert some values into studadr
studadr (aid, blck, hno, street, locatn, state)
VALUES (112,'s',410,'whashington','central','DC','America');

Note: In the above code we have left the country name whose DEFALUT value "India" is given which will come automaticaly.

Previous Home Next