Monica Mona has Published 112 Answers

How to show the index of the selected option in a dropdown list with JavaScript?

Monica Mona
Published on 26-Feb-2018 08:53:31
To show the index of the selected option in a drop-down list, use the selectedIndex property in JavaScript.ExampleYou can try to run the following code to display the index of the selected option −Live Demo<!DOCTYPE html> <html>    <body>       <form id="myForm">          <select id="selectNow"> ... Read More

How to convert Number to String in JavaScript?

Monica Mona
Published on 26-Feb-2018 08:16:35
You can try to run the following to learn how to convert Number to String in JavaScript.ExampleLive Demo<!DOCTYPE html> <html>    <body>       <p>Convert Number to String</p>       <script>          var myNumber = 1;          document.write("String : " + String(myNumber)); ... Read More

How to convert Boolean to String in JavaScript?

Monica Mona
Published on 26-Feb-2018 07:46:15
You can try to run the following to learn how to convert Boolean to String in JavaScript −ExampleLive Demo<!DOCTYPE html> <html>    <body>       <p>Convert Boolean to String</p>       <script>          var myBool = false;          document.write("<br>String : " + ... Read More

How to add rows to a table using JavaScript DOM?

Monica Mona
Published on 26-Feb-2018 06:23:47
To add rows to a table with JavaScript, use the DOM method insertRow().ExampleYou can try to run the following code to learn how to add a row to a table one at a time −Live Demo<!DOCTYPE html> <html>    <head>       <script>          function rowFunction(x) ... Read More

How can we use a combination of logical operators while creating MySQL views?

Monica Mona
Published on 22-Feb-2018 10:50:48
MySQL views can be created by using a combination of logical operators like AND, OR, and NOT. It can be illustrated with the help of following examples −Examplemysql> Create or Replace View Info AS select ID, Name, Address , Subject FROM Student_info WHERE (Subject = 'Computers' AND ADDRESS = 'Delhi') ... Read More

How can we use SIGNAL statement with MySQL triggers?

Monica Mona
Published on 22-Feb-2018 08:30:09
Actually, MySQL SIGNAL statement is an error handling mechanism for handling unexpected occurrences and a graceful exit from the application if need to be. Basically, it provides error information to the handler. Its basic syntax would be as follows −SIGNAL SQLSTATE | condition_value [SET signal_information_item = value_1, [, signal_information_item] = ... Read More

How can we destroy a trigger?

Monica Mona
Published on 22-Feb-2018 07:13:54
We can destroy a trigger in two ways −Dropping a trigger explicitlyWith the help of the DROP statement, we can destroy a trigger explicitly. It can be understood with the help of the following example −mysql> DROP Trigger before_inser_studentage1; Query OK, 0 rows affected (0.05 sec)Dropping a trigger implicitlyA trigger ... Read More

How can we find out the current transaction mode in MySQL?

Monica Mona
Published on 22-Feb-2018 06:06:08
We can run “SELECT @@AUTOCOMMIT” command to check the current transaction mode.mysql> Select @@AUTOCOMMIT; +--------------------+ | @@AUTOCOMMIT       | +--------------------+ |       1            | +--------------------+ 1 row in set (0.05 sec) mysql> SET AUTOCOMMIT = 0; Query OK, 0 rows ... Read More

How can I use MySQL subquery as a table in FROM clause?

Monica Mona
Published on 22-Feb-2018 05:40:42
We can use a subquery as a table in the FROM clause in the same way as the result of a subquery can be used with an operator in the WHERE clause. In the following example, we are using the result of subquery as a table by writing it after ... Read More

How MySQL evaluates if we use EXISTS operator with a subquery that returns no rows?

Monica Mona
Published on 21-Feb-2018 13:31:06
If a subquery, used with EXIST operator, returns no rows, the expression EXIST returns FALSE and MySQL returns the empty set as output. It can be understood with the help of simple example using the following data from table ‘Customers’ −mysql> Select * from Customers; +-------------+----------+ | Customer_Id | Name ... Read More
Advertisements