Anvi Jain has Published 634 Articles

Decrease a row value by 1 in MySQL?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:24

597 Views

You can increase and decrease row value by 1 in MySQL using UPDATE command. The syntax is as follows −UPDATE yourTableName set yourColumnName = yourColumnName-1 where condition;Let us create a table to decrease row value by 1. The following is the query −mysql> create table IncrementAndDecrementValue    −> (   ... Read More

How to create a simple MySQL function?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:24

472 Views

You can create a function using create function command. The syntax is as follows −delimiter // DROP FUNCTION if exists yourFunctionName; CREATE FUNCTION yourFunctionName(Parameter1, ...N) returns type BEGIN # declaring variables; # MySQL statementns END // delimiter ;First, here we will create a table and add some records in the ... Read More

How to sum elements of a column in MySQL?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:24

403 Views

Use aggregate function sum() to sum the elements of a column in MySQL. The syntax is as follows −select sum(yourColumnName1) as anyVariableName1, sum(yourColumnName2) as anyVariableName2, sum(yourColumnName3) as anyVariableName3, ............N from yourTableName;To understand the above syntax, let us create a table. The following is the query to create a table −mysql> ... Read More

Difference between #include and #include "filename" in C/C++?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:22

2K+ Views

The difference between the two forms is in the location where the preprocessor searches for the file to be included.#include The preprocessor searches in an implementation-dependent manner, it searches directories pre-designated by the compiler. This method is usually used to include standard library header files.#include "filename"The preprocessor searches in the ... Read More

Difference between and

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:22

160 Views

Ionic is an open source framework used for developing mobile applications. It provides tools and services for building Mobile UI with native look and feel. Lists are one of the most popular elements of any web or mobile application. They are usually used for displaying various information. They can be combined ... Read More

How Can we permanently define user-defined variable for a client in MySQL?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:21

163 Views

In MySQL, it is not possible that a client can hold user variable permanently. It is because all the variables for a given client connection are automatically freed when that client exits.

C++ Operators with Precedence and Associativity

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:21

3K+ Views

Operator precedence determines the grouping of terms in an expression. The associativity of an operator is a property that determines how operators of the same precedence are grouped in the absence of parentheses. This affects how an expression is evaluated. Certain operators have higher precedence than others; for example, the ... Read More

How to create a dialog with “yes” and “no” options in JavaScript?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:21

2K+ Views

No, you cannot create a dialog box with “yes” or “no”. A confirmation dialog box in JavaScript has “Ok” and “Cancel” button.To create a dialog with “yes” or “nor”, use a custom dialog box.ExampleLive Demo                         ... Read More

Java interview questions and answers

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:21

287 Views

There are many sites which are a good resource for java interview questions-answers. Following is the list of most popular websites.Tutorialspoint - www.Tutorialspoint.comStackOverflow - www.stackoverflow.comDZone - www.dzone.comWikipedia - www.wikipedia.orgIBM Developer Works - www.ibm.com/developerworks/java/TechGig - www.techgig.comGitHub - www.github.comJava documentation - docs.oracle.com/javase/Coursera - www.coursera.org/JavaWorld - www.javaworld.com/Read More

What is the difference between #define and const Keyword in C++?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:21

251 Views

The #define directive is a preprocessor directive; the preprocessor replaces those macros by their body before the compiler even sees it. Think of it as an automatic search and replace of your source code.A const variable declaration declares an actual variable in the language, which you can use like a ... Read More

Advertisements