0
0
DynamoDBquery~10 mins

Basic scan operation in DynamoDB - Interactive Code Practice

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

Complete the code to scan all items from the DynamoDB table named 'Products'.

DynamoDB
response = dynamodb_client.[1](TableName='Products')
Drag options to blanks, or click blank then click option'
Ascan
Bquery
Cget_item
Dput_item
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'query' instead of 'scan' will not return all items.
Using 'get_item' only fetches one item by key.
2fill in blank
medium

Complete the code to scan the 'Users' table and get only the 'UserId' and 'Email' attributes.

DynamoDB
response = dynamodb_client.scan(TableName='Users', ProjectionExpression='[1]')
Drag options to blanks, or click blank then click option'
AUserId; Email
BUserId Email
C'UserId, Email'
DUserId, Email
Attempts:
3 left
💡 Hint
Common Mistakes
Using spaces instead of commas between attribute names.
Adding quotes inside the string causing syntax errors.
3fill in blank
hard

Fix the error in the scan call to filter items where 'Status' equals 'Active'.

DynamoDB
response = dynamodb_client.scan(TableName='Orders', FilterExpression='[1] = :status', ExpressionAttributeValues={':status': {'S': 'Active'}})
Drag options to blanks, or click blank then click option'
A#Status
Bstatus
CStatus
D:Status
Attempts:
3 left
💡 Hint
Common Mistakes
Using ':Status' which is for values, not attribute names.
Using '#Status' without defining ExpressionAttributeNames.
4fill in blank
hard

Fill both blanks to scan the 'Employees' table and return only employees with 'Age' greater than 30.

DynamoDB
response = dynamodb_client.scan(TableName='Employees', FilterExpression='[1] > :age', ExpressionAttributeValues={':age': {'N': '[2]'}})
Drag options to blanks, or click blank then click option'
AAge
B30
CAgeGroup
D25
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong attribute name like 'AgeGroup'.
Using incorrect number value in ExpressionAttributeValues.
5fill in blank
hard

Fill all three blanks to scan the 'Books' table, projecting 'Title' and 'Author', and filtering books published after 2010.

DynamoDB
response = dynamodb_client.scan(TableName='Books', ProjectionExpression='[1], [2]', FilterExpression='[3] > :year', ExpressionAttributeValues={':year': {'N': '2010'}})
Drag options to blanks, or click blank then click option'
ATitle
BAuthor
CPublishedYear
DYear
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong attribute names in projection or filter.
Mixing attribute names with values.