0
0
Intro to Computingfundamentals~10 mins

Relational database basics in Intro to Computing - 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 all columns from the table named 'students'.

Intro to Computing
SELECT [1] FROM students;
Drag options to blanks, or click blank then click option'
Aeverything
B*
Ccolumns
Dall
Attempts:
3 left
💡 Hint
Common Mistakes
Using words like 'all' or 'columns' instead of the symbol *.
Leaving the blank empty.
2fill in blank
medium

Complete the code to filter records where the age is greater than 18.

Intro to Computing
SELECT * FROM users WHERE age [1] 18;
Drag options to blanks, or click blank then click option'
A>
B=
C<
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' which means exactly equal.
Using '<' which means less than.
3fill in blank
hard

Fix the error in the SQL statement to count the number of rows in the 'orders' table.

Intro to Computing
SELECT COUNT([1]) FROM orders;
Drag options to blanks, or click blank then click option'
Aorder_id
Brows
Call
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using words like 'all' or 'rows' which are not valid in COUNT.
Using a column name that might have NULL values.
4fill in blank
hard

Fill both blanks to create a table named 'employees' with columns 'id' as integer and 'name' as text.

Intro to Computing
CREATE TABLE employees (id [1], name [2]);
Drag options to blanks, or click blank then click option'
AINTEGER
BVARCHAR
CTEXT
DNUMBER
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'NUMBER' which is not standard SQL type here.
Using 'VARCHAR' without specifying length.
5fill in blank
hard

Fill all three blanks to select 'name' and 'age' from 'people' where 'age' is less than 30.

Intro to Computing
SELECT [1], [2] FROM people WHERE [3] < 30;
Drag options to blanks, or click blank then click option'
Aname
Bage
Dperson
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'person' which is not a column name.
Mixing up the order of columns.