Home » Oracle » 1z0-883 » Which two methods will restore data to the t1 table?
In a test database, you issue the SELECT … INTO OUTFILE statement to create a file with your t1 table data.
You then TRUNCATE this table to empty it.
Mysql> SELECT * INTO OUTFILE ‘/tmp/t1.sql’ from t1;
mysql> TRUNCATE t1;
Which two methods will restore data to the t1 table?
A. Mysql> LOAD DATA INFILE ‘/tmp/t1.sql’ INTO TABLE t1;
B. $ mysqladmin – u root – p – h localhost test – restore /tmp/t1.sql
C. $ mysql – u root – p – h localhost test < /tmp/t1.sql
D. $ mysqlimport – u root – p – h localhost test /tmp/t1.sql
E. Mysql> INSERT INTO t1 VALUES FROM ‘/tmp/t1.sql’;
Correct Answer: AD
Explanation/Reference:
A: SELECT … INTO OUTFILE is the complement of LOAD DATA INFILE.
D: You can also load data files by using the mysqlimport utility; it operates by sending a LOAD DATA INFILE statement to the server.
Note:
SELECT … INTO OUTFILE writes the selected rows to a file. Column and line terminators can be specified to produce a specific output format.
Reference: 13.2.8.1 SELECT … INTO Syntax; 13.2.6 LOAD DATA INFILE Syntax
Download Printable PDF. VALID exam to help you PASS.
|
|