0
0
PostgreSQLquery~10 mins

Integer types (smallint, integer, bigint) 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 create a table with a column that stores small integer values.

PostgreSQL
CREATE TABLE numbers (id [1]);
Drag options to blanks, or click blank then click option'
Asmallint
Bvarchar
Ctext
Dboolean
Attempts:
3 left
💡 Hint
Common Mistakes
Using varchar or text for numbers.
Using boolean instead of an integer type.
2fill in blank
medium

Complete the code to create a table with a column that stores standard integer values.

PostgreSQL
CREATE TABLE employees (employee_id [1] PRIMARY KEY);
Drag options to blanks, or click blank then click option'
Asmallint
Binteger
Ctext
Dboolean
Attempts:
3 left
💡 Hint
Common Mistakes
Using smallint when larger numbers are needed.
Using boolean or text instead of an integer type.
3fill in blank
hard

Fix the error in the code to create a table with a column that stores very large integer values.

PostgreSQL
CREATE TABLE big_numbers (big_id [1]);
Drag options to blanks, or click blank then click option'
Ainteger
Bsmallint
Cbigint
Dtext
Attempts:
3 left
💡 Hint
Common Mistakes
Using integer or smallint for very large numbers.
Using text instead of an integer type.
4fill in blank
hard

Fill both blanks to create a table with two columns: one for small integers and one for big integers.

PostgreSQL
CREATE TABLE mixed_numbers (small_col [1], big_col [2]);
Drag options to blanks, or click blank then click option'
Asmallint
Binteger
Cbigint
Dtext
Attempts:
3 left
💡 Hint
Common Mistakes
Using text instead of integer types.
Mixing up smallint and bigint.
5fill in blank
hard

Fill all three blanks to create a table with columns for smallint, integer, and bigint types.

PostgreSQL
CREATE TABLE all_int_types (col1 [1], col2 [2], col3 [3]);
Drag options to blanks, or click blank then click option'
Asmallint
Binteger
Cbigint
Dtext
Attempts:
3 left
💡 Hint
Common Mistakes
Using text instead of integer types.
Mixing the order of integer types.