Identifying SQL Functions
Which MySQL function is used to return the largest value from a set of arguments?
- GREATEST()
- MAXUMUM()
- HIGHEST()
- MOST()
- LARGER()
Selecting Minimum Values
Which function would you use in MySQL to get the smallest number from a list of values?
- LEAST()
- MINUM()
- LOWEST()
- SMALLEST()
- LESS()
Understanding SQL UPDATE
What is the purpose of the UPDATE statement in MySQL?
- To modify existing records in a table
- To create a new table
- To remove duplicate records
- To fetch data from tables
- To change the structure of a table
SQL Operator Usage
Which SQL keyword is used to ensure that a value never goes below zero in a calculation?
- GREATEST(value, 0)
- IFNULL(value, 0)
- MIN(value, 0)
- LEAST(value, 0)
- NULLIF(value, 0)
Column Reference Precision
In SQL, how do you refer to the value of the column free_sant_quartz within an UPDATE statement for the same table?
- By using free_sant_quartz directly
- By prefixing with update.free_sant_quartz
- By enclosing in quotes 'free_sant_quartz'
- By referencing as player.free_sant_quartz within the statement
- By using #free_sant_quartz
MySQL Data Types
If columns free_sant_quartz and paid_sant_quartz store whole numbers only, which data type is best to use?
- INT
- VARCHAR
- FLOAT
- DATETIME
- CHAR
SQL Subtraction Scenario
If a player has 15 free stones and 20 paid stones, and pays 30 stones, how many paid stones should remain after the transaction, following the specified rules?
- 5
- 10
- 20
- 0
- 15
Previewing Changes Without Updating
Which SQL statement lets you see the result of a calculation without actually modifying the table data?
- SELECT
- UPDATE
- MODIFY
- ALTER
- SHOW
Combining Multiple Columns
Which of the following computes the new value of paid_sant_quartz, using a deduction covered by free_sant_quartz first, then paid_sant_quartz?
- paid_sant_quartz + LEAST(free_sant_quartz - 30, 0)
- paid_sant_quartz - LEAST(free_sant_quartz, 30)
- paid_sant_quartz - LEAST(free_sant_quartz - 30, 0)
- paid_sant_quartz - GREATEST(free_sant_quartz, 30)
- paid_sant_quartz
Ensuring Atomic Operations
Why is it important to use a single UPDATE statement when decreasing free_sant_quartz and paid_sant_quartz during a transaction?
- To ensure data consistency and prevent incorrect deductions
- Because UPDATE statements must always be singular
- So that you can SELECT data afterwards
- To make the query faster by using JOINs
- Because multiple UPDATEs are not allowed in SQL