Sai Nath has Published 32 Articles

What is the usage of oninput event in JavaScript?

Sai Nath

Sai Nath

Updated on 23-Jun-2020 09:06:13

When a value is added in an input box, then the oninput event occurs. You can try to run the following code to learn how to implement oninput event in JavaScript −Example           Write below:                            function inputFunc() {             var a = document.getElementById("newInput").value;             document.write("Typed: " + a);          }          

Match any string containing a sequence of N p's

Sai Nath

Sai Nath

Updated on 23-Jun-2020 08:33:12

To match any string containing a sequence of N p’s with JavaScript RegExp, use the p{N} Quantifier.ExampleYou can try to run the following code to match any string containing a sequence of N p’s −           JavaScript Regular Expression             ... Read More

How to return the "time" portion of the Date as a human-readable string.

Sai Nath

Sai Nath

Updated on 23-Jun-2020 08:00:07

To return the “time” portion of the Date as a human-readable string, use the toTimeString() method in JavaScript. This method returns the time portion of a Date object in the human-readable form.ExampleYou need to run the following code to return only the time portion of a Date −     ... Read More

How can we ENABLE AND DISABLE a particular MySQL event?

Sai Nath

Sai Nath

Updated on 22-Jun-2020 12:38:29

With the help of ALTER EVENT statement along with the ENABLE and DISABLE keyword, we can ENABLE and DISABLE the event. To illustrate it we are having the following example −Examplemysql> ALTER EVENT hello DISABLE; Query OK, 0 rows affected (0.00 sec)The above query will DISABLE the event named ‘Hello’ ... Read More

What is MySQL trigger and triggering events related to it?

Sai Nath

Sai Nath

Updated on 22-Jun-2020 11:42:04

Basically, MySQL trigger is a set of statements stored in the database catalog. This database object is always associated with a table that is defined to be activated when a particular kind of event occurs for that table. In other sense, we can say that MySQL trigger is a special ... Read More

How can we convert subqueries to LEFT JOIN?

Sai Nath

Sai Nath

Updated on 22-Jun-2020 10:55:57

To make it understand we are using the data from the following tables −mysql> Select * from customers; +-------------+----------+ | Customer_Id | Name     | +-------------+----------+ | 1           | Rahul    | | 2           | Yashpal  | | 3 ... Read More

What is the use of MySQL NULLIF() control flow function?

Sai Nath

Sai Nath

Updated on 22-Jun-2020 06:58:05

MySQL NULLIF() control flow function will return NULL if both the arguments are the same, otherwise, it returns the first argument.SyntaxNULLIF(expression1, expression2)Here if expression1 = expression2, NULL will be returned by NULLIF() otherwise expression1 will be returned. Following example will exhibit this −mysql> Select NULLIF('Ram', 'Ram'); +---------------------+ | NULLIF('Ram', 'Ram') ... Read More

What is the method with the help of which the hexadecimal value can be treated as a number?

Sai Nath

Sai Nath

Updated on 22-Jun-2020 05:26:48

For treating the hexadecimal value as a number, we can use the CAST(… AS UNSIGNED) function. Following example will demonstrate it −mysql> Select 0x54, CAST(0x54 AS UNSIGNED); +------+------------------------+ | 0x54 | CAST(0x54 AS UNSIGNED) | +------+------------------------+ | T    |                     84 | +------+------------------------+ 1 row in set (0.01 sec)

How can we apply COALESCE() function on a MySQL table’s data value?

Sai Nath

Sai Nath

Updated on 20-Jun-2020 12:58:40

If we want to apply COALESCE() function on a MySQL table’s data value then we need to use the name of the columns as the argument of this function. If there would be a NULL value in the first column then it will check for the next column and so ... Read More

How can we divide the result set returned by MySQL into groups?

Sai Nath

Sai Nath

Updated on 20-Jun-2020 06:36:49

It can be done by using GROUP BY clause in the SELECT statement. We can specify a column as grouping criteria with the help of GROUP BY clause. Due to the specified grouping criteria, rows with the same value in a particular column are considered as a single group. In ... Read More

Advertisements