Mkotla has Published 100 Articles

What MySQL would return if we refer a user variable which is not assigned any value explicitly?

mkotla

mkotla

Updated on 20-Jun-2020 10:49:23

62 Views

In case, when we refer a user variable which is not assigned any value explicitly, MySQL would return NULL. In other words, its value would be NULL. Following example would illustrate it −mysql> Select @X, @Y, @Z, @S, @G; +------+-------+----------+------+------+ | @X   | @Y    | @Z     ... Read More

How can I restore multiple databases or all databases dumped by mysqldump?

mkotla

mkotla

Updated on 20-Jun-2020 10:43:22

4K+ Views

Suppose if we have dumped multiple databases or all the databases and now want to restore it then we can do it with the following example −C:\mysql\bin>mysql -u root < tutorials_query1.sqlWith the help of above query, we are restoring the dumped multiple databases named ‘tutorials’ and ‘query1’, which are dumped ... Read More

How can we transfer information between MySQL and data files?

mkotla

mkotla

Updated on 20-Jun-2020 09:14:18

68 Views

Transferring the information between MySQL and data files mean importing data from data files into our database or exporting data from our database into files. MySQL is having two statements that can be used to import or export data between MySQL and data files −LOAD DATA INFILEThis statement is used ... Read More

What is the maximum length of data we can put in a TEXT column in MySQL?

mkotla

mkotla

Updated on 20-Jun-2020 08:31:13

3K+ Views

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 ... Read More

On inserting ‘NULL’, ‘0’ or No Value to the column, will MySQL assign sequence number for AUTO_INCREMENT column?

mkotla

mkotla

Updated on 20-Jun-2020 07:36:00

343 Views

MySQL will automatically assign sequence numbers to the AUTO_INCREMENT column even if we insert NULL, 0 or No Value to the column in a table.Examplemysql> create table test123(id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, Name Varchar(10)); Query OK, 0 rows affected (0.15 sec)The query above created a MySQL table named ... Read More

What is the difference between CHAR and NCHAR in MySQL?

mkotla

mkotla

Updated on 19-Jun-2020 13:26:16

512 Views

Both CHAR and NCHAR are fixed length string data types. They have the following differences −CHAR Data TypeNCHAR Data TypeIts full name is CHARACTER.Its full name is NATIONAL CHARACTERIt uses ASCII character setIt uses Unicode character set and data is stored in UTF8 formatIt occupies 1-byte of space for each ... Read More

What is onmouseup event in JavaScript?

mkotla

mkotla

Updated on 19-Jun-2020 11:16:53

689 Views

The onmouseup event triggers when a mouse button is released.ExampleYou can try to run the following code to learn how to work with onmouseup event in JavaScript −                                         This is demo text for mouseup event.    

Different ways to overload a method in Java

mkotla

mkotla

Updated on 17-Jun-2020 06:53:10

299 Views

Method overloading can be achieved in following three ways −By changing the number of parameters in the method.By changing the order of parameter typesBy changing the data types of the parameters.See the example below−Example Live Demopublic class Tester {    public static void main(String args[]) {       Tester tester ... Read More

How to test if a JavaScript cookie has expired?

mkotla

mkotla

Updated on 17-Jun-2020 06:43:19

2K+ Views

To test if a cookie has expired in JavaScript, add the following condition and check −if( !($.cookie('myCookie') === null) ) {    // Do something (cookie exists) } else {    // Do something (cookie expired) }You can also check it using a single line code −checkCookie = $.cookie('myCookie') === null ? ( /*Condition TRUE...*/ ) : ( /*Condition FALSE...*/ );

How to get a decimal portion of a number with JavaScript?

mkotla

mkotla

Updated on 17-Jun-2020 06:35:57

2K+ Views

With JavaScript, use the % operator to get the decimal portion of a number.ExampleYou can try to run the following to get decimal portion −Live Demo                    var num1 = 5.3;          var num2 = 4.2;          var num3 = 8.6;          document.write(num1 % 1);          document.write(""+num2 % 1);          document.write(""+num3 % 1);           Output0.2999999999999998 0.20000000000000018 0.5999999999999996

Advertisements