Multiple choice

Which of the following statements creates a copy of the table named source with the name target?

  1. Create table target (Select * from source)

  2. Create table target from source

  3. Create table target from source as select * from source

  4. Create table target as select * from source

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

To create a copy of an existing table we can use a select statement. The target table in this case will be automatically created. The select statement can be any valid select statement and can also include a where clause. The statement will create a table named target having the same data and structure of the source table. For example, if we want to create a copy of table A with the name B, but we we want to copy only those records where the value of mark column is more than 50. We can use the following statement Create table B as select * from A where marks>50 .