Register   Login   About   Study   Enterprise   Share
Internet / AI Technology University (ITU/AITU)
Fast Login - available after registration







|

Top Links: >> 80. Technology >> Internet Technology Summit Program >> 2. Java and Databases >> 2.1. SQL
Current Topic: 2.1.1.SQL Query with wildcard characters and REPLACE function
You have a privilege to create a quiz (QnA) related to this subject and obtain creativity score...
2.1.1.SQL Query with wildcard characters and REPLACE function

SQL query that starts with the select keyword can include another powerful keyword like...

After the like we can provide the pattern of what we are looking.
In the pattern we can use SQL wildcard caracters.

SQL Wildcard Characters

SQL wildcards are used to search for data within a table.

With SQL, the wildcards are:

% A substitute for zero or more characters
_ A substitute for a single character
[charlist] Sets and ranges of characters to match

[^charlist]
Was it clear so far?

or
[!charlist] Matches only a character NOT specified within the brackets

The functions in SQL
There are many different functions embedded in the SQL language. While SQL is standardized across databases, the functions might have some differences.
I just provide one sample.
For example, we need to replace a piece of text in many records: in the column "City" or the table "Maps" we had for some names an extra character "\t".
This extra character (tab) must be replaced with a regular space " ".
In MySQL DB we would use the REPLACE function with the following syntax:

UPDATE Maps set City = REPLACE(City, '\t', ' ') WHERE INSTR(City, '\t') > 0

Similar functions can exist for other databases, but there is no guarantee that the function name and syntax will be exactly the same

Assignments:
1. Provide 2 samples of the select with each case.
2. Provide 3 QnA for the subject with good and bad samples
3. Research and provide 2 more samples of functions often used in SQL.
Email the samples and QnAs to dean@ituniversity.us
| Check Your Progress | Propose QnA | Have a question or comments for open discussion?

Have a suggestion? - shoot an email
Looking for something special? - Talk to me
Read: IT of the future: AI and Semantic Cloud Architecture | Fixing Education
Do you want to move from theory to practice and become a magician? Learn and work with us at Internet Technology University (ITU) - JavaSchool.com.

Technology that we offer and How this works: English | Spanish | Russian | French

Internet Technology University | JavaSchool.com | Copyrights © Since 1997 | All Rights Reserved
Patents: US10956676, US7032006, US7774751, US7966093, US8051026, US8863234
Including conversational semantic decision support systems (CSDS) and bringing us closer to The message from 2040
Privacy Policy