Kumar Varma has Published 107 Articles

How to perform update in MySQL to disallow incrementing all the values above a specific value?

Kumar Varma

Kumar Varma

Updated on 30-Jun-2020 11:09:06

84 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Value int    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100); Query OK, 1 row affected (0.21 sec) mysql> insert ... Read More

How to set the minimum height of an element with JavaScript?

Kumar Varma

Kumar Varma

Updated on 23-Jun-2020 13:29:03

656 Views

Use the minHeight property in JavaScript to set the maximum height. You can try to run the following code to set the minimum height of an element with JavaScript −ExampleLive Demo                    #box {             ... Read More

How to preserve the readability of text when font fallback occurs with JavaScript?

Kumar Varma

Kumar Varma

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

168 Views

Use the fontSizeAdjust property to preserve the readability of text. It sets the aspect value of a font i.e. the difference between the size of lowercase and uppercase letters.ExampleYou can try to run the following code to preserve the readability of text when font fallback occurs with JavaScript −Live Demo ... Read More

How to return the id of the first image in a document with JavaScript?

Kumar Varma

Kumar Varma

Updated on 23-Jun-2020 08:11:36

511 Views

To return the id of the first image, use the images property in JavaScript.ExampleYou can try to run the following code to return the id of the first image in a document −Live Demo                         ... Read More

What are the different types of MySQL GENERATED COLUMNS?

Kumar Varma

Kumar Varma

Updated on 22-Jun-2020 14:29:07

151 Views

We have two types of MYSQL generated columns as follows −VIRTUAL GENERATED COLUMNAs the name suggests, this kind of generated column will not take any disk space. It can be generated with or without using the keyword ‘virtual’. To understand we are illustrating it in the following example −Examplemysql> Create ... Read More

How can we create a MySQL view by selecting some range of values from a base table?

Kumar Varma

Kumar Varma

Updated on 22-Jun-2020 14:00:50

198 Views

As we know that MySQL BETWEEN operator can be used to select values from some range of values. We can use BETWEEN operator along with views to select some range of values from the base table. To understand this concept we are using the base table ‘student_info’ having the following ... Read More

How can we modify the definition of a MySQL view without dropping it?

Kumar Varma

Kumar Varma

Updated on 22-Jun-2020 13:31:43

181 Views

With the help of ALTER VIEW statement, we can modify the definition of MySQL view. In this case, we do not need to drop it. The syntax would be as follows −SyntaxALTER VIEW view_name AS SELECT column1, column2… FROM table WHERE conditions;ExampleTo illustrate it we are modifying the definition of ... Read More

How can MySQL handle the errors during trigger execution?

Kumar Varma

Kumar Varma

Updated on 22-Jun-2020 13:00:16

1K+ Views

Suppose if an error occurs during trigger execution then MySQL can handle it as follows −If a BEFORE trigger fails, the operation on the corresponding row is not performed.A BEFORE trigger is activated by the attempt to insert or modify the row, regardless of whether the attempt subsequently succeeds.An AFTER ... Read More

How MySQL manage the behavior of a transaction?

Kumar Varma

Kumar Varma

Updated on 22-Jun-2020 11:13:00

100 Views

MySQL can manage the behavior of a transaction with the help of the following two modes −Autocommit OnIt is the default mode. In this mode, each MySQL statement (within a transaction or not) is considered as a complete transaction and committed by default when it finishes. It can be started ... Read More

What MySQL returns if the first argument of INTERVAL() function is NULL?

Kumar Varma

Kumar Varma

Updated on 22-Jun-2020 06:46:02

138 Views

MySQL returns -1 as output if the first argument of INTERVAL() function is NULL. Following example will demonstrate it −mysql> Select INTERVAL(NULL, 20, 32, 38, 40, 50, 55); +--------------------------------------+ | INTERVAL(NULL, 20, 32, 38, 40, 50, 55)     | +--------------------------------------+ | -1               ... Read More

Advertisements