George John has Published 1234 Articles

How do I get SUM function in MySQL to return '0' if no values are found?

George John

George John

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

7K+ Views

To return Sum as ‘0’ if no values are found, use IFNULL or COALESCE commands. The following is the syntax for IFNULL. SELECT IFNULL(SUM(NULL), 0) AS aliasName; Let us now implement the above syntax in the following query. mysql> SELECT IFNULL(SUM(NULL), 0) AS SUMOFTWO; The following ... Read More

Cable Television

George John

George John

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

730 Views

Cable television is a popular television system that delivers television programming services through cables. This is different from terrestrial television (where radio waves are transmitted over air and received by antennas) and satellite television (where signals are sent by communication satellites and received by satellite dish). Types of cables ... Read More

Best data type for storing currency values in a MySQL database?

George John

George John

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

551 Views

For representation of money, we need to use Decimal (TotalDigitsinteger, DigitsAfterDecimalinteger) method. Let’s say, we need to display the value 345.66. For that, count how many digits are available. In value 345.66, there are 5 digits in total and 2 digits after decimal point, which is 66. We can represent ... Read More

What is the C# equivalent to Java's isInstance()?

George John

George John

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

487 Views

The java.lang.Class.isInstance() determines if the specified Object is assignment-compatible with the object represented by this Class Java’s isInstance() method’s equivalent in C# is IsAssignableFrom(). Another simplest way for isInstance() equivalent is − bool res = (ob is DemoClass); You can also work with Type.IsInstanceOfType for the same result ... Read More

Dropping Unique constraint from MySQL table?

George John

George John

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

321 Views

First, let us create a table with the UNIQUE constraint. It suggests that we cannot add duplicate values. Creating a table. mysql> create table UniqueConstraintDemo -> ( -> Name varchar(200) unique -> ); Query OK, 0 rows affected (1.05 sec) ... Read More

What does the KEY keyword mean in MySQL?

George John

George John

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

1K+ Views

Key is synonymous to an index. If you want to create an index for a column, then use ‘Key’. As stated in the official docs: KEY is normally a synonym for INDEX. The key attribute PRIMARY KEY can also be specified as just KEY when given in a column definition. ... Read More

Cable Modem Termination System (CMTS)

George John

George John

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

2K+ Views

Cable modem termination system (CMTS) is a hardware device at the headend of a cable TV network that is used to connect cable subscribers to the Internet Service Provider (ISP). They provide high speed data services like Internet or Voice over Internet Protocol (VoIP) over the cable TV network. ... Read More

How to disable ONLY_FULL_GROUP_BY in MySQL?

George John

George John

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

1K+ Views

You can enable ONLY_FULL_GROUP_BY in MySQL as shown in the following query − mysql> SET sql_mode = 'ONLY_FULL_GROUP_BY'; Query OK, 0 rows affected (0.01 sec) As shown above, we can enable ONLY_FULL_GROUP_BY with the help of SET command. To disable ONLY_FULL_GROUP_BY with the help of the following query ... Read More

How to convert MyISAM to InnoDB storage engine in MySQL?

George John

George John

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

211 Views

To convert the MyISAM Engine to InnoDB, we can use the ALTER command. Let us now create a table with the help of engine MyISAM. mysql> create table MyISAMToInnoDBDemo -> ( -> id int, -> Name varchar(100) ... Read More

easter_days() function in PHP

George John

George John

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

32 Views

The eastern_days() function returns the number of days after March 21, on which Easter falls for a specified year. Syntax eastern_days(year, method) Parameters year − An year between 1970 and 2037. The default is the current year, local time method − Calculate easter dates based on other ... Read More

Advertisements