if we want to load data from a text file into a mysql table,
but the columns in table are 1st: code(int) and 2nd:
city(varchar), but in text file the format is 1st cityname
and then code separeted by delimeters. how to load?

Answers were Sorted based on User's Feedback



if we want to load data from a text file into a mysql table, but the columns in table are 1st: code..

Answer / vijay singh

LOAD DATA INFILE 'data.txt' INTO TABLE table2
FIELDS TERMINATED BY ',';

Is This Answer Correct ?    3 Yes 0 No

if we want to load data from a text file into a mysql table, but the columns in table are 1st: code..

Answer / vipul dalwala

LOAD DATA INFILE 'data.txt' INTO TABLE table_name
(city,code);

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MySQL Interview Questions

What is use command in mysql?

0 Answers  


Table - Products has number of products as below Productid ProductName 1 iPhone 2 iPad 3 BlackBerry Table - SalesPersonProduct has the below records Salespersonid productid S1 1 S1 2 S1 3 S2 1 S3 2 Write a SQL query that returns the total number of sold products

0 Answers  


What are the advantages of stored procedures, triggers, indexes?

5 Answers  


Is mysql written in c?

0 Answers  


How to delete a table.

0 Answers  






How do you change a password for an existing user via mysqladmin?

2 Answers  


Is sql similar to mysql?

0 Answers  


What ascii 31?

0 Answers  


How big is a blob mysql?

0 Answers  


What are the functions of mysql?

0 Answers  


What is database url for mysql?

0 Answers  


Can we store pdf files in mysql?

0 Answers  


Categories