Given following tables:
DOGS
Name   Age
---------
Snoopy 4
Benny  2

CATS
Name   Age
--------
Kleo   3
Linda  6

ANIMALS
Name   Age
---------
-     -
Name is of char(10) type and Age is of number(10) type.
Select all incorrect insert queries.
Explanation
First of all, we have to pay attention to types of values we are inserting in the table. Several examples try to insert values in wrong order.
Second of all, there is an INSERT INTO SELECT statement in SQL. It copies data from one table and inserts it into another one. It requires that data types in source and target tables match.
It has the following structure in general case:
INSERT INTO table1 (column1, column2, column3, ...)
SELECT column1, column2, column3, ...
FROM table2
WHERE condition;
but, as in regular INSERT statement, it allows omitting explicit columns specification in INSERT clause.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes