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.
Suggested Answer: A
Get Premium PGCES-02 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
21 comments · newest first
LA
Latosha
1 month ago
A is straightforward. It fits the requirement perfectly.
LO
Louvenia
1 month ago
C and D don’t work; they don’t use the right command.
SH
Sherell
1 month ago
I agree, A is clear and uses the correct syntax.
NA
Nada
2 months ago
Option B is incorrect; it’s for exporting, not importing.
RU
Ruthann
2 months ago
Yeah, \copy is the right command for importing data.
BE
Ben
2 months ago
I think option A is the best choice.
YU
Yuki
2 months ago
E looks incorrect, \insert isn’t a command.
CA
Camellia
2 months ago
D is confusing, file() isn’t valid here.
KR
Kristeen
2 months ago
C doesn’t work, no FROM clause like that.
FR
Fredric
3 months ago
B is wrong, it’s for exporting.
AM
Amie
3 months ago
A makes sense, it’s for importing data.
MO
Monte
3 months ago
I think A is the right choice.
RE
Regenia
3 months ago
C seems off, not sure it works like that.
ME
Melissa
3 months ago
Definitely A, it’s the standard way to import data.
KA
Kasandra
4 months ago
Wait, can you really use file() in SQL?
DO
Dorothy
5 months ago
I think B is better, though.
GL
Glendora
5 months ago
A is the right choice!
LA
Lauran
6 months ago
I recall that using INSERT INTO with a file isn't standard SQL syntax, so options C and D seem wrong to me.
BE
Becky
6 months ago
I feel like option B is about exporting data, not importing, so it can't be the right choice here.
LE
Lea
6 months ago
I'm not entirely sure, but I remember practicing with \copy commands, and it seems like the right approach for importing data.
IN
In
6 months ago
I think option A is correct because it uses \copy to load data from a file into the table.