Register Login
Internet / AI Technology University (ITU/AITU)





|

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? Highlight the text in question Or

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
Questions and Answers (QnA): QnA1 | QnA2 | QnA3 | QnA4 | QnA5 | QnA6 | QnA7
We offer a fun way to share your experience and be rewarded.
You create a puzzle - quiz with a good question and several answers, one correct and several wrong ones.
The question as well as answers can include text, links, video.
This is your creation, completely up to your taste, humor, and of course your knowledge.
If there is an existing quiz above, you need first to solve the puzzles and evaluate the quality (at the bottom of every quiz).
After finishing the existing quiz you will be able to create your own. The best puzzles will be rewarded!
We invite you to create your own questions and answers (QnA) to increase your rank and win the Top Creativity Prize!

Topic Graph | 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 AI
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