Multiple choice technology mainframe

How to create LIKE table

  1. Using the CREATE parameter in a LIKE table statement

  2. Using the LIKE parameter

  3. Using the LIKE parameter in a CREATE table statement

  4. None of the above

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

A LIKE table is created using the LIKE parameter within a CREATE TABLE statement. The syntax is CREATE TABLE new-table LIKE existing-table, which copies the structure (column definitions) of an existing table. The LIKE parameter is specified within the CREATE statement itself, not as a separate parameter or standalone statement.

AI explanation

In SQL (DB2/Oracle-style syntax), a LIKE table is created by adding the LIKE clause inside a CREATE TABLE statement: CREATE TABLE new_table LIKE existing_table. This copies the column definitions (and sometimes indexes/constraints depending on the dialect) from the source table without copying data. 'Using the CREATE parameter in a LIKE table statement' reverses the syntax incorrectly — there is no standalone 'LIKE table statement'; LIKE is a clause within CREATE TABLE, not the other way around. 'Using the LIKE parameter' alone is too vague/incomplete since LIKE must appear specifically within a CREATE TABLE statement to have this meaning. 'None of the above' is wrong because option 3 correctly describes the syntax.