0
0
SQLquery~20 mins

MySQL vs PostgreSQL vs SQL Server overview - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Database Master: MySQL vs PostgreSQL vs SQL Server
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Which database supports JSON data type natively?
Among MySQL, PostgreSQL, and SQL Server, which one supports JSON as a native data type allowing efficient querying and indexing?
ABoth MySQL and PostgreSQL support JSON natively.
BOnly PostgreSQL supports JSON natively.
COnly MySQL supports JSON natively.
DNone of them support JSON natively.
Attempts:
2 left
💡 Hint
Think about which databases allow storing JSON documents and querying them efficiently.
query_result
intermediate
2:00remaining
Identify the database by its default case sensitivity in string comparisons
Given the following behavior: String comparisons are case-insensitive by default in this database. Which database is it?
AMySQL
BPostgreSQL
CSQL Server
DAll three are case-sensitive by default
Attempts:
2 left
💡 Hint
Consider which database treats 'abc' and 'ABC' as equal by default in WHERE clauses.
📝 Syntax
advanced
2:00remaining
Which SQL syntax is valid for limiting query results in all three databases?
You want to limit the number of rows returned by a query to 5. Which of the following SQL statements will work correctly in MySQL, PostgreSQL, and SQL Server?
SQL
SELECT * FROM employees FETCH FIRST 5 ROWS ONLY;
ASELECT * FROM employees WHERE ROWNUM <= 5;
BSELECT TOP 5 * FROM employees;
CSELECT * FROM employees LIMIT 5;
DSELECT * FROM employees FETCH FIRST 5 ROWS ONLY;
Attempts:
2 left
💡 Hint
Think about the SQL standard syntax supported by all three databases.
optimization
advanced
2:00remaining
Which database supports partial indexes for query optimization?
Partial indexes allow indexing only a subset of rows in a table. Which database supports partial indexes natively?
APostgreSQL
BMySQL
CSQL Server
DNone of them support partial indexes
Attempts:
2 left
💡 Hint
Think about which database allows creating indexes with a WHERE clause.
🔧 Debug
expert
3:00remaining
Why does this SQL Server query fail but works in MySQL and PostgreSQL?
Consider this query: SELECT * FROM orders WHERE order_date = '2023-02-30'; It runs (with warning) in MySQL but fails in SQL Server and PostgreSQL. Why?
ASQL Server requires dates to be in ISO 8601 format only.
BMySQL automatically converts invalid dates to NULL silently.
CSQL Server strictly validates date literals and '2023-02-30' is invalid.
DMySQL treats all strings as valid dates regardless of format.
Attempts:
2 left
💡 Hint
Think about how each database handles invalid date values.