Navicat inserts data into the table through the following code: INSERT statement: insert specific values (for example: INSERT INTO customers (name, email, phone) VALUES ('John Doe', 'john.doe@example.com ', '123-456-7890')) LOAD DATA INFILE statement: Load data from a file (for example: LOAD DATA INFILE 'data.csv' INTO TABLE transactions FIELDS TERMINATED BY ',
Insert data code into Navicat table
Navicat is a database management tool that provides some methods to insert data into the table. The following two are introduced. A commonly used code method:
1. INSERT statement
<code class="sql">INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...)</code>
For example, to insert a record into the table named "customers", you can execute the following code:
<code class="sql">INSERT INTO customers (name, email, phone) VALUES ('John Doe', 'john.doe@example.com', '123-456-7890')</code>
2. LOAD DATA INFILE statement
<code class="sql">LOAD DATA INFILE 'file_path' INTO TABLE table_name [FIELDS TERMINATED BY ',' | '|' | ' ' ]</code>
For example, you want to load data from a file named "data.csv" to a file named "transactions" table, you can execute the following code:
<code class="sql">LOAD DATA INFILE 'data.csv' INTO TABLE transactions FIELDS TERMINATED BY ','</code>
Note:
The above is the detailed content of How to insert data code into navicat table. For more information, please follow other related articles on the PHP Chinese website!