SQL Expressions

24 important questions on SQL Expressions

Can expressions be used in ORDER BY statements? and GROUP BY statements?

Yes, in both

How are exact values internally represented in MySQL?

Integer of decimal (30 decimal digits)

How are approximate values internally represented in MySQL?

FLOAT or DOUBLE (15 decimal digits)
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart

What is the standard string quoting character in MySQL?

Single quote

What is the second function of || besides logical OR?

Concatination character, if PIPES_AS_CONCAT mode is enabled

What determines the equality of two non-binary strings?

The character set and collation

What determines the equality of two binary strings?

The (numeric) byte values

Name three parts of a SELECT statement that are affected by collation and character set?

ORDER BY, GROUP BY, DISTINCT

What is the MySQL default character set?

latin1

What is the default MySQL collation?

latin1_swedisch_ci

What functions returns the amount of characters in a string?

CHAR_LENGTH()

What function returns the byte length of a string?

LENGTH()

When is a LIKE statement a binary comparison?

When one of the sides is binary

How do you change the escape character of a LIKE statement?

LIKE '<pattern>' ESCAPE '<escapechar>'

How can you check for NULL values?

IS NULL or IS NOT NULL

Are null values distinct?

No

Is NULL IN(list) valid with NULL in the list?

No

What is ROUND(-2.85E01)?

-28

What function returns if a numeric value is positive or negative?

SIGN()

What does the CONCAT_WS function do?

Concatinate with a specific separator

What is the difference between CONCAT and CONCAT_WS?

CONCAT_WS ignores null values
CONCAT always returns null when null in list

Why should you not use the PASSWORD() function?

Is for internal use, may change over time

Name three encryption methods that provide two way encryption?

ENCODE, DES_ENCRYPT, AES_ENCRYPT

What happens when a comment starts with /*!

MySQL executes the comment

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo