Both CONCAT() and CONCAT_WS() functions are used to concatenate two or more strings but the basic difference between them is that CONCAT_WS() function can do the concatenation along with a separator between strings, whereas in CONCAT() function there is no concept of the separator. Other significance difference between them is that CONCAT()function returns NULL if any of the argument is NULL, whereas CONCAT_WS() function returns NULL if the separator is NULL.ExampleThe example below demonstrate the difference between CONCAT() and CONCAT_WS() function −mysql> Select CONCAT('Ram', 'is', 'a', 'good', 'student') AS 'Example of CONCAT()'; +---------------------+ | Example of CONCAT() | +---------------------+ ... Read More
The HTML DOM TableData colSpan property returns and modify the value of colspan attribute of a table in an HTML document.SyntaxFollowing is the syntax −1. Returning colSpanobject.colSpan2. Adding colSpanobject.colSpan = “number”Let us see an example of colSpan property −Example Live Demo body { color: #000; background: lightblue; height: 100vh; text-align: center; } table { margin: 2rem auto; width: 400px; } .btn { background: #db133a; border: none; height: ... Read More
As we know TEXT data objects are useful for storing long-form text strings. The different TEXT objects offer a range of storage space from 255 bytes to 4 Gb. The following table shows the storage of different kinds of TEXT data type −Type of BLOBMaximum amount of Data that can be storedOverheadTINYTEXTUp to 255 bytes1 byteTEXTUp to 64 Kb2 bytes MEDIUMTEXTUp to 16 Mb3 bytesLONGTEXTUp to 4 Gb4 bytes
TEXT data objects are useful for storing long-form text strings in a MySQL database. Followings are some point about TEXT data type −TEXT is the family of column type intended as high-capacity character storage.The actual TEXT column type is of four types-TINYTEXT, TEXT, MEDIUMTEXT and LONGTEXT.The four TEXT types are very similar to each other; the only difference is the maximum amount of data each can store.The smallest TEXT type, TINYTEXT shares the same character length as VARCHAR.TEXT values are treated as character strings.TEXT has character set other than binary character set and collation.The comparisons and sorting are based on ... Read More
As we know that BLOB is a binary large object that can hold a variable amount of data. The different TEXT objects offer a range of storage space from 255 bytes to 4 Gb. Following table shows the storage of different kinds of BLOB data type −Type of BLOBMaximum amount of Data that can be storedOverhead TINYBLOBUp to 255 bytes1 byteBLOBUp to 64 Kb2 bytes MEDIUMBLOBUp to 16 Mb3 bytes LONGBLOBUp to 4 Gb1 Bytes
In order to sort the words of a sentence in ascending order, we first need to split the sentence into words using space as the splitting point. For simplicity, we'll only be splitting on space and let the punctuation be there. We can use replace or regex to remove that as well.Once we split the sentence, we can sort the words lexicographically(like in a language dictionary) using either sort or sorted methods depending on whether we want to sort the array in place or sort it, then return a new array.In place sorting: when we want to sort the array/list ... Read More
We can use the output of CONCAT() function which is applied to the column/s of a MySQL with the column/s of another MySQL table. It can be done with the help of MySQL join.ExampleFor example, we have two table ‘Student’, having the details like id, Name, Last_name, Address and Subjects of the students, and ‘Remarks’, having the id and comments about the students. Now, the following query can combine CONCAT() function with another table column −mysql> Select * from remarks; +------+-------------+ | ID | Comment | +------+-------------+ | 1 | Good | | ... Read More
Given a character sequence and a defined document unit, tokenization is the task of chopping it up into pieces, called tokens, perhaps at the same time throwing away certain characters, such as punctuation. In the context of nltk and python, it is simply the process of putting each token in a list so that instead of iterating over each letter at a time, we can iterate over a token.For example, given the input string −Hi man, how have you been?We should get the output −['Hi', 'man', ', ', 'how', 'have', 'you', 'been', '?']We can tokenize this text using the word_tokenize ... Read More
As we know that wildcards are characters that help search data matching complex criteria. Wildcards are used in conjunction with LIKE comparison operator or NOT LIKE comparison operator. MySQL allows us to match the data, from the output of CONCAT() function, with the help of wildcard and comparison operators LIKE or NOT LIKE. An example from ‘Student’ table is given to make it clearer.Examplemysql> Select CONCAT(Name, ' ', Last_name) AS NAME from student Where CONCAT(Name, ' ', Last_Name) LIKE '%Kumar%'; +---------------+ | NAME | +---------------+ | Gaurav Kumar | | Harshit Kumar | +---------------+ ... Read More
In fiber optic communication, data is transmitted from the source to the destination by sending light pulses through optical fibers. It changes electrical pulses to light signals and vice versa for communication. Fiber optic communications are preferred when a huge amount of data needs to be transmitted across large distances.The process of communication using fiber optics has the following steps −Conversion of input electrical data to light signals : The data to be sent by the sender is in the form of electrical signals. These signals are converted to light pulses by the transmitter circuitry using a light source. A ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP