Question

1. In SELECT statements, what are the comparison operands? Provide a SELECT example 2. In a...

1. In SELECT statements, what are the comparison operands? Provide a SELECT example 2. In a SELECT statement, what is a wildcard? Provide a SELECT example 3. In a SELECT statement how would you escape a wildcard? Provide a SELECT example 4. What does the NATURAL LANGUAGE mode in a where clause do? 5. What is an aggregate function in the SELECT? Provide a SELECT example 6. Could I create a new column in a SELECT clause? If yes, provide a SELECT example 7. How would I rename a column in the SELECT statement? 8. What is the difference between ALTER table and UPDATE? 9. How would I get the unique values in a column of a table? Provide a SELECT example 10. What are 2 ways I could insert rows to a table, using the SELECT statement.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

A comparison (or relational) operator is a mathematical symbol which is used to compare two values.

Comparison operators are used in conditions that compares one expression with another. The result of a comparison can be TRUE, FALSE, or UNKNOWN (an operator that has one or two NULL expressions returns UNKNOWN).

Example:

To get a comparison between two numbers from the DUAL table, the following SQL statement can be used :

SELECT 15>14 FROM dual;

2.

A wildcard character is used to substitute any other character(s) in a string.

Wildcard characters are used with the SQL LIKE operator. The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.

There are two wildcards used in conjunction with the LIKE operator:

  • % - The percent sign represents zero, one, or multiple characters
  • _ - The underscore represents a single character

Example:

The following SQL statement selects all customers with a City starting with "ber":

SELECT * FROM Customers
WHERE City LIKE 'ber%';

3. The purpose of the escape clause is to stop the wildcard characters (eg. % or _) from being considered as wildcards.

Example:

We can find all the records with a percentage sign in a part number by escaping the middle of three percentage signs with an equal sign:

SELECT * FROM partno WHERE part LIKE '%=%%' ESCAPE '=';

4. By default or with the IN NATURAL LANGUAGE MODE modifier, the MATCH() function performs a natural language search for a string against a text collection. A collection is a set of one or more columns included in a FULLTEXT index. The search string is given as the argument to AGAINST(). For each row in the table, MATCH() returns a relevance value; that is, a similarity measure between the search string and the text in that row in the columns named in the MATCH() list.

NOTE: As per Chegg policy, I am allowed to answer only 4 questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.

Add a comment
Know the answer?
Add Answer to:
1. In SELECT statements, what are the comparison operands? Provide a SELECT example 2. In a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT