Sravani S has Published 90 Articles

How MySQL LENGTH() function measures the string length?

Sravani S

Sravani S

Updated on 20-Jun-2020 13:13:11

159 Views

MySQL LENGTH() function measures the string length in ‘bytes’ which means that it is not multibyte safe. The difference of the result between multi-byte safe functions, like CHAR_LENGTH() or CHARACTER_LENGTH(), and LENGTH() function especially relevant for Unicode, in which most of the characters are encoded in two bytes or relevant ... Read More

How can I update a table using prepare statements?

Sravani S

Sravani S

Updated on 20-Jun-2020 10:53:26

99 Views

It can be understood with the help of following the example in which we have updated the table named ‘Student’, having the following data, by using prepared statement −mysql> Select * from Student; +------+-------+ | Id   | Name  | +------+-------+ | 1    | Ram   | | 2 ... Read More

How MySQL reacts when we specify a CHARACTER SET binary attribute for a character string data type?

Sravani S

Sravani S

Updated on 20-Jun-2020 07:36:30

135 Views

On specifying a CHARACTER SET binary attribute for a character string data type, MySQL creates that column as its subsequent binary string type. The conversions for CHAR, VARCHAR and BLOB data types take place as follows −CHAR would become BINARYVARCHAR would become VARBINARYTEXT would become BLOBThe above kind of conversion ... Read More

In MySQL, how can we use FROM_UNIXTIME() function with format string?

Sravani S

Sravani S

Updated on 20-Jun-2020 06:41:59

108 Views

Suppose if we want the output of FROM_UNIXIME() function in a particular format then we can use date format string or time format string or both in it. Following is the example of using the format string in FROM_UNIXTIME() function −mysql> Select FROM_UNIXTIME(1555033470 '%Y %M %D')AS 'Formatted Output'; +------------------+ | ... Read More

In MySQL, how can we find which quarter is going on from current date or particular given date?

Sravani S

Sravani S

Updated on 20-Jun-2020 06:13:24

59 Views

We can do it by providing unit value ‘quarter’ to EXTARCT() function. Examples are as follows −mysql> Select EXTRACT(Quarter from '2017-07-29'); +------------------------------------+ | EXTRACT(Quarter from '2017-07-29') | +------------------------------------+ |                                  3 | +------------------------------------+ 1 row ... Read More

How to get the current time in millisecond using JavaScript?

Sravani S

Sravani S

Updated on 19-Jun-2020 08:49:02

1K+ Views

To get the current time in a millisecond, use the date getMilliseconds() method. JavaScript date getMilliseconds() method returns the milliseconds in the specified date according to local time. The value returned by getMilliseconds() is a number between 0 and 999.Example You can try to run the following code to get the ... Read More

How to get the current year in JavaScript?

Sravani S

Sravani S

Updated on 18-Jun-2020 09:16:11

2K+ Views

To get the current year, use the getFullYear() JavaScript method. JavaScript date getFullYear() method returns the year of the specified date according to local time. The value returned by getFullYear() is an absolute number. For dates between the years 1000 and 9999, getFullYear() returns a four-digit number, for example, 2008.ExampleYou ... Read More

How can we generate Strong numbers in Python?

Sravani S

Sravani S

Updated on 17-Jun-2020 14:52:33

143 Views

To print Strong Numbers, let's first look at the definition of it. It is a number that is the sum of factorials of its own digits. For example, 145 is a Strong number. First, create a function to calculate factorial:def fact(num):    def factorial(n):    num = 1    while ... Read More

How to create a triangle using Python for loop?

Sravani S

Sravani S

Updated on 17-Jun-2020 12:24:20

4K+ Views

There are multiple variations of generating triangle using numbers in Python. Let's look at the 2 simplest forms:for i in range(5):    for j in range(i + 1):       print(j + 1, end="")    print("")This will give the output:1 12 123 1234 12345You can also print numbers continuously ... Read More

Can we define an interface inside a Java class?

Sravani S

Sravani S

Updated on 16-Jun-2020 11:20:18

5K+ Views

Yes, you can define an interface inside a class and it is known as a nested interface. You can’t access a nested interface directly; you need to access (implement) the nested interface using the inner class or by using the name of the class holding this nested interface.ExampleLive Demopublic class Sample ... Read More

Advertisements