0
0
PostgreSQLquery~10 mins

Why CRUD operations are fundamental in PostgreSQL - Test Your Understanding

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

Complete the code to select all columns from the table named 'employees'.

PostgreSQL
SELECT [1] FROM employees;
Drag options to blanks, or click blank then click option'
A*
BALL
Ccolumns
Deverything
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ALL' instead of '*'
Writing 'columns' which is not valid SQL syntax
2fill in blank
medium

Complete the code to insert a new row into the 'employees' table with name 'John' and age 30.

PostgreSQL
INSERT INTO employees (name, age) VALUES ([1]);
Drag options to blanks, or click blank then click option'
A(John, 30)
BJohn, 30
C'John', '30'
D'John', 30
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around string values
Including extra parentheses inside VALUES
3fill in blank
hard

Fix the error in the code to update the age of employee 'John' to 31.

PostgreSQL
UPDATE employees SET age = [1] WHERE name = 'John';
Drag options to blanks, or click blank then click option'
A31
B"31"
C'31'
Dage + 1
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numbers in quotes
Using double quotes instead of single quotes for strings
4fill in blank
hard

Fill both blanks to delete rows where age is less than 25.

PostgreSQL
DELETE FROM employees WHERE age [1] [2];
Drag options to blanks, or click blank then click option'
A<
B>
C25
D30
Attempts:
3 left
💡 Hint
Common Mistakes
Using greater than symbol instead of less than
Using wrong number for comparison
5fill in blank
hard

Fill all three blanks to select the name and age of employees older than 40.

PostgreSQL
SELECT [1], [2] FROM employees WHERE age [3] 40;
Drag options to blanks, or click blank then click option'
Aname
Bage
C>
Dname, age
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting only one column
Using less than symbol instead of greater than