SQL Insert India 'State'

niranjanjee

SQL Insert India 'State'

9,593 Views
About the Author
Table
CREATE TABLE `state` (                                                                    
          `StateID` INT(11) NOT NULL AUTO_INCREMENT,                                              
          `CountryID` INT(11) NOT NULL,                                                           
          `StateName` VARCHAR(50) NOT NULL,                                                       
          `Notes` LONGTEXT,                                                                       
          `ChangedBy` VARCHAR(50) DEFAULT NULL,                                                   
          `ChangeDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,  
          PRIMARY KEY  (`StateID`)                                                                
        ) ENGINE=INNODB AUTO_INCREMENT=36 DEFAULT CHARSET=latin1


Insert

INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','ANDHRA PRADESH',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','ASSAM',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','ARUNACHAL PRADESH',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','GUJRAT',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','BIHAR',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','HARYANA',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','HIMACHAL PRADESH',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','JAMMU & KASHMIR',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','KARNATAKA',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','KERALA',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','MADHYA PRADESH',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','MAHARASHTRA',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','MANIPUR',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','MEGHALAYA',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','MIZORAM',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','NAGALAND',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','ORISSA',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','PUNJAB',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','RAJASTHAN',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','SIKKIM',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','TAMIL NADU',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','TRIPURA',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','UTTAR PRADESH',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','WEST BENGAL',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','DELHI',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','GOA',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','PONDICHERY',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','LAKSHDWEEP',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','DAMAN & DIU',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','DADRA & NAGAR',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','CHANDIGARH',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','ANDAMAN & NICOBAR',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','UTTARANCHAL',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','JHARKHAND',NULL,'Nieanjan',CURRENT_TIMESTAMP);
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','CHATTISGARH',NULL,'Nieanjan',CURRENT_TIMESTAMP);
niranjanjee 0 Newbie Poster

sql mysql table counter inser india state city

arun39 0 Newbie Poster
INSERT INTO States(CountryID,StateName) VALUES (1,'ANDHRA PRADESH');
INSERT INTO States(CountryID,StateName) VALUES (1,'ASSAM');
INSERT INTO States(CountryID,StateName) VALUES (1,'ARUNACHAL PRADESH');
INSERT INTO States(CountryID,StateName) VALUES (1,'GUJRAT');
INSERT INTO States(CountryID,StateName) VALUES (1,'BIHAR');
INSERT INTO States(CountryID,StateName) VALUES (1,'HARYANA');
INSERT INTO States(CountryID,StateName) VALUES (1,'HIMACHAL PRADESH');
INSERT INTO States(CountryID,StateName) VALUES (1,'JAMMU & KASHMIR');
INSERT INTO States(CountryID,StateName) VALUES (1,'KARNATAKA');
INSERT INTO States(CountryID,StateName) VALUES (1,'KERALA');
INSERT INTO States(CountryID,StateName) VALUES (1,'MADHYA PRADESH');
INSERT INTO States(CountryID,StateName) VALUES (1,'MAHARASHTRA');
INSERT INTO States(CountryID,StateName) VALUES (1,'MANIPUR');
INSERT INTO States(CountryID,StateName) VALUES (1,'MEGHALAYA');
INSERT INTO States(CountryID,StateName) VALUES (1,'MIZORAM');
INSERT INTO States(CountryID,StateName) VALUES (1,'NAGALAND');
INSERT INTO States(CountryID,StateName) VALUES (1,'ORISSA');
INSERT INTO States(CountryID,StateName) VALUES (1,'PUNJAB');
INSERT INTO States(CountryID,StateName) VALUES (1,'RAJASTHAN');
INSERT INTO States(CountryID,StateName) VALUES (1,'SIKKIM');
INSERT INTO States(CountryID,StateName) VALUES (1,'TAMIL NADU');
INSERT INTO States(CountryID,StateName) VALUES (1,'TRIPURA');
INSERT INTO States(CountryID,StateName) VALUES (1,'UTTAR PRADESH');
INSERT INTO States(CountryID,StateName) VALUES (1,'WEST BENGAL');
INSERT INTO States(CountryID,StateName) VALUES (1,'GOA');
INSERT INTO States(CountryID,StateName) VALUES (1,'PONDICHERY');
INSERT INTO States(CountryID,StateName) VALUES (1,'LAKSHDWEEP');
INSERT INTO States(CountryID,StateName) VALUES (1,'DAMAN & DIU');
INSERT INTO States(CountryID,StateName) VALUES (1,'DADRA & NAGAR');
INSERT INTO States(CountryID,StateName) VALUES (1,'CHANDIGARH');
INSERT INTO States(CountryID,StateName) VALUES (1,'ANDAMAN & NICOBAR');
INSERT INTO States(CountryID,StateName) VALUES (1,'UTTARANCHAL');
INSERT INTO States(CountryID,StateName) VALUES (1,'JHARKHAND');
INSERT INTO States(CountryID,StateName) VALUES (1,'CHATTISGARH');
INSERT INTO States(CountryID,StateName) VALUES (1,'ASSAM');
Bijesh M S 0 Newbie Poster
CREATE TABLE IF NOT EXISTS `tbl_state` (
`state_name` varchar(50) NOT NULL,
`country_id` int(11) NOT NULL,
PRIMARY KEY (`state_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=71 ;

INSERT



INSERT INTO `tbl_state` ( `state_name`,`country_id`,) VALUES
('ANDHRA PRADESH',1),
('ASSAM',1),
('ARUNACHAL PRADESH',1),
('BIHAR',1),
('GUJRAT',1),
('HARYANA',1),
('HIMACHAL PRADESH',1),
('JAMMU & KASHMIR',1),
('KARNATAKA',1),
('KERALA',1),
('MADHYA PRADESH',1),
('MAHARASHTRA',1),
('MANIPUR',1),
('MEGHALAYA',1),
('MIZORAM',1),
('NAGALAND',1),
('ORISSA',1),
('PUNJAB',1),
('RAJASTHAN',1),
('SIKKIM',1),
('TAMIL NADU',1),
('TRIPURA',1),
('UTTAR PRADESH',1),
('WEST BENGAL',1),
('DELHI',1),
('GOA',1),
('PONDICHERY',1),
('LAKSHDWEEP',1),
('DAMAN & DIU',1),
('DADRA & NAGAR',1),
('CHANDIGARH',1),
('ANDAMAN & NICOBAR',1),
('UTTARANCHAL',1),
('JHARKHAND',1),
('CHATTISGARH',1);
fadu 0 Newbie Poster

Click Here You Can also see the list of country names.

pclfw 23 Junior Poster

Wow, the Country list begins with ths USA and Canada, the rest of us have to be in alphabetical order.

Who'd thunk it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.