In MySQL, SUM() function is used to return the total sum of a numeric column in a table.
SUM() Syntax
SELECT SUM(column_name) FROM table_name;
We have a table "employee" as below:
employee
id first_name last_nam...
In Java, the "==" operator is used to compare references. When we use the == operator in Java it compares 2 objects, it checks whether the two objects refer to the same place in memory or not.
Example:
String str1 = new String("abc");
S...
TRUNCATE
TRUNCATE comes under DDL(Data Definition Language).
TRUNCATE removes only rows from the table but the structure of the table remains same.
Data can not be roll backed if we use "TRUNCATE" command to delete data.
Can not use WHERE...
In MySQL, the DEFAULT constraint is used to insert value into a column in a table. If there is no value is specified for a column then the default value will be added to column for all new records.
DEFAULT Constraint on CREATE TABLE
The fol...
In MySQL, the CHECK constraint is used to put limit on value range on value inside a column.
CHECK Constraint on CREATE TABLE
The following statement creates a CHECK constraint on the "id" column when the "employee" table is created. The CH...
Ruby supports both && as well as and.
The basic difference between these 2 lies in their precedence order.
&& has higher preference than and.
and has lower preference than = unlike && which has higher preferen...
Note that the "P_Id" column in the "Orders" table points to the "P_Id" column in the "Persons" table.
In MySQL, the FOREIGN KEY on one table is used to point a PRIMARY KEY in another table.
We have two tables with the following values.
...
In MySQL, the PRIMARY KEY constraint is used to uniquely identify each record in a table.
Primary key contains UNIQUE values only and the column defined as Primary key column can not be NULL. A table can have only one PRIMARY KEY.
PRIMARY K...
To get all properties that belong to an object in javascript, we can use Object.getOwnPropertyNames(). The ordering of the non-enumerable properties in the array, and among the enumerable properties, is not defined.
Example:
var arr = ['a'...
Hi all,
If you want to show dots if text does not fit UILabel frame. then just copy this code.
UILabel property "numberOfLines" is 1 by default. Try to set it 0 if you dont know the exact numberOfLines and use sizeToFit method of UILable...
The splice() method is used to add/remove items to/from an array, and returns the removed item(s).
Syntax
array.splice(index, howMany, [element1][, ..., elementN]);
where
index Index at which to start changing the array.
howMany ...
The slice() method extracts a substring and returns a new string.
The syntax for slice() method is
string.slice( firstindex [, endindex] );
firstindex : -The zero-based index at which to begin extraction.
endindex : -The zero-based i...
A JSONObject is an unordered amassment of name/value pairs. Its external form is a string wrapped in curly braces with colons between the designations and values, and commas between the values and designations.
A JSONObject constructor can be ...
There is method to add elements at the beginning of an array using unshift method
The array unshift method adds element at the beginning of an array and returns its new length. This method can be applied to the objects that resembles an array...
We can use jquery method append() or appendTo() method for
appending an existing div to another existing div.
Example fo appendTo():
$('#menu').on('click', function(){
$('#div1').appendTo('#div2');
});
Example for append()...
There are methods to add elements to the array using push method and concat method.
The array push method adds element at the end of an array and returns its new length.
Syntax :- array.push(item1, item2, ..., itemX)
Below is the exampl...
Hi friends,
Now all the website are open from various screen sizes from a small mobile phone to large screen computer, so we required a webpage which adapt according to the various screen size and OS system like android phone, iPhone...
Hi Guys,
Search engine Optimization(SEO) is mainly categorised in two part one is On-Page optimization and other one off-Page Optimization. In On-page all activities are done only at website or webpage end. basically which include me...
Hi Readers,
Today, I will be discussing about the Otherwise Function available in $routeProvider in AngularJS. The main objective of this function is to redirect the end users to a particular route when the user by mistake or intentionally...
Here we will learn about the filter functions that are used to validate and sanitize the data and make sure that data is in proper form and all the illegal characters are removed from the data.The filter function are:
filter_has_var()
filter_id...
There is a need to set dataType in the ajax if you expect to get json response .
$.ajax({
url: "/accept",
type: "POST",
data: myformData,
context: this,
error: function () {},
dataType: 'json',
success : fun...
I have two Google Sheets named Sheet_1 and Sheet_2. I want to link both these Google Sheets and fetch the cells numerical data from Sheet_2 to a specific cell location in Sheet_1.
...
A tuple is a sequence of immutable Python objects. Tuples are in form of sequences as same as lists. The main differences between tuples and lists is that tuples cannot be changed like lists, also tuples use parentheses whereas lists use square b...
To remove a list element, you can use either the del statement if you know exactly which element(s) you are deleting or the remove() method if you do not know. For example
#!/usr/bin/python
list1 = ['physics', 'chemistry', 1997, 2000];
...
If you want to update single or multiple elements of lists then you have to provide the slice on the left-hand side of the assignment operator, and to add to elements in a list you can use the append() method. For example
#!/usr/bin/python
...
To access values in lists, use the square brackets for slicing along with the index or indices to obtain value available at that index. For example
#!/usr/bin/python
list1 = ['physics', 'chemistry', 1997, 2000];
list2 = [1, 2, 3, 4, 5, 6,...
Imagine a situation in which you just wake up at 2 Am midnight and you tried to browse internet and typed the Website URL, but due to half sleep condition you typed the wrong URL and aft...
Hello Readers,
.wrapInner() is the jquery method which is used to wrap the inner HTML element in the set of matched elements.This method wraps the HTML structure by using wrapping element as a parameter and returns the jquery object as a resul...
The list is a most versatile datatype available in Python which can be written as a list of comma-separated values (items) between square brackets. Important thing about a list is that items in a list need not be of the same type.For example you ...
Many times we need to format a number with two decimal points, PHP provides many solutions for rounding a number with decimal values. This tutorial list some functions which can be used to round a number with decimal values upto 2 decimal points....
To send an e-mail with mixed content you requires to set Content-type header to multipart/mixed. Then, text and attachment sections can be specified within boundaries.
A boundary started with two hyphens followed by a unique number, which cannot...
All the content are treated as a simple text at when you send a text message using Python. Even if you include HTML tags in a text message, it will display as simple text and HTML tags will not be formatted according to HTML syntax. But Python pr...
Hi Readers,
Today I will be discussing about the limitation of virtualfields and how can we overcome it's limitations. Firstly, we can not use virtualfields in associated models for conditions,fields arrays or order. Doing so will general...
High availability(HA) means undisrupted functioning of a system for a long time so that users face no troubles in accessing the system almost all the times. Customers expect from companies that their services will be highly available 24x7x365, es...
Class Not Found Exception org.springframework.web.context.ContextLoaderListener
Sometimes, when we build a project using maven, we find the error " Class Not Found Exception org.springframework.web.context.ContextLoaderListener " even after...
In the below code I have created ContactUs page. Here first I have added images in drawable folder, created Scrollview, ImageView, TextView in activity_contactus.xml layout. And I have used OnClickListener method for using phone no, tweeter and m...
I have posted python script for e-mail sending in python project code is given below.
import smtplib
sender = 'from@findnerd.com'
receivers = ['to@todomain.com']
message = """From: From Person
To: To Person
Subject: SMTP e-mail test
...
Hello Readers,
parents() is the jquery method and it is same as parent() method but the difference is that parents() method return the all ancestors of the given selector which include parent, grandparent, great-grandparent, great-great-grandp...
Simple Mail Transfer Protocol (SMTP) is a protocol which handles sending e-mail and routing e-mail between mail servers .And with the help of smtp we can provides smtplib module which defines an SMTP client session object that can be used to sen...
Link building process consists of three basic methodologies including Manual Directory Submissions, Local Directory Submissions and Social Media Submissions. All these types of Natural L...
Hi Readers,
We all have used array_values, but we use array_values just to get the values from an array. However, we can do much more than that with the help of it.
One of it's alternative use of array_values is in a situation wher...
This tutorial explains the difference between array_fill() and array_fill_keys() functions, which are used to initialize or fill an array with values. The main difference is in the method of filling values in array by both functions. The details ...
<-- Chapter 25: SQL Join
Chapter 26
SQL Inner Join
SQL Inner Join clause is used to fetch all the rows from more than two tables in which there is a match between the columns. Inner Join is similar like Join clause.
Lets see an ...
In MySQL, the UNIQUE constraint is used to uniquely identify each record in a table.
UNIQUE Constraint on CREATE TABLE
The following statement creates a UNIQUE constraint on the "id" column when the "employee" table is created:
Example
...
In MySQL, the NOT NULL constraint is used to restrict a column to NOT accept NULL values.
The NOT NULL constraint allows a column to always contains a value which means you cant not insert/update a record in a table without passing value for t...
Ruby supports both Strings & Symbols.
String being mutable & Symbols being immutable cater to different needs.
We can convert String to Symbol & Symbol to String at any time.
To convert a string to a symbol, we can use inter...
If we want to update UI from a Non-UI thread then runOnUiThread() is the best solution for it.
I am showing Toast in every 25 secs.
Below is the code
private Thread refreshThread;
refreshThread = new Thread() {
@Override
...
In the below code I have created splash screen. Here first I have added images in drawable folder, and then added in activity_splash_screen, In SplashScreenActivity I have also used Timer function. See the below code it will clerly describe you...
Hello Readers,
parentsUntil() is the jquery method which is used to return all the ancestors between the selector and stop.Here, ancestor element include parent, grandparent, great-grandparent, great-great grandparent and so on. This method al...