Summary of SQL

What are the SQL MAX() and MIN() Functions?

The MAX() function returns the largest value in the selected column.

The MIN() function returns the smallest value in the selected column.

SELECT MAX(Weight) AS LargestWeight

FROM CricketBats ;

SELECT MIN(Weight) AS SmallestWeight

FROM CricketBats ;

What are the SQL AVG(), COUNT() and SUM() Functions

The SQL AVG() function returns the average value in a numeric values column.

e.g.

SELECT AVG(Weight)

FROM Cricketbats;

The SQL COUNT() function returns the number of rows count that matches with a specified criteria.

SELECT COUNT(ProductID)

FROM Cricketbats;

The SQL SUM() function returns the total sum of a numeric values in a specific column.

e.g

SELECT SUM(Weight)

FROM Cricketbats;

What is SQL UPDATE Statement?

The SQL UPDATE statement is used for modifying the existing records in the selected table.

e.g as below:

UPDATE Users

SET UserContactName=’First name Last name’, City=’City1′

WHERE UserID=1;

What is SQL ORDER BY Keyword

The purpose of ORDER BY keyword is to sort the results in ascending or descending order.

example for ascending order

SELECT * FROM Users

ORDER BY State ASC;

or

SELECT * FROM Users

ORDER BY State;

example for descending order

SELECT * FROM Users

ORDER BY State DESC;

What is a NULL Value in SQL?

NULL values can not be compared using operators =, <, or <> so we will need to use the “IS NULL” or “IS NOT NULL” operators instead.

SELECT UserName, UserContactName, Address FROM Persons

WHERE Address IS NULL;

SELECT UserName, UserContactName, Address FROM Persons

WHERE Address IS NOT NULL;

What is SQL INSERT INTO Statement?

The INSERT INTO statement is used for inserting new records to a table.

e.g.

INSERT INTO Users (UserName, UserContactName, UserAddress, City, ZipCode, State, Country)

VALUES (‘Test1′,’Firstname last name’,’address 1, 2,3 ‘,’City namer’,’99999′,’Statename’,’Countryname’);

What is SQL INSERT INTO SELECT Statement?

The SQL INSERT INTO SELECT statement is used for copying data from one table and then to insert to someother table.

e.g. as below:

INSERT INTO Users (UserName, UserCity, Country)

SELECT VendorName, VendorCity, Country FROM Vendors;

What is the SQL DELETE Statement?

The SQL DELETE statement is used for deleting the existing records in the selected table.

e.g as below:

DELETE FROM Users

WHERE UserName=’Firstname1 Lastname1′;

What is AND, OR and NOT Operators in SQL

AND, OR, and NOT operators are combined with the WHERE clause to get the desired filtered results.

e.g

SELECT * FROM Users

WHERE State =’illinois’ AND City=’Chicago’;

SELECT * FROM Users

WHERE City=’Chicago’ OR City=’New York’;

SELECT * FROM Users

WHERE NOT State =’Chicago’;

What is SQL WHERE Clause?

SQL WHERE clause is used to filter records and its added as below

e.g.

SELECT States FROM Users where Usersgroup = ‘1’;

What is the SQL SELECT TOP Clause ?

The SELECT TOP clause is used to specify the number of records to return.

e.g as below:

SELECT TOP 100 * FROM Users;

How to Use WhatsApp in a Web Browser?

Solution:

1) Go to web.whatsapp.com in a web browser on a computer.
2) Then, on your iOS/Android/Windows mobile phone, open WhatsApp and press the Options on top right corner side
3) then press WhatsApp Web from the options.
4) use iOS/Android/Windows mobile phone to scan the QR code shown on the browser on your computer.

Whatsapp tricks & cheats

How to locate important messages in Whatsapp easily?

Solution: WhatsApp selected messages can be starred.

How to do: Hold down the message and select the star icon on top of whatsapp.

Then You can see all your starred messages directly from your WhatsApp homescreen(View contact >> started message)

How to Use WhatsApp in a Web Browser

1) go to web.whatsapp.com in a web browser on a computer.

2) Then, on your iOS/Android/Windows mobile phone, open WhatsApp and press the Options on top right corner side

3) then press WhatsApp Web from the options.

4) use iOS/Android/Windows mobile phone to scan the QR code shown on the browser on your computer.

How to restrict the view on profile photo and personal status in Whatsapp

Solution: Settings > Account > Privacy and press the right sub-menus for profile photo, status etc.

How to turn it off / hide the Last seen time in WhatsApp?

Follow the path Settings > Account > Privacy > Last Seen

How to turn it off / hide the Read Receipts indication.

Settings > Account > Privacy > Read Receipts

How to reference an old message in WhatsApp and wanted to respond to that.

Hold down the message, then press the left arrow on Android/’reply’ button on iOS. Then type the message that you wanted to display as a response to the old message. This is helpful when multiple conversations are happening in a group chat and you want to respond to a particular message.

How to hide the WhatsApp message previews?

Solution: Go to Settings > Notifications > Show Preview, change the settings.

WhatsApp – how to format the text message

             -it-  => it

             *it* =>    it

            ~it~ =>   it

WhatsApp- Sending voice message instead of typing

            In Android phones – tap on mic icon in WhatsApp and record your voice or use Google’s speech to text engine

            In iPhone phones – tap on mic icon in WhatsApp and record your voice

   ...   ...   ...   ...   ...   ...  ...   ...   ...

How to use while loop in java

While loop in Java

import java.util.Scanner;

class WhileLoop {
public static void main(String[] args) {
int i;

Scanner input = new Scanner(System.in);
System.out.println(“Please input an integer value”);

while ((i = input.nextInt()) != 0) {
System.out.println(“You have entered ” + i);
System.out.println(“Please input an integer value”);
}

System.out.println(“Gone out of loop”);
}
}

How to implement Multiplication program in java

How to implement Multiplication program in java:

import java.util.Scanner;

class TableForMultiplication
{
public static void main(String args[])
{
int i, j;
System.out.println(“Enter an integer to display it’s multiplication table…”);
Scanner in = new Scanner(System.in);
i = in.nextInt();
System.out.println(“Multiplication table of “+i+” is :-“);

for ( j = 1 ; j <= 10 ; j++ )
System.out.println(i+”*”+j+” = “+(i*j));
}
}