nerdexam
PostgreSQL_CE

PGCES-02 · Question #105

I would like to insert the contents of the text file users.dat into the table t1 using psql. Contents of text file users.dat: Definition of table t1: CREATE TABLE t1 (uname TEXT, pass TEXT, id…

The correct answer is A. \copy t1 FROM users.dat WITH DELIMITER ':'. PostgreSQL CE PGCES-02 Exam

Database Administration

Question

I would like to insert the contents of the text file users.dat into the table t1 using psql. Contents of text file users.dat:

Definition of table t1:

CREATE TABLE t1 (uname TEXT, pass TEXT, id INTEGER); Select the most appropriate input from those below.

Options

  • A\copy t1 FROM users.dat WITH DELIMITER ':'
  • B\copy t1 TO users.dat WITH DELIMITER ':'
  • CINSERT INTO t1 FROM file('users.dat');
  • DINSERT INTO t1SELECT uname, pass, id FROM file('users.dat');
  • E\insert t1 FROM users.dat WITH DELIMITER ':';

How the community answered

(51 responses)
  • A
    80% (41)
  • B
    2% (1)
  • C
    10% (5)
  • D
    6% (3)
  • E
    2% (1)

Explanation

PostgreSQL CE PGCES-02 Exam

Topics

#psql#COPY command#data import#delimiter

Community Discussion

No community discussion yet for this question.

Full PGCES-02 Practice