SQL Database Function Operations Core Quiz

SQL Database
0 Passed
0% acceptance

A 50-question quiz covering string, numeric, and date functions used in data querying, formatting, comparisons, and expression manipulation.

50 Questions
~100 minutes
1

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?

A
TRIM
B
REPLACE
C
CONCAT
D
UPPER
2

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?

A
LOWER
B
UPPER
C
INITCAP
D
COUNT
3

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?

A
ROUND
B
SUBSTRING
C
LENGTH
D
CURRENT_DATE
4

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?

A
DATE EXTRACT
B
CONCAT
C
LTRIM
D
ABS
5

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?

A
ABS
B
FLOOR
C
ROUND
D
WIDTH_BUCKET
6

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?

A
Substring extraction
B
Numeric rounding
C
Date arithmetic
D
Aggregate functions
7

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?

A
Date arithmetic functions
B
String trimming functions
C
Concatenation functions
D
Case conversion functions
8

Question 8

A shipping application extracts only the month from a full timestamp to summarize shipments per month. Which date concept accomplishes this?

A
Extracting a date part
B
Replacing characters
C
Rounding values
D
Left trimming text
9

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?

A
CEILING
B
FLOOR
C
ROUND
D
ABS
10

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?

A
Rounding to a fixed scale
B
Substring slicing
C
Case conversion
D
Whitespace trimming
11

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?

A
Year extraction
B
Case conversion
C
Absolute value calculation
D
Rounding
12

Question 12

A developer converts product names to uppercase for standardized display. Which function transforms characters to upper-case form?

A
UPPER
B
LOWER
C
SUBSTRING
D
EXTRACT
13

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?

A
LTRIM
B
RTRIM
C
TRIM BOTH
D
REPLACE
14

Question 14

A scheduling tool calculates how many months lie between two chosen dates. Which concept helps compute interval differences between dates?

A
Date interval calculation
B
Substring slicing
C
String padding
D
Numeric rounding
15

Question 15

A system calculates total price by adding a base price and a percentage surcharge. Which category of function supports numeric expression evaluation?

A
Arithmetic functions
B
Date extraction
C
String case functions
D
Concatenation
16

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?

A
FLOOR
B
CEILING
C
ROUND
D
ABS
17

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?

A
CURRENT_DATE
B
SUBSTRING
C
UPPER
D
ABS
18

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?

A
Substring functions
B
Rounding functions
C
Date part functions
D
Numeric comparison functions
19

Question 19

A system stores prices as decimals, but some calculations require removing all decimal digits without rounding. Which numeric concept performs such truncation?

A
TRUNC
B
ROUND
C
CEILING
D
LTRIM
20

Question 20

A system extracts the day of the week from sale timestamps to analyze weekday trends. Which function category accomplishes this?

A
Date part extraction
B
Numeric rounding
C
Case conversion
D
Trimming
21

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?

A
ROUND with precision
B
FLOOR
C
CEILING
D
ABS
22

Question 22

A marketing tool ensures phone numbers appear without leading zeros. Which string concept removes specific characters from the left side?

A
LTRIM
B
RTRIM
C
UPPER
D
CONCAT
23

Question 23

An app calculates interest based on the absolute rate difference between two loan types. Which numeric function provides this magnitude?

A
ABS
B
CEILING
C
ROUND
D
LTRIM
24

Question 24

A query groups events by month. Which extracted element is required to support this grouping?

A
Month value from the date
B
Absolute numeric value
C
Rounded integer
D
Trimmed text
25

Question 25

A data transformation step standardizes text by removing trailing spaces. Which function handles right-side trimming?

A
RTRIM
B
LTRIM
C
SUBSTRING
D
ROUND
26

Question 26

This query attempts to standardize product names. What adjustment does it perform?

sql
SELECT UPPER(name) FROM products;
A
Converts all product names to uppercase
B
Removes leading spaces
C
Extracts first letters only
D
Formats as title case
27

Question 27

What value is returned when applying this substring extraction?

sql
SELECT SUBSTRING('Dashboard', 1, 4);
A
Dash
B
board
C
shbo
D
Dashboard
28

Question 28

This calculation adjusts decimal precision. What result does it produce?

sql
SELECT ROUND(45.678, 2);
A
45.68
B
45.67
C
46
D
45
29

Question 29

This date extraction retrieves a specific component of the timestamp. What does it return?

sql
SELECT EXTRACT(YEAR FROM DATE '2024-03-10');
A
2024
B
3
C
10
D
20
30

Question 30

What is the result of applying this trimming function on padded text?

sql
SELECT LTRIM('   Apple');
A
Apple
B
Apple
C
Apple
D
App
31

Question 31

What value comes from this numeric expression combining absolute value and rounding?

sql
SELECT ROUND(ABS(-12.49));
A
12
B
13
C
12.49
D
11
32

Question 32

What date part is extracted here?

sql
SELECT EXTRACT(MONTH FROM TIMESTAMP '2023-11-25 14:00');
A
11
B
2023
C
25
D
14
33

Question 33

When trimming trailing characters, what does this return?

sql
SELECT RTRIM('Test   ');
A
Test
B
Test
C
Test
D
Tes
34

Question 34

This DATE function shifts a date by an interval. What is returned?

sql
SELECT DATE '2023-01-01' + INTERVAL '10' DAY;
A
2023-01-11
B
2023-01-10
C
2023-01-20
D
2022-12-22
35

Question 35

This calculation rounds a number downward. What is returned?

sql
SELECT FLOOR(9.8);
A
9
B
10
C
8
D
9.0
36

Question 36

What substring is extracted here?

sql
SELECT SUBSTRING('Learning', 3, 4);
A
arn
B
earn
C
rnin
D
arni
37

Question 37

What numeric adjustment occurs here?

sql
SELECT CEILING(4.01);
A
5
B
4
C
4.01
D
6
38

Question 38

This query extracts a weekday number. What does it return?

sql
SELECT EXTRACT(DOW FROM DATE '2023-06-10');
A
6
B
10
C
2023
D
0
39

Question 39

How does TRIM behave in this example?

sql
SELECT TRIM('***Hello***' FROM '*');
A
Hello
B
***Hello***
C
*Hello*
D
Hello***
40

Question 40

What happens in this date difference calculation?

sql
SELECT DATE '2023-05-20' - DATE '2023-05-15';
A
5
B
20
C
15
D
0
41

Question 41

How is this text simplified?

sql
SELECT LOWER('WELCOME');
A
welcome
B
WELCOME
C
Welcome
D
weLCOMe
42

Question 42

Which date part is extracted here?

sql
SELECT EXTRACT(DAY FROM DATE '2024-02-29');
A
29
B
2
C
2024
D
1
43

Question 43

What numeric result does this expression produce?

sql
SELECT TRUNC(7.99);
A
7
B
8
C
7.9
D
0.99
44

Question 44

What substring is obtained here?

sql
SELECT SUBSTRING('Computer', 5);
A
uter
B
Comp
C
C
D
Comput
45

Question 45

This calculation adjusts a numeric field upward. What does it produce?

sql
SELECT CEILING(12.3);
A
13
B
12
C
12.3
D
14
46

Question 46

What happens in this TRIM usage?

sql
SELECT TRIM(BOTH 'x' FROM 'xxxCorexxx');
A
Core
B
xxxCorexxx
C
Corexxx
D
xxxCore
47

Question 47

How does this date calculation behave?

sql
SELECT CURRENT_DATE + INTERVAL '1 MONTH';
A
Returns today plus one month
B
Returns only the current month number
C
Returns the start of the current month
D
Returns today minus one month
48

Question 48

What substring is returned here?

sql
SELECT SUBSTRING('Marketing', 1, 3);
A
Mar
B
ket
C
Marketing
D
ark
49

Question 49

What numeric behavior occurs here?

sql
SELECT ABS(-100);
A
100
B
-100
C
0
D
1
50

Question 50

What day-of-month value does this extraction return?

sql
SELECT EXTRACT(DAY FROM DATE '2023-12-05');
A
5
B
12
C
2023
D
1

QUIZZES IN SQL Database