Articles on Trending Technologies

Technical articles with clear explanations and examples

How will addition, subtraction, multiplication and division operator work with date values stored in MySQL table?

seetha
seetha
Updated on 28-Jan-2020 246 Views

When we try to do such kind of operations with date values stored in the table then MySQL is assuming the date values as the number and perform the arithmetic.Suppose we have a table named ‘example’ having a date value in ‘orderdate’ column then following arithmetic operation will clarify the above −mysql> select * from example; +------------+ | orderdate  | +------------+ | 2017-05-25 | +------------+ 1 row in set (0.00 sec) mysql> select orderdate+10 from example; +--------------+ | orderdate+10 | +--------------+ |     20170535 | +--------------+ 1 row in set (0.00 sec) mysql> select orderdate*10 from example; ...

Read More

How can I check MySQL tables from a database in accordance with particularncolumn/s name?

Manikanth Mani
Manikanth Mani
Updated on 28-Jan-2020 156 Views

The following statement shows the list of two tables having a column ‘email’ in Sample database −mysql> SELECT DISTINCT TABLE_NAME     -> FROM INFORMATION_SCHEMA.COLUMNS     -> WHERE COLUMN_NAME IN('EMAIL')     -> AND TABLE_SCHEMA = 'SAMPLE'; +---------------+ | TABLE_NAME    | +---------------+ | employee      | | new_student   | +---------------+ 2 rows in set (0.04 sec)

Read More

What is the way to check the size of all the MySQL databases?

Ankith Reddy
Ankith Reddy
Updated on 28-Jan-2020 173 Views

We can check the size of all MySQL databases with the help of the following statementmysql> SELECT table_schema "Database", -> SUM(data_length + index_length)/1024/1024 "Size in MB" -> FROM information_schema.TABLES GROUP BY table_schema; +--------------------+----------------+ | Database           | Size in MB     | +--------------------+----------------+ | gaurav             | 1.04785156     | | information_schema | 0.00878906     | | mysql              | 0.68551350     | | performance_schema | 0.00000000     | | sample             | 0.04687500     | | tutorial           | 0.03125000     | +--------------------+----------------+ 6 rows in set, 1 warning (0.33 sec)

Read More

How e-stores are Winning Hearts in India

Samual Sam
Samual Sam
Updated on 28-Jan-2020 184 Views

It is raining discounts and offers on all shopping websites. Online shopping is an activity wherein customers use Internet to order a product or a service at any moment of time and the product is delivered at their doorsteps.Online stores have made shopping easy with the usage of mobile devices, tablets, or laptops that aid most of the online shopping apps. You can enjoy all the products and services just by a click from the comfort of your drawing room or while you are on the go. Online shopping is winning the hearts of shopaholics all over India.Why would Anyone ...

Read More

How MySQL behaves when we use INTERVAL of time unit with CURDATE() function?

varun
varun
Updated on 28-Jan-2020 176 Views

As we know that CURDATE() only returns the date unit so it would be ambiguous to use INTERVAL of time unit with CURDATE(). MySQL always represents current date with ‘00:00:00’ time hence when we use INTERVAL of time unit with CURDATE() then such kind of time arithmetic would take this time into consideration. Following examples will clarify it −mysql> Select CURDATE() + INTERVAL 0 hour; +-----------------------------+ | curdate() + Interval 0 hour | +-----------------------------+ | 2017-10-28 00:00:00         | +-----------------------------+ 1 row in set (0.00 sec) mysql> select CURDATE() + INTERVAL 1 hour; +-----------------------------+ | curdate() ...

Read More

Why I got output 0(Zero) on converting date like '1965-05-15' to TIMESTAMP?

mkotla
mkotla
Updated on 28-Jan-2020 407 Views

As we know that with the help of MySQL UNIX_TIMESTAMP function, we can produce the number of seconds from given date/DateTime. But when we try to convert a date like ‘1965-05-15’ it would give 0(Zero) as output because the range of TIMESTAMP is between ‘1970-01-01 00:00:01’ to ‘2038-01-19 08:44:07’. Hence, the date values beyond TIMESTAMP range cannot be converted and will return 0 as output always.Examples are given below −mysql> Select UNIX_TIMESTAMP ('1965-05-15'); +----------------------------------------------+ | unix_timestamp('1965-05-15 05:04:30')        | +----------------------------------------------+ |                                   ...

Read More

How Google Earth VR makes Virtual Travel a Reality?

Samual Sam
Samual Sam
Updated on 28-Jan-2020 345 Views

How it would feel like if you were to stand on the top of Burj Khalifa or to view the beautiful Taj Mahal from a bit closer or to fly over the Great Wall of China, live just by sitting on your couch? Well, a virtual reality (VR) based application of Google can do that for you.This technology sounds much similar to some earlier applications of Google where one can make a virtual tour just by sitting at home. Yes but they cannot let you see the on road trees and other objects with a clarity that Google VR does ...

Read More

How can we know about the starting range of TIMESTAMP data type with the help of MySQL FROM_UNIXTIME() function?

radhakrishna
radhakrishna
Updated on 28-Jan-2020 206 Views

As we know that this function converts a number of seconds into TIMESTAMP value. So by providing 0 seconds as the argument, it will give us the starting range of TIMESTAMP data type.mysql> Select FROM_UNIXTIME(0); +-------------------------+ | FROM_UNIXTIME(0)        | +-------------------------+ | 1970-01-01 05:30:00     | +-------------------------+ 1 row in set (0.00 sec)Now if we will change the argument from 0 to 60 seconds then the time will be changed by 01 minutes.mysql> Select FROM_UNIXTIME(60); +-------------------------+ | FROM_UNIXTIME(60)       | +-------------------------+ | 1970-01-01 05:31:00     | +-------------------------+ 1 row in set (0.00 sec)

Read More

How Google plans to reduce update cycles and fragmentation in Android?

Samual Sam
Samual Sam
Updated on 28-Jan-2020 213 Views

Every time a new app is launched or say a new version of existing app is launched, our Android smartphone gives us the notification, New updates are available or updated your phone etc. For any techie, developer or mobile lover it is the most beautiful feeling. They are too excited to try the new version.But for the rest of us, we are like why we don’t need any update or I am too lazy for all these things. But that’s the case we can’t help, so either we update and enjoy we features with of course some faults, missing our ...

Read More

How does comparison operator work with date values in MySQL?

vanithasree
vanithasree
Updated on 28-Jan-2020 243 Views

Comparison operator between dates will work in a logical way. In the following example, while comparing two dates, MySQL is simply comparing two numbers or string −mysql> select 20171027 < 20150825; +---------------------------+ | 20171027 < 20150825       | +---------------------------+ |                      0    | +---------------------------+ 1 row in set (0.00 sec)The 0 output shows that the result of the above query is FALSE.mysql> select 20171027 > 20150825; +--------------------------+ | 20171027 > 20150825      | +--------------------------+ |                      1   | +--------------------------+ 1 row in set (0.00 sec)The output ‘1’ shows that the result of the above query is TRUE.

Read More
Showing 55291–55300 of 61,297 articles
Advertisements