Arjun Thakur has Published 1109 Articles

Detection of ambiguous indentation in python

Arjun Thakur

Arjun Thakur

Updated on 30-Jun-2020 09:27:06

428 Views

Indentation is an important feature of Python syntax. Code blocks in function, class or loops are required to follow same indent level for statements in it. The tabnanny module in Python's standard library is able to detect any violation in this stipulation.This module is primarily intended to be used in ... Read More

Overlap Elements with CSS

Arjun Thakur

Arjun Thakur

Updated on 30-Jun-2020 08:49:14

370 Views

To overlap elements, use the CSS z-index property. You can try to run the following code to implement the z-index property and set image behind the textExampleLive Demo                    img {             position: absolute;             left: 0px;             top: 0px;             z-index: -1;          }                           This is demo text.    

Update an entire row in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jun-2020 07:54:16

2K+ Views

To update an entire row in MySQL, use UPDATE command. You need to know the primary key column. The syntax is as follows to update an entire row.UPDATE yourTableName SET yourColumnName1 = ’yourValue1’ ,yourColumnName2 = ’yourValue2’ ,    yourColumnName3 = ’yourValue3’ ,.......................N    WHERE yourPrimaryKeyColumnName = yourValue;To understand the above ... Read More

MySQL query to find a list of city names that do not start with vowels?

Arjun Thakur

Arjun Thakur

Updated on 30-Jun-2020 07:43:05

11K+ Views

You can use DISTINCT with RLIKE operator to find a list of city names that do not start with vowels.The syntax is as follows −SELECT DISTINCT yourCityColumnName FROM yourTableName WHERE yourCityColumnName NOT RLIKE ‘ ^[AEIOUaeiou].*$’;To understand the above syntax, let us create a table. Here, we have a column for ... Read More

How to convert DateTime to a number in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jun-2020 07:33:30

2K+ Views

To convert the date time to a number in MySQL, the syntax is as follows −SELECT UNIX_TIMESTAMP(yourColumnName) 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 DateTimeToNumberDemo    -> (    -> Id int ... Read More

Convert dd/mm/yyyy string to Unix timestamp in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jun-2020 07:25:47

385 Views

Convert dd/mm/yyyy string to Unix timestamp with the help of UNIX_TIMESTAMP(). The syntax is as follows −SELECT UNIX_TIMESTAMP(STR_TO_DATE(yourColumnName, '%d/%m/%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 ConvertddmmyyyyInUnixTimeStamp    -> (    -> ... Read More

How can I update the boolean values in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jun-2020 07:14:49

12K+ Views

You can update boolean value using UPDATE command. If you use the BOOLEAN data type, MySQL internally convert it into tinyint(1). It can takes true or false literal in which true indicates 1 to tinyint(1) and false indicates 0 to tinyint(1).The syntax is as follows −UPDATE yourTableName SET yourColumnName = ... Read More

What is the best datatype for currencies in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jun-2020 07:03:33

141 Views

The best data type for currencies in MySQL is a DECIMAL. The syntax of DECIMAL data type is as follows −DECIMAL(TotalDigit, NumberOfDigitAfterDecimalPoint);To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table CurrenciesDemo    -> (    -> TotalPrice ... Read More

Get table column names in alphabetical order in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jun-2020 06:31:17

2K+ Views

To get the table column names in alphabetical order, you need to use ORDER BY. The syntax is as follows −SELECT anyReferenceName.COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS anyReferenceName WHERE anyReferenceName.TABLE_NAME = ’yourTableName’ ORDER BY anyReferenceName.COLUMN_NAMEFirst, we need to get all the columns and then we need to use ORDER BY. In the above ... Read More

How to ORDER BY LIKE in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jun-2020 06:19:10

2K+ Views

To order by like in MySQL, use the case statement. The syntax is as follows −SELECT *FROM yourTableName    ORDER BY CASE    WHEN yourColumnName like '%yourPatternValue1%' then 1    WHEN yourColumnName like '%yourPatternValue2%' then 2 else 3 end;To understand the above syntax, let us create a table. The query ... Read More

Previous 1 ... 4 5 6 7 8 ... 111 Next
Advertisements