Which of the following best describes the main purpose of a database?
Think about what you do when you want to keep information safe and find it quickly later.
A database is a system designed to store data in an organized way, making it easy to access, manage, and update.
Which of these is NOT a typical component of a database system?
Think about what parts help manage data versus what is used for browsing the internet.
A web browser is not part of a database system; it is used to access websites, not to manage or store data.
Given a table Users with columns id and name, what is the result of this query?
SELECT name FROM Users WHERE id = 2;
CREATE TABLE Users (id INT, name VARCHAR(20)); INSERT INTO Users VALUES (1, 'Alice'), (2, 'Bob'), (3, 'Charlie');
Look for the row where id equals 2 and return the name.
The query selects the name from the Users table where id is 2, which is 'Bob'.
Which option contains a syntax error in the SQL query?
SELECT * FROM Customers WHERE age > 30;
Check if the keyword FROM is used correctly.
Option A is missing the FROM keyword, causing a syntax error.
You have a large table Orders with millions of rows. Which query is likely to run faster?
Option 1: SELECT * FROM Orders WHERE order_date = '2023-01-01'; Option 2: SELECT * FROM Orders WHERE YEAR(order_date) = 2023 AND MONTH(order_date) = 1 AND DAY(order_date) = 1;
Think about how indexes work with functions on columns.
Option 1 can use an index on order_date directly, making it faster. Option 2 applies functions to the column, preventing index use.