Q21. Select all records where FirstName is "John"?
To retrieve all columns for records where `FirstName` equals 'John', combine `SELECT *` with a `WHERE` equality filter: ```sql SELECT * FROM Customers WHERE FirstName = '...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (118 available).
To retrieve all columns for records where `FirstName` equals 'John', combine `SELECT *` with a `WHERE` equality filter: ```sql SELECT * FROM Customers WHERE FirstName = '...
`AND` requires ALL conditions to be true. `OR` requires ANY to be true. Use parentheses to control precedence — `AND` binds tighter than `OR`. ```sql -- Without parenthes...
Relational SQL engines provide a rich set of comparison operators evaluated in `WHERE` and `HAVING` clauses: | Operator | Meaning | Example | | :--- | :--- | :--- | | `=`...
To retrieve records that satisfy multiple simultaneous criteria, use the **`AND`** logical conjunction operator: ```sql SELECT * FROM Customers WHERE FirstName = 'John' A...
```sql -- MySQL SELECT * FROM tbl ORDER BY RAND() LIMIT 10; -- PostgreSQL SELECT * FROM tbl ORDER BY RANDOM() LIMIT 10; -- SQL Server SELECT TOP 10 * FROM tbl ORDER BY NE...
If `price` is `NULL`, `ISNULL(price, 50)` evaluates to **`50`**. ### Function Nuances Across Databases: 1. **SQL Server**: `ISNULL(check_expression, replacement_value)` r...
`LIKE` with wildcards `%` (zero or more chars) and `_` (single char). ```sql WHERE name LIKE 'A%' -- starts with A WHERE name LIKE '%a%' -- contains a WHERE name LIKE '_a...
To find records where a text column begins with a specific letter or prefix, use the **`LIKE`** operator with the `%` wildcard: ```sql SELECT * FROM Students WHERE FirstN...
The **`BETWEEN`** operator selects values within an inclusive range (numbers, text strings, or dates): ```sql SELECT product_id, name, price FROM products WHERE price BET...
```sql SELECT * FROM Sales WHERE Date BETWEEN '2017-12-01' AND '2018-01-01'; ``` Use ISO-8601 format (`YYYY-MM-DD`) to avoid locale issues.
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.