Articles on Trending Technologies

Technical articles with clear explanations and examples

What are the different shapes of galaxies?

Knowledge base
Knowledge base
Updated on 30-Jul-2019 846 Views

In the vast space around us, there are numerous galaxies present, which are known as large groups filled with stars, dust, and gases all held together due to gravity. All the galaxies are likely to contain stars, planets, moons, comets, asteroids, black holes, nebulae, dust, neutron stars etc.Just like our solar system that lies in the Milky Way galaxy, there are many galaxies in the space. Every galaxy moves at certain speed and exists in a certain shape. Our milky way galaxy is in the spiral shape with a bright bulge at its center.The famous astronomer Edwin Hubble studied the ...

Read More

SELECT not null column from two columns in MySQL?

Ankith Reddy
Ankith Reddy
Updated on 30-Jul-2019 9K+ Views

There are lots of ways to select NOT NULL column from two columns. The syntaxes are as follows:Case 1: Use IFNULL() function.The syntax is as follows:SELECT IFNULL(yourColumnName1, yourColumnName2) as anyVariableName from yourTableName;Case 2: Use coalesce() function.The syntax is as follows:SELECT COALESCE(yourColumnName1, yourColumnName2) as anyVariableName from yourTableName;Case 3: Use CASE statement.The syntax is as follows:SELECT CASE WHEN yourColumnName1 IS NOT NULL THEN yourColumnName1 ELSE yourColumnName2 END AS anyVariableName FROM yourTableName;Case 4: Use only IF().The syntax is as follows:SELECT IF (yourColumnName1 ISNULL, yourColumnName2, yourColumnName1) AS NotNULLValue FROM SelectNotNullColumnsDemo;To understand the above syntax, let us create a table. The query to create a ...

Read More

Where does MySQL store database files?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 2K+ Views

To know where MySQL store database files, you can use the variable @@datadir. The query is as follows −mysql> select @@datadir;The following is the output that displays the path −+---------------------------------------------+ | @@datadir | +---------------------------------------------+ | C:\ProgramData\MySQL\MySQL Server 8.0\Data\ | +---------------------------------------------+ 1 row in set (0.00 sec)Here is the snapshot where MySQL store database files i.e. the same path we got above −Now, let us verify whether ...

Read More

How can I earn from learning a new language?

Vihan Rodrigues
Vihan Rodrigues
Updated on 30-Jul-2019 229 Views

Getting acquainted with local and foreign languages is opening the doors to plenty of opportunities. Languages like Hindi, Punjabi, Gujarati, Urdu, Tamil, Malayalam, Bengali and many other Indian languages as well as the foreign languages like French, German, Spanish, Arabic, Korean, Japanese, Chinese, Italian, Russian and Persian, etc. not only boost your chances of getting a job but also offer you an opportunity to get to know a completely diverse world with a unique viewpoint.Educational QualificationHowever, there is no educational qualification required to learn any language. You can choose any local or foreign language as a subject during your schooling. ...

Read More

Add 30 days to a value in a MySQL table?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 728 Views

To add 30 days to a value in the table, you can use ADDDATE() function with UPDATE command. The syntax is as follows:UPDATE yourTableName SET yourDateColumnName=ADDDATE(yourDateColumnName, INTERVAL 30 DAY);To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table Add30DayDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> ShippingDate date,    -> PRIMARY KEY(ID)    -> ); Query OK, 0 rows affected (0.76 sec)Insert some records in the table using insert command. The query is as follows:mysql> insert into Add30DayDemo(ShippingDate) values('2019-02-04'); Query OK, 1 row affected ...

Read More

How to make back button twice to close an activity in Android?

Ankith Reddy
Ankith Reddy
Updated on 30-Jul-2019 939 Views

Sometimes we click back button unintentionally, When you click on a back button it will close your application or will go back to another activity. To avoid this problem, This example demonstrates how to make back button twice to close an activity.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 - Add the following code to res/layout/activity_main.xml.     Step 3 - Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.app.ActivityManager; import android.content.Context; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.os.VibrationEffect; ...

Read More

MySQL DATE_FORMAT '%M' is used for short month?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 176 Views

The %M Date Format is not used for displaying short months like Jan for January, Feb for February, etc. You need to use DATE_FORMAT() function with %b format for short month. The syntax is as follows:SELECT DATE_FORMAT(yourColumnName, '%d-%b-%y') AS anyVariableName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table DateFormatMonthDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> ShippingDate date,    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command. The ...

Read More

What are scavengers?

Ridhi Arora
Ridhi Arora
Updated on 30-Jul-2019 1K+ Views

Scavengers are also known as decomposers. They feed on the dead bodies and thus those who are dependent on decaying smelly matter. Some of the popular examples of decomposers are vultures, crows, hyenas, etc. It is a common myth that these scavengers are only carnivorous. They are even herbivores.Scavengers As Animal or BirdScavengers of dead plant material include termites that build nests in grasslands and then collect dead plant material for consumption within their accommodation i.e. the nest.Coprovores: Animals which consume feces, such as dung beetles are known as Coprovores.Detritivores: Animals that collect small particles of a dead animal or a ...

Read More

Why we mention in MySQL WHERE 1=0?

George John
George John
Updated on 30-Jul-2019 5K+ Views

The condition 1=0 can be used to stop the query from returning any rows. It returns empty set.The syntax is as follows:SELECT *FROM yourTableName WHERE 1=0;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table ConditionDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> Name varchar(10),    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command. The query is as follows:mysql> insert into ConditionDemo(Name) values('Larry'); Query OK, 1 row affected (0.10 sec) mysql> ...

Read More

Can MySQL INT type be non-zero NULL?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 363 Views

You can set the INT column to value NULL.The column INT type a nullable column. The syntax is as follows:INSERT INTO yourTableName(yourIntColumnName) values(NULL);To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table nullableIntDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> Price int,    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.80 sec)Insert the record as NULL for a int column ‘Price’. The query is as follows:mysql> insert into nullableIntDemo(Price) values(NULL); Query OK, 1 row affected (0.11 sec) mysql> insert into ...

Read More
Showing 60631–60640 of 61,297 articles
Advertisements