Assume that we have a CSV file – “CarDetails.csv” in D drive. The contents of the file are as shown below.

A table “Car” is created successfully in PostgreSQL database with following CREATE Command.

CREATE TABLE Car

(

Model_ID numeric NOT NULL,

Model_Name character varying,

Manufacturer character varying,

Year_Of_Release numeric,

CONSTRAINT Car_pkey PRIMARY KEY (Model_ID)

)

If we want only the following data to be imported into Car table, what is the command to be executed?

COPY car(model_id,model_name,manufacturer) FROM 'D:\CarDetails.csv' DELIMITER ',' CSV HEADER;

COPY car FROM 'D:\CarDetails.csv' DELIMITER ',' CSV HEADER;

The given requirement cannot be met using COPY command

COPY car() FROM 'D:\CarDetails.csv' DELIMITER ',';

Verified Answer
Correct Option - c

To get all Infosys Certified PostgreSQL Administrator Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in