Q1
True / FalseIn MySQL, the SELECT INTO statement is used to copy data from one table into a new table.
The SELECT INTO statement in MySQL is indeed used to copy data from one table into a new table.
Q2
True / FalseThe SELECT INTO statement in MySQL can be used to create a new table with the same structure as the source table without copying any data.
In MySQL, SELECT INTO can be used to create a new table with the same structure as the source table but without copying the data by adding a WHERE 1=0 clause.
Q3
True / FalseIn MySQL, the SELECT INTO statement can only be used with SELECT *.
The SELECT INTO statement in MySQL can be used with any valid SELECT query, not just SELECT *.
Q4
True / FalseIn MySQL, you can use SELECT INTO to copy data into an existing table.
The SELECT INTO statement in MySQL creates a new table and cannot be used to copy data into an existing table.
Q5
True / FalseThe SELECT INTO statement in MySQL can be used with JOIN operations.
MySQL allows the SELECT INTO statement to include JOIN operations to create a new table with data from multiple tables.
Q6
True / FalseWhen using SELECT INTO in MySQL, the new table will automatically have the same indexes as the source table.
The SELECT INTO statement in MySQL does not automatically create indexes on the new table. Indexes must be created separately.
Q7
True / FalseIn MySQL, the SELECT INTO statement supports copying data along with all foreign key constraints from the source table.
MySQL’s SELECT INTO statement does not copy foreign key constraints from the source table. These must be added manually to the new table.
Q8
True / FalseThe SELECT INTO statement in MySQL can be used to copy data from multiple source tables into a single new table using subqueries.
MySQL allows the use of subqueries in the SELECT INTO statement to gather data from multiple source tables and insert it into a single new table.
Q9
True / FalseThe SELECT INTO OUTFILE statement in MySQL can be used with the JOIN clause to export data from multiple tables.
You can use SELECT INTO OUTFILE with complex queries, including those with JOIN clauses, to export data from multiple tables.
Q10
True / FalseUsing SELECT INTO OUTFILE in MySQL will automatically create the output directory if it does not exist.
MySQL does not create directories automatically. The specified directory must already exist, and the MySQL server must have write permissions for that directory.
Q25
Multiple ChoiceSelect the correct SQL statement to create a new table from an existing table with a calculated column using SELECT INTO.
SQL Code
SELECT product_id, price, price * quantity AS total_price
INTO sales_summary
FROM sales;
The SELECT INTO statement allows you to create a new table with a calculated column by using expressions like price * quantity.
Q28
Multiple ChoiceIdentify the correct SQL statement to create a new table with data from multiple tables using a JOIN and SELECT INTO.
SQL Code
SELECT o.order_id, o.order_date, c.customer_name
INTO order_customer_summary
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id;
The SELECT INTO statement can be used to create a new table with combined data from multiple tables using a JOIN operation.