Inserting data into employee_data table with employee.dat file
On Windows
1. Move the file to c:\mysql\bin.
2. Make sure MySQL is running.
3. Issue the following command
mysql employees <employee.dat
On Linux
1. Migrate to the directory that contains the downloaded file.
2. Issue the following command
mysql employees <employee.dat -u username -p
3. Enter your password.
The INSERT SQL statement impregnates our table with data. Here is a general form of INSERT.
Code:
INSERT into table_name (column1, column2....)
values (value1, value2...);
where table_name is the name of the table into which we want to insert data; column1, column2 etc. are column names and value1, value2 etc. are values for the respective columns.
The following statement inserts the first record in employee_data table.
Code:
INSERT INTO employee_data
(f_name, l_name, title, age, yos, salary, perks, email)
values
("Manish", "Sharma", "CEO", 28, 4, 200000,
50000, "manish@bigne..com");
Bookmarks