In Structured Query Language (SQL), wildcard characters (such as '%' and '_') are standardly used with which logical comparison operator to perform pattern matching on string columns?
Ch 29: SQL Aggregate Functions & GROUP BY
Technical study of aggregated reporting, comparing WHERE clause filtering (row-level) with HAVING clause filtering (group-level), and NULL handling.
9 Questions9 MCQs0 Short Questions0 Long Questions
SEMESTER PASS
CS403 - Database Management Systems Examination Practice
Timed practice exam simulation for CS403 - Database Management Systems.
Showing 1 – 9 of 9 Questions
Page 1 of 1
When constructing database pattern matching queries using the LIKE operator, which wildcard character allows matching any sequence of characters of any length, including a length of zero?
For a logistics tracking system with a 'Packages' table, write an SQL query to retrieve distinct records of delivered packages where the transport vehicle is NOT a 'Van', the shipping date falls within the inclusive range of '2024-03-01' and '2024-03-29', and the delivery status is strictly 'Delivered'. The final output must be sorted by the delivery date in descending chronological order.
True or False: The SQL 'IN' function helps reduce the need to use multiple 'AND' conditions in a query predicate.
True or False: The SQL 'IN' function helps reduce the need to use multiple 'AND' conditions.
Consider a customer database table named 'CUST' containing the attributes: 'customer_id', 'first_name', 'last_name', and 'phone'. Which of the following SQL statements correctly retrieves all information of the customers whose last name is 'ALI'?
Consider an 'Executives' database table containing the following records:
- ExecID: 101, Name: 'Zafar', Department: 'IT', Salary: 85000
- ExecID: 102, Name: 'Ali', Department: 'Marketing', Salary: 72000
- ExecID: 103, Name: 'Nasir', Department: 'Finance', Salary: 95000
- ExecID: 104, Name: 'Latif', Department: 'IT', Salary: 64000
What will be the exact result set output of executing the following SQL query?
SELECT Name, Salary FROM Executives WHERE Department = 'IT' AND Salary > 70000 ORDER BY Salary DESC;
Analyze the following SQL query targeting a table named 'Persons':
```sql
SELECT * FROM Persons
WHERE Firstname LIKE '% da %';
```
Explain what this statement returns and describe the pattern-matching behavior of the wildcard operators.
Given two tables, 'Active_Students' and 'Honors_List', both containing union-compatible schemas with the columns: 'stId', 'stName', and 'cgpa'. Write an SQL query using the INTERSECT operator to retrieve only those students who appear in both tables.