Chandu yadav has Published 1276 Articles

How do I remove a MySQL database?

Chandu yadav

Chandu yadav

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

198 Views

To remove any database, we need to use DROP command in MySQL. Here is the syntax. DROP DATABASE yourDatabaseName; First, let us check how many databases are present in MySQL. Here is the query for the same. mysql> SHOW DATABASES; The following is the output. ... Read More

Using DISTINCT and COUNT together in a MySQL Query?

Chandu yadav

Chandu yadav

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

301 Views

We can use DISTINCT and COUNT together in a single MySQL query. Firstly, let us create a table. The CREATE command is used to create a table. mysql> create table DistCountDemo - > ( - > id int, - > ... Read More

Cable Modems

Chandu yadav

Chandu yadav

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

2K+ Views

Cable modem is a hardware device that is used to connect the computer with the Internet Service Provider (ISP) through the local cable TV line. It has two interfaces – one to the cable TV network outlet and the other to a computer or television or set-top box. Configuration Cable ... Read More

Alter a MySQL column to be AUTO_INCREMENT?

Chandu yadav

Chandu yadav

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

874 Views

Let’s say we have a table and now there is a requirement to add AUTO_INCREMENT on column name. For that, use the MODIFY command. Here, we will create a demo table first. mysql> create table AddingAutoIncrement -> ( -> Id int, ... Read More

When to use MyISAM and InnoDB?

Chandu yadav

Chandu yadav

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

435 Views

InnoDB is a general-purpose storage engine that balances high reliability and performance. Since MySQL 5.6, InnoDB is the default MySQL storage engine. InnoDB can be used for various purposes. Here are some of them − It can be used for transaction purpose i.e. all ACID properties. InnoDB can be ... Read More

How can I return 0 for NULL in MySQL?

Chandu yadav

Chandu yadav

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

12K+ 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

Python program to reverse an array in groups of given size?

Chandu yadav

Chandu yadav

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

425 Views

Here we use one user input array and the size of the group. And we create sub array on the size of the group and we just reverse it. If the size of the groups(p) is not multiple of the size of the array(n) then the last group will less ... Read More

What is the benefit of zerofill in MySQL?

Chandu yadav

Chandu yadav

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

1K+ 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

GregorianToJD() function in PHP

Chandu yadav

Chandu yadav

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

73 Views

The GregorianToJD() function converts a Gregorian date to a Julian day count. It returns a Julian day number. Note − The valid range for the Gregorian calendar is from November 25, 4714 B.C. to at least December 31, 9999 A.D. Syntax GregorianToJD(month, date, year) Parameters month − ... Read More

How to debug Lock wait timeout exceeded on MySQL?

Chandu yadav

Chandu yadav

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

216 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

Advertisements