0
0
Intro to Computingfundamentals~10 mins

SQL as the query language 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 SQL query to select all columns from the table named 'employees'.

Intro to Computing
SELECT [1] FROM employees;
Drag options to blanks, or click blank then click option'
AALL
BCOLUMNS
C*
DEVERYTHING
Attempts:
3 left
💡 Hint
Common Mistakes
Using words like ALL or COLUMNS instead of *
Forgetting to specify columns or *
2fill in blank
medium

Complete the SQL query to select the 'name' column from the 'students' table where the 'age' is greater than 18.

Intro to Computing
SELECT name FROM students 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 = instead of >
Using < which means less than
3fill in blank
hard

Fix the error in the SQL query 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'
A*
Border_id
Call
Drows
Attempts:
3 left
💡 Hint
Common Mistakes
Using a column name instead of *
Using invalid keywords like 'all' or 'rows'
4fill in blank
hard

Fill all blanks to select the 'product' and 'price' columns from 'inventory' where 'price' is less than 100.

Intro to Computing
SELECT [1], [2] FROM inventory WHERE price [3] 100;
Drag options to blanks, or click blank then click option'
Aproduct
Bprice
C<
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping column names
Using > instead of < for price condition
5fill in blank
hard

Fill all three blanks to create a dictionary-like result with keys as uppercase 'category' and values as 'count' of items where count is greater than 10.

Intro to Computing
SELECT [1] AS category_upper, [2] FROM products WHERE [3] > 10;
Drag options to blanks, or click blank then click option'
AUPPER(category)
Bcount
Dcategory
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'category' instead of 'count' for the filter
Not using UPPER() for uppercase