0
0
DynamoDBquery~20 mins

NoSQL vs relational database comparison in DynamoDB - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
NoSQL vs Relational Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Primary difference between NoSQL and relational databases

Which statement best describes the main difference between NoSQL databases like DynamoDB and traditional relational databases?

ARelational databases use structured query language (SQL) and fixed schemas, while NoSQL databases like DynamoDB use flexible schemas and key-value or document models.
BRelational databases are designed only for unstructured data, while NoSQL databases handle only structured data.
CNoSQL databases store data in tables with fixed schemas, while relational databases store data as flexible documents.
DNoSQL databases require complex joins for queries, whereas relational databases do not support joins.
Attempts:
2 left
💡 Hint

Think about how data is organized and queried in each type.

query_result
intermediate
2:00remaining
DynamoDB query output for a simple key lookup

Given a DynamoDB table named Users with primary key UserID, what will be the output of this query?

SELECT * FROM Users WHERE UserID = '123'

Assuming the table has one item with UserID '123' and attributes Name: 'Alice', Age: 30.

A[{"UserID": 123, "Name": "Alice", "Age": "30"}]
BSyntaxError: DynamoDB does not support SQL queries
C[]
D[{"UserID": "123", "Name": "Alice", "Age": 30}]
Attempts:
2 left
💡 Hint

Consider the data types and the query result format.

📝 Syntax
advanced
2:00remaining
Identify the error in this DynamoDB update expression

What error will this DynamoDB update expression cause?

UpdateExpression: "SET Age = Age + :val"
ExpressionAttributeValues: {":val": 1}
ASyntaxError: Missing colon in ExpressionAttributeValues key
BValidationException: Cannot increment a non-numeric attribute
CNo error; the update will increment Age by 1
DTypeError: ExpressionAttributeValues must be a list
Attempts:
2 left
💡 Hint

Think about the data type of the attribute being updated.

optimization
advanced
2:00remaining
Best practice for querying large datasets in DynamoDB

You want to retrieve all items from a DynamoDB table with millions of records. Which approach is best to optimize performance and cost?

AExport the entire table to S3 and query using SQL there.
BUse a Scan operation with no filters to get all items at once.
CUse Query operations with appropriate partition keys and apply filters to reduce data scanned.
DUse multiple parallel Scan operations without pagination.
Attempts:
2 left
💡 Hint

Consider how DynamoDB charges and performs scans vs queries.

🔧 Debug
expert
3:00remaining
Why does this relational join query fail on DynamoDB?

Consider this SQL query:

SELECT Orders.OrderID, Customers.Name FROM Orders JOIN Customers ON Orders.CustomerID = Customers.CustomerID;

Why will this query fail or not work as expected in DynamoDB?

ADynamoDB does not support JOIN operations natively; data must be denormalized or joined in application code.
BThe query syntax is invalid because DynamoDB requires double quotes around table names.
CDynamoDB requires a WHERE clause for all queries, so this query is incomplete.
DDynamoDB only supports queries on primary keys, so JOINs on foreign keys are disallowed.
Attempts:
2 left
💡 Hint

Think about how NoSQL databases handle relationships compared to relational databases.