Chandu yadav has Published 1091 Articles

How can I return 0 for NULL in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:23

19K+ Views

We can return 0 for NULL in MySQL with the help of IFNULL() method. The syntax of IFNULL() is as follows. IFNULL(YOUREXPRESSION, 0); Let us see an example. First, we will create a table. mysql> create table NullDemoWithZero -> ( -> ... Read More

What is the benefit of zerofill in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:23

2K+ Views

ZEROFILL pads the displayed value of the field with zeros up to the display width set in the column definition. Let us understand the role of zero fill in MySQL using an example. Creating a table with two columns, one has zerofill and the second one does not. The query ... Read More

How to debug Lock wait timeout exceeded on MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:23

403 Views

The debug Lock wait timeout situation occurs because of some threads. If one thread is holding on to some records for a very long time, it means the thread has exceeded time. To see all the details, implement the following query − mysql> SHOW ENGINE INNODB STATUS; The ... Read More

How do I kill all the processes in MySQL “show processlist”?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:23

4K+ Views

We can kill the processes with the help of the ‘kill’ command. However, you need to kill those processes one by one, since MySQL does not have any massive kill command. To check how many processes exist, use ‘show processlist’ mysql> show processlist; The following is the output. ... Read More

Python program to extract ‘k’ bits from a given position?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:23

2K+ Views

This function is use to extract k bits from pos position and returns the extracted value. Here we use python slicing technique. Example Input:: number=170 K=5 Pos=2 Output=21 Algorithm Extractionbit(no, k, pos) /*user input number ... Read More

How to repair MySQL tables from the command line?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:23

320 Views

The repair of MySQL tables is only applicable to MyISAM engine type, not for InnoDB. Therefore, we need to change the Engine type to MyISAM. The following is an example. Creating a table mysql> create table RepairTableDemo -> ( -> id int, ... Read More

How to check internet connection in android?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:23

3K+ Views

This example demonstrate about how to check the state of internet connection through broadcast Receiver.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − To find the internet status we have to ... Read More

Why python for loops don't default to one iteration for single objects?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:22

171 Views

Python cannot iterate over an object that is not 'iterable'. The 'for' loop construct in python calls inbuilt functions within the iterable data-type which allow it to extract elements from the iterable.Since non-iterable data-types don't have these methods, there is no way to extract elements from them. And hence for ... Read More

Raise the Mobile Safari HTML5 application cache limit?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:22

679 Views

Application cache on Safari has no limit on storing data, but for mobile Safari the rues are different.The upper limit is 5MB.On mobile safari, the local storage and session storage are 5MB each. On WebSQL, a user is asked for permissions but you cannot store data any more than 50MB.With ... Read More

HTML5 and Amazon S3 Multi-Part uploads

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:22

216 Views

Yes, it is possible to use the HTML 5 File API with the Amazon S3 multi-part upload feature. You would need a server backup as well as Amazon API keys.Amazon S3, a web service offered by Amazon Web Services provides storage through web services interfaces. Amazon launched S3 in 2007.Create ... Read More

Advertisements