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 INTEGER
Sign in or unlock PGCES-02 to reveal the answer and full explanation for question #105. The question stem and answer options stay visible for context.
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 ':';
Unlock PGCES-02 to see the answer
You've previewed enough free PGCES-02 questions. Unlock PGCES-02 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#psql#COPY command#data import#delimiter