SQL Database Function Operations Core Quiz
A 50-question quiz covering string, numeric, and date functions used in data querying, formatting, comparisons, and expression manipulation.
Question 1
When cleaning user-entered names, a team wants to remove extra spaces at the beginning and end of each input while keeping internal spacing unchanged. Which type of function performs this boundary trimming?
Question 2
A product catalog contains descriptions in mixed casing. If the goal is to standardize all text for case-insensitive searches, which function helps convert the entire value into a consistent lower-case format?
Question 3
A finance dashboard rounds transaction amounts to the nearest whole number for summary charts. Which category of function performs this kind of precision adjustment?
Question 4
A timestamp field contains both date and time. A report needs only the calendar date portion for grouping. Which type of function extracts specific components from a date?
Question 5
A log system records numeric values such as temperature. Negative values indicate reversed readings, and the team wants the magnitude regardless of sign. Which numeric function gets the pure magnitude of a number?
Question 6
A dataset includes long customer messages, but a quick preview field shows only the first 20 characters. Which concept allows extracting a portion of a string?
Question 7
A business rule marks a record late if the date difference between today and the due date exceeds zero. Which category of functions helps compute the number of days between two dates?
Question 8
A shipping application extracts only the month from a full timestamp to summarize shipments per month. Which date concept accomplishes this?
Question 9
A user wants to verify that a number always rounds upward, regardless of decimal value. Which category of numeric function ensures an upward adjustment?
Question 10
A table stores numbers with varying decimal precision. A reporting interface requires all numbers formatted to exactly two decimals. Which concept supports adjusting the number of decimal places?
Question 11
A system stores birthdates, and the analyst needs only the year of birth for demographic grouping. Which category of function isolates this piece?
Question 12
A developer converts product names to uppercase for standardized display. Which function transforms characters to upper-case form?
Question 13
A dataset uses LEFT and RIGHT padding to align text visually. Which kind of function removes padding characters only from the left side?
Question 14
A scheduling tool calculates how many months lie between two chosen dates. Which concept helps compute interval differences between dates?
Question 15
A system calculates total price by adding a base price and a percentage surcharge. Which category of function supports numeric expression evaluation?
Question 16
A validator checks whether a numeric input contains fractional digits. Which concept helps round a decimal down to its nearest integer to test for whole-number equality?
Question 17
A workflow app marks tasks overdue if the current date exceeds the due date. Which function retrieves today’s date for such comparisons?
Question 18
A customer service system truncates text to create short display previews. Which function family supports cutting text down to a fixed number of characters?
Question 19
A system stores prices as decimals, but some calculations require removing all decimal digits without rounding. Which numeric concept performs such truncation?
Question 20
A system extracts the day of the week from sale timestamps to analyze weekday trends. Which function category accomplishes this?
Question 21
A shop measures discount percentages but wants to enforce that calculated values always round to exactly one decimal place. Which rounding behavior handles this?
Question 22
A marketing tool ensures phone numbers appear without leading zeros. Which string concept removes specific characters from the left side?
Question 23
An app calculates interest based on the absolute rate difference between two loan types. Which numeric function provides this magnitude?
Question 24
A query groups events by month. Which extracted element is required to support this grouping?
Question 25
A data transformation step standardizes text by removing trailing spaces. Which function handles right-side trimming?
Question 26
This query attempts to standardize product names. What adjustment does it perform?
SELECT UPPER(name) FROM products;Question 27
What value is returned when applying this substring extraction?
SELECT SUBSTRING('Dashboard', 1, 4);Question 28
This calculation adjusts decimal precision. What result does it produce?
SELECT ROUND(45.678, 2);Question 29
This date extraction retrieves a specific component of the timestamp. What does it return?
SELECT EXTRACT(YEAR FROM DATE '2024-03-10');Question 30
What is the result of applying this trimming function on padded text?
SELECT LTRIM(' Apple');Question 31
What value comes from this numeric expression combining absolute value and rounding?
SELECT ROUND(ABS(-12.49));Question 32
What date part is extracted here?
SELECT EXTRACT(MONTH FROM TIMESTAMP '2023-11-25 14:00');Question 33
When trimming trailing characters, what does this return?
SELECT RTRIM('Test ');Question 34
This DATE function shifts a date by an interval. What is returned?
SELECT DATE '2023-01-01' + INTERVAL '10' DAY;Question 35
This calculation rounds a number downward. What is returned?
SELECT FLOOR(9.8);Question 36
What substring is extracted here?
SELECT SUBSTRING('Learning', 3, 4);Question 37
What numeric adjustment occurs here?
SELECT CEILING(4.01);Question 38
This query extracts a weekday number. What does it return?
SELECT EXTRACT(DOW FROM DATE '2023-06-10');Question 39
How does TRIM behave in this example?
SELECT TRIM('***Hello***' FROM '*');Question 40
What happens in this date difference calculation?
SELECT DATE '2023-05-20' - DATE '2023-05-15';Question 41
How is this text simplified?
SELECT LOWER('WELCOME');Question 42
Which date part is extracted here?
SELECT EXTRACT(DAY FROM DATE '2024-02-29');Question 43
What numeric result does this expression produce?
SELECT TRUNC(7.99);Question 44
What substring is obtained here?
SELECT SUBSTRING('Computer', 5);Question 45
This calculation adjusts a numeric field upward. What does it produce?
SELECT CEILING(12.3);Question 46
What happens in this TRIM usage?
SELECT TRIM(BOTH 'x' FROM 'xxxCorexxx');Question 47
How does this date calculation behave?
SELECT CURRENT_DATE + INTERVAL '1 MONTH';Question 48
What substring is returned here?
SELECT SUBSTRING('Marketing', 1, 3);Question 49
What numeric behavior occurs here?
SELECT ABS(-100);Question 50
What day-of-month value does this extraction return?
SELECT EXTRACT(DAY FROM DATE '2023-12-05');