0
0
PostgreSQLquery~10 mins

CURRENT_DATE, CURRENT_TIMESTAMP, NOW() in PostgreSQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select the current date in PostgreSQL.

PostgreSQL
SELECT [1];
Drag options to blanks, or click blank then click option'
ANOW()
BCURRENT_DATE
CCURRENT_TIMESTAMP
DGETDATE()
Attempts:
3 left
💡 Hint
Common Mistakes
Using NOW() or CURRENT_TIMESTAMP returns date and time, not just date.
Using GETDATE() is not valid in PostgreSQL.
2fill in blank
medium

Complete the code to select the current date and time in PostgreSQL.

PostgreSQL
SELECT [1];
Drag options to blanks, or click blank then click option'
ACURRENT_DATE
BSYSDATE
CNOW()
DGETDATE()
Attempts:
3 left
💡 Hint
Common Mistakes
Using CURRENT_DATE returns only the date, not time.
GETDATE() and SYSDATE are not PostgreSQL functions.
3fill in blank
hard

Fix the error in the code to select the current timestamp in PostgreSQL.

PostgreSQL
SELECT [1];
Drag options to blanks, or click blank then click option'
ASYSDATE
BCURRENT_DATE
CGETDATE()
DCURRENT_TIMESTAMP
Attempts:
3 left
💡 Hint
Common Mistakes
Using GETDATE() or SYSDATE causes errors in PostgreSQL.
Using CURRENT_DATE returns only the date, not timestamp.
4fill in blank
hard

Fill both blanks to select the current date and current timestamp in PostgreSQL.

PostgreSQL
SELECT [1] AS today, [2] AS now_time;
Drag options to blanks, or click blank then click option'
ACURRENT_DATE
BNOW()
CCURRENT_TIMESTAMP
DGETDATE()
Attempts:
3 left
💡 Hint
Common Mistakes
Using NOW() in the first blank returns date and time, not just date.
Using GETDATE() is invalid in PostgreSQL.
5fill in blank
hard

Fill all three blanks to select current date, current timestamp, and current time in PostgreSQL.

PostgreSQL
SELECT [1] AS today, [2] AS now_time, [3] AS just_time;
Drag options to blanks, or click blank then click option'
ACURRENT_DATE
BCURRENT_TIMESTAMP
CCURRENT_TIME
DNOW()
Attempts:
3 left
💡 Hint
Common Mistakes
Using NOW() for time only is incorrect because it returns date and time.
Mixing up CURRENT_TIME and CURRENT_TIMESTAMP.