0
0
PostgreSQLquery~10 mins

PostgreSQL installation and setup - Interactive Code Practice

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

Complete the command to install PostgreSQL on Ubuntu.

PostgreSQL
sudo apt-get [1] postgresql
Drag options to blanks, or click blank then click option'
Aremove
Bupdate
Cinstall
Dupgrade
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'remove' instead of 'install' will uninstall packages.
Using 'update' only refreshes package lists, not install software.
2fill in blank
medium

Complete the command to start the PostgreSQL service.

PostgreSQL
sudo systemctl [1] postgresql
Drag options to blanks, or click blank then click option'
Astatus
Brestart
Cstop
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' will turn off the service.
Using 'status' only shows if the service is running.
3fill in blank
hard

Fix the error in the command to switch to the PostgreSQL user.

PostgreSQL
sudo [1] -i -u postgres
Drag options to blanks, or click blank then click option'
Alogin
Bsu
Cswitch
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'login' or 'switch' are not valid Linux commands for this purpose.
Using 'run' does not switch users.
4fill in blank
hard

Fill in the blank to create a new PostgreSQL database named 'mydb'.

PostgreSQL
createdb [1]
Drag options to blanks, or click blank then click option'
Amydb
Bpostgres
Ctemplate1
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'postgres' or 'template1' will not create the intended database.
5fill in blank
hard

Fill all three blanks to connect to the 'mydb' database as user 'postgres' on localhost.

PostgreSQL
psql -U postgres -[1] [2] -h [3]
Drag options to blanks, or click blank then click option'
AU
Bmydb
Clocalhost
Dd
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the flags or using wrong host names.
Omitting the database or user flags.