Srinivas Gorla has Published 75 Articles

What happens if I will assign a value to a MySQL user variable using a statement that returns multiple rows?

Srinivas Gorla

Srinivas Gorla

Updated on 20-Jun-2020 10:48:56

86 Views

In case, if we will assign a value to a user variable using a statement that returns multiple rows then the value from the last row would be saved in that user variable because user variables can save the only single value. Following the example, in which we are using ... Read More

A scale transform the element by using y-axis with CSS3

Srinivas Gorla

Srinivas Gorla

Updated on 20-Jun-2020 08:56:54

225 Views

The scaleY(y) method is used to scale transform the element using y-axis.Let us see the syntax −scaleY(y)Here, y is a number representing the scaling factor to apply on the ordinate of each point of the element.Let us see an example −div {    width: 60px;    height: 60px;    background-color: ... Read More

In MySQL, what is the difference between SERIAL and AUTO_INCREMENT?

Srinivas Gorla

Srinivas Gorla

Updated on 20-Jun-2020 07:09:26

3K+ Views

In MySQL, both SERIAL and AUTO_INCREMENT are used to define a sequence as a default value for a field. But they are technically different from each other.The AUTO_INCREMENT attribute is supported by all numeric data types except for BIT and DECIMAL. There can only be one AUTO_INCREMENT field per table ... Read More

What are the different time format characters used by MySQL DATE_FORMAT() function?

Srinivas Gorla

Srinivas Gorla

Updated on 20-Jun-2020 06:03:01

129 Views

Different time format characters used by MySQL DATE_FORMAT() function are as follows −Time Format CharacterMeaning %HIt is used to abbreviate Hour on a 24-hour clock in two digits format like 00, 01, 02 up to 23. %hIt is used to abbreviate Hour on 12-hour clock in two digits format like 01, 02 ... Read More

How can we insert current date automatically in a column of MySQL table?

Srinivas Gorla

Srinivas Gorla

Updated on 19-Jun-2020 13:47:19

3K+ Views

With the help of CURDATE() and NOW() function, we can insert current date automatically in a column of MySQL table.ExampleSuppose we want to insert current date automatically in an OrderDate column of table year_testing the following query will do this −mysql> Insert into year_testing (OrderDate) Values(CURDATE()); Query OK, 1 row ... Read More

How can we add FOREIGN KEY constraints to more than one fields of a MySQL table?

Srinivas Gorla

Srinivas Gorla

Updated on 19-Jun-2020 11:58:10

724 Views

MySQL allows us to add a FOREIGN KEY constraint on more than one field in a table. The condition is that each Foreign Key in the child table must refer to the different parent table.ExampleSuppose we have a table ‘customer2’ which have a Primary Key constraint on the field ‘cust_unq_id’ ... Read More

How to return a value from a JavaScript function?

Srinivas Gorla

Srinivas Gorla

Updated on 19-Jun-2020 11:31:35

2K+ Views

To return a value from a JavaScript function, use the return statement in JavaScript. You need to run the following code to learn how to return a value −Example                    function concatenate(name, age) {             var ... Read More

How can we debug JavaScript in Internet Explorer?

Srinivas Gorla

Srinivas Gorla

Updated on 19-Jun-2020 08:59:04

100 Views

The most basic way to track down errors is by turning on error information in your browser. By default, Internet Explorer shows an error icon in the status bar when an error occurs on the page. Double-clicking this icon takes you to a dialog box showing information about the specific error ... Read More

Java program to convert a string to lowercase and uppercase.

Srinivas Gorla

Srinivas Gorla

Updated on 18-Jun-2020 08:12:46

808 Views

ExampleLive Demoimport java.lang.*; public class StringDemo {    public static void main(String[] args) {         // converts all upper case letters in to lower case letters       String str1 = "SELF LEARNING CENTER";       System.out.println("string value = " + str1.toLowerCase());     ... Read More

What is the lambda expression to convert array/List of String to array/List of Integers in java?

Srinivas Gorla

Srinivas Gorla

Updated on 16-Jun-2020 10:12:36

561 Views

You can convert an array list of strings to an array list of integers as:ExampleLive Demoimport java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; public class LamdaExpressions {    public static void main(String args[]) {       ArrayList list = new ArrayList();       list.add("123");       list.add("223"); ... Read More

Advertisements