Vrundesha Joshi has Published 345 Articles

How to subtract 3 hours from a datetime in MySQL?

Vrundesha Joshi

Vrundesha Joshi

Updated on 29-Jun-2020 07:53:22

3K+ Views

Subtract 3 hours from DateTime in MySQL, using any of the following ways. The first approach is as follows −Case 1 − Using DATE_ADD()select date_add(yourColumnName, interval -3 hours) from yourTableName;Case 2 − Using DATE_SUB()select date_sub(yourColumnName, interval 3 hours) from yourTableName;Firstly, use now() to get the current date-time −mysql> select now();The ... Read More

Maintaining order in MySQL “IN” query?

Vrundesha Joshi

Vrundesha Joshi

Updated on 29-Jun-2020 07:42:46

521 Views

You can maintain the order in MySQL IN query with the help of field command. The syntax is as follows −select *from yourTableName anyVariableName where anyVariableName.yourColumnName in(value1, value2, ......N) order by field(anyVariableName.yourColumnName, value1, value2, ......N);To implement the above syntax let us create a table −mysql> create table OrderInDemo    −> ... Read More

How to change Table Engine in MySQL?

Vrundesha Joshi

Vrundesha Joshi

Updated on 29-Jun-2020 07:37:52

244 Views

You can change table engine with the help of alter command. The syntax is as follows −alter table yourTableName ENGINE = yourEngineName;To understand the above syntax let us create a table with engine MyISAM. Later you can change any other engine. The following is the query to create a table.mysql> ... Read More

MySQL command for display current configuration variables?

Vrundesha Joshi

Vrundesha Joshi

Updated on 29-Jun-2020 07:26:17

182 Views

You can use SHOW VARIABLES command to display current configuration variables. The syntax is as follows −SHOW VARIABLES;If you want any specific information, then implement the LIKE operator. The syntax is as follows −SHOW VARIABLES LIKE ‘%AnySpecificInformation%’;Now we will implement the above syntax −mysql> show variables like '%variable%';The following is ... Read More

How to add a day to datetime field in MySQL query?

Vrundesha Joshi

Vrundesha Joshi

Updated on 29-Jun-2020 07:18:12

184 Views

To add a day to datetime field, use the DATE_ADD() function. The syntax is as follows −SELECT DATE_ADD(yourColumnName, interval yourIntegerValue day) as anyVariableName from yourTableName;Let us first create a table −mysql> create table AddOneDayDemo −> (    −> YourDay datetime −> ); Query OK, 0 rows affected (1.37 sec)Insert current ... Read More

Rotate In Up Left Animation Effect with CSS

Vrundesha Joshi

Vrundesha Joshi

Updated on 29-Jun-2020 07:17:22

87 Views

To create a rotate in up left animation effect with CSS, you can try to run the following code −ExampleLive Demo                    .animated {             background-image: url(/css/images/logo.png);             background-repeat: no-repeat;   ... Read More

Accessing The Unix/Linux password database (pwd)

Vrundesha Joshi

Vrundesha Joshi

Updated on 27-Jun-2020 14:24:42

238 Views

The pwd module in standard library of Python provides access to the password database of user accounts in a Unix/Linux operating system. Entries in this Password database are atored as a tuple-like object. The structure of tuple is according to following passwd structure pwd.h file in CPython APIIndexAttributeMeaning0pw_nameLogin name1pw_passwdOptional encrypted ... Read More

How to store custom objects in NSUserDefaults?

Vrundesha Joshi

Vrundesha Joshi

Updated on 27-Jun-2020 13:44:37

462 Views

In this article we’ll learn how to store custom objects in our application, but before you learn how to store custom object let’s see what are custom object?A custom object is any class or structure or any other data that is not a native data type like Int, Double, String ... Read More

Set Invert Effect with CSS

Vrundesha Joshi

Vrundesha Joshi

Updated on 27-Jun-2020 12:22:14

209 Views

Invert effect is used to map the colors of the object to their opposite values in the color spectrum, i.e., to create a negative image.The following parameter is used in this filter:Sr.NoParameter & Description1InvertMaps the colors of the object to their opposite value in the color spectrum.ExampleYou can try to ... Read More

Get a list of Foreign Key constraints in MySQL

Vrundesha Joshi

Vrundesha Joshi

Updated on 25-Jun-2020 14:06:45

927 Views

Let’s say we have a database “business” with number of tables. If you want to show only foreign key constraints, then use the following query −mysql> select *    −> from information_schema.referential_constraints    −> where constraint_schema = 'business';The following is the output displaying only foreign key constraints −+--------------------+-------------------+--------------------------+---------------------------+--------------------------+------------------------+--------------+-------------+-------------+-------------------+-----------------------+ | CONSTRAINT_CATALOG ... Read More

Advertisements