Formulas and Functions
The string operator (&) can be used in formulas to concatenate, or join, two or more strings or the contents of referenced cells. Wildcards (*,?,~) can be used in conditions to represent one or more characters. Concatenate strings or the contents of cells The & character is used to concatenate, or join, two or more strings or the contents of referenced cells. Some examples of the use of the concatenation operator are:
Use a wildcard to match any single character The ? character is used to match a single character in an expression that allows conditions. Some examples of the use of the wildcard character ? in matching patterns are:
Use a wildcard to match any number of characters The * character is used to match any number of characters, including none, in an expression that allows conditions. Some examples of the use of the wildcard character * in matching patterns are:
Match a wildcard character The ~ character is used to specify that the following character should be matched rather than used as a wildcard, in an expression that allows conditions. Some examples of using the character ~ in matching patterns are:
Use multiple wildcard characters in a condition The wildcard characters (? * ~) can be used together in expressions that allow conditions. Some examples are:
Please don’t include any personal information in your comment. Maximum character limit is 250. Thanks for your feedback. Section 2 Quiz Oracle Database Programming with SQL 1. Which of the following are true? (Choose Two)
Mark for Review 2. Which of the following would be returned by this SELECT statement: Mark for Review LAST_NAME SALARY LAST_NAME SALARY LAST_NAME SALARY All of the above 3. How can you write "not equal to" in the WHERE-clause? Mark for Review 4. Which query would give the following result? SELECT last_name, first_name, department_id SELECT last_name, first_name, department_id SELECT last_name, first_name, department_id SELECT last_name, first_name, department_id 5. Which SELECT statement will display both unique and non-unique combinations of the MANAGER_ID and DEPARTMENT_ID values from the EMPLOYEES table? Mark for Review 6. Where in a SQL statement can you not use arithmetic operators? Mark for Review 7. Which clause would you include in a SELECT statement to restrict the data returned to only the employees in department 10? Mark for Review 8. The concatenation operator ... Mark for Review 9. You need to display employees whose salary is in the range of 30000 and 50000. Which comparison operator should you use? Mark for Review 10. Which comparison condition would you use to select rows that match a character pattern? Mark for Review 11. Which of the following WHERE clauses would
not select the number 10? Mark for Review WHERE hours <= 10 12. When using the "LIKE" operator, the % and _ symbols can be used to do a pattern-matching, wild card search.
True or False? Mark for Review 13. Which of the following are examples of comparison operators used in the WHERE clause? Mark for Review 14. If you write queries using the BETWEEN operator, it does not matter in what order you enter the values, i.e. BETWEEN low value AND high value will give the same result as BETWEEN high value and low value. True or False? Mark for Review 15. The EMPLOYEES table contains these columns: You are writing a SELECT statement to retrieve the names of employees that have an email address. SELECT last_name||', '||first_name "Employee Name" Which WHERE clause should you use to complete this statement? Mark for Review 1. You need write a SELECT statement that should only return rows that contain 34, 46, or 48 for the DEPARTMENT_ID column. Which
operator should you use in the WHERE clause to compare the DEPARTMENT_ID column to this specific list of values? Mark for Review 2. You want to retrieve a list of customers whose last names begin with the letters 'Fr' .
Which keyword should you include in the WHERE clause of your SELECT statement to achieve the desired result? Mark for Review 3. Evaluate this SELECT statement: Which values would cause the logical condition to return TRUE? Mark for Review 4.
How can you write "not equal to" in the WHERE-clause? Mark for Review 5. Which of the following are true? (Choose Two) Mark for Review 6. If you write queries using the BETWEEN operator, it does not matter in what order you enter the values, i.e. BETWEEN low value AND high value will give the same result as BETWEEN high value and low value. True or False? Mark for Review 7. The EMPLOYEES table
contains these columns: You are writing a SELECT statement to retrieve the names of employees that have an email address. SELECT last_name||', '||first_name "Employee Name" Which WHERE clause should you use to complete this statement? Mark for Review 8. When using the "LIKE" operator, the % and _ symbols can be used to do a pattern-matching, wild card search. True or False? Mark for Review 9.
Which of the following WHERE clauses would not select the number 10? Mark for Review 10. Which two statements would select salaries that
are greater than or equal to 2500 and less than or equal to 3500? (Choose two) Mark for Review 11. You need to display employees with salaries that are at least 30000 or higher. Which comparison operator should you use? Mark for Review 12. The concatenation operator ... Mark for Review 13. You need to display employees whose salary is in the range of 30000 and 50000. Which comparison operator should you use? Mark for Review 14.
You need to display only unique combinations of the LAST_NAME and MANAGER_ID columns in the EMPLOYEES table. Which keyword should you include in the SELECT clause? Mark for Review 15. You need to display
employees whose salary is in the range of 10000 through 25000 for employees in department 50 . What does the WHERE clause look like? Mark for Review WHERE department_id = 50 WHERE department_id = 50 WHERE department_id > 50 AND salary BETWEEN 10000 AND 25000 Which operator is used to combine columns of character strings to other columns * ||?|| or concatenation operator is use to link columns or character strings.
When using the like condition to search for symbols which character can you use as a default escape option?You can specify backslash ( \ ) symbol or some other ASCII character as the default escape character by setting the DEFAULTESCCHAR value to that character.
Which clause would you include in a SELECT statement to restrict the data returned to only the employees in department 10?You can restrict the rows returned from the query by using the WHERE clause. A WHERE clause contains a condition that must be met, and it directly follows the FROM clause. In the example, the SELECT statement retrieves the name, job title, and department number of all employees whose job title is CLERK.
Which of the following are examples of comparison operators?Comparison operators — operators that compare values and return true or false . The operators include: > , < , >= , <= , === , and !== .
|