Sai Nath has Published 24 Articles

What is the usage of oninput event in JavaScript?

Sai Nath

Sai Nath

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

240 Views

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

94 Views

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

48 Views

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

2K+ Views

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

How can we convert subqueries to LEFT JOIN?

Sai Nath

Sai Nath

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

1K+ Views

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

122 Views

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

36 Views

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 divide the result set returned by MySQL into groups?

Sai Nath

Sai Nath

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

778 Views

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

How can I see the constraints which are applied to a table stored in another database then I am currently using?

Sai Nath

Sai Nath

Updated on 19-Jun-2020 13:32:38

44 Views

MySQL SHOW CREATE TABLE statement will provide us the constraints applied to a particular table along with some other details about that table stored in another database then I am currently using. Its syntax would be as follows −SyntaxSHOW CREATE TABLE db_name.table_name;Here table_name is the name of the table on ... Read More

What is the usage of onunload event in JavaScript?

Sai Nath

Sai Nath

Updated on 21-May-2020 07:51:06

256 Views

The unload event trigger when you unload (or refresh) a page. You can try to run the following code to learn how to implement onunload event in JavaScript.Example           Close the page and see what happens!       This event may give unexpected results.                function newFunc() {             alert("Thank you!");          }          

Advertisements