JSON validator

facebooktwittergoogle_plusredditpinterestlinkedinmail

SQL (Structured Query Language) Cheat Sheet

Operators

=
Equal

 

<>
Not equal

 

>
Greater than

 

<
Less than.

 

>=
Greater than or equal.

 

<=
Less than or equal.

 

BETWEEN
Between an inclusive range.

 

IN
Search for exact value in a list.

 

LIKE
Search for a pattern.

 

%
Wildcard/s in a pattern.

 

AND
Used between arguments in WHERE statement.

 

OR
Used between arguments in WHERE statement

 

ASC
Alphabetical and numerical order – default for ORDER BY statement

 

DESC
Reverse alphabetical and numerical order

 

Data Types

integer(size)
Integers only. Maximum number of digits specified in parenthesis.

 

int(size)
Integers only. Maximum number of digits specified in parenthesis.

 

smallint(size)
Integers only. Maximum number of digits specified in parenthesis.

 

tinyint(size)
Integers only. Maximum number of digits specified in parenthesis.

 

decimal(size,d)
Hold numbers with fractions. Maximum number of digits specified in “size”. Maximum number of digits to the right of the decimal is specified in “d”.

 

numeric(size,d)
Hold numbers with fractions. Maximum number of digits specified in “size”. Maximum number of digits to the right of the decimal is specified in “d”.

 

char(size)
Holds a fixed length string (can contain letters, numbers, and special characters). The fixed size is specified in parenthesis.

 

varchar(size)
Holds a variable length string (can contain letters, numbers, and special characters). The maximum size is specified in parenthesis.

 

date(yyyymmdd)
Holds a date

 

Functions

SUM(column)
Return the total sum of columns’ values

 

AVG(column)
Return the average value of a column

 

COUNT(column)
Return the number of rows (excluding NULL) of a column

 

MAX(column)
Return the highest value of a column

 

MIN(column)
Return the lowest value of a column

 

Database Manipulation

Create database
CREATE DATABASE database_name

 

Delete database
DROP DATABASE database_name

 

Table Manipulation

Create table
CREATE TABLE “table_name”
(“column_1” “data_type_for_column_1”,
“column_2” “data_type_for_column_2”,
… )

 

Add column to a table
ALTER TABLE table_name
ADD column_name datatype

 

Delete column from a table
ALTER TABLE table_name
DROP column_name datatype

 

Delete table
DROP TABLE table_name

 

Index Manipulation

Create index
CREATE INDEX index_name
ON table_name (column_name_1, column_name_2, …)

 

Create a unique index
CREATE UNIQUE INDEX index_name
ON table_name (column_name_1, column_name_2, …)

 

Delete index
DROP INDEX table_name.index_name

 

Data Manipulation

Insert new rows into a table
INSERT INTO table_name VALUES (value_1, value_2,….)
or
INSERT INTO table_name (column1, column2,…)
VALUES (value_1, value_2,….)

 

Update column/s
UPDATE table_name
SET column_name_1 = new_value_1, column_name_2 = new_value_2
WHERE column_name = some_value

 

Delete row/s
DELETE FROM table_name
WHERE column_name = some_value

 

Delete the data from a table
TRUNCATE TABLE table_name

 

Select

Select all data from a table
SELECT *
FROM table_name

 

Select all data from specified columns
SELECT column_name(s)
FROM table_name

 

Select using alias
SELECT table_alias.column_name AS column_alias
FROM table_name AS table_alias

 

Select only distinct (different) data from a table.
SELECT DISTINCT column_name(s)
FROM table_name

 

Limit selection
Select data using WHERE, AND, OR
SELECT column_name(s) FROM table_name
WHERE column operator value
AND column operator value
OR column operator value

 

Select data using IN.
SELECT column_name(s) FROM table_name
WHERE column_name IN (value1, value2, …)

 

Order selection
Order results buy column value ascending or descending.
SELECT column_name(s) FROM table_name
ORDER BY column_1 DESC/ASC

 

Join selection
Select all matching rows from 2 tables.
SELECT column_1_name, column_2_name, …
FROM first_table_name
INNER JOIN second_table_name

 

Select all rows from the first table, even if there are no matches in the second table.
SELECT column_1_name, column_2_name, …
FROM first_table_name
LEFT JOIN second_table_name
ON first_table_name.key = second_table_name.foreign_key

 

Select all rows from the second table, even if there are no matches in the first table.
SELECT column_1_name, column_2_name, …
FROM first_table_name
RIGHT JOIN second_table_name
ON first_table_name.key = second_table_name.foreign_key

 

Add up selections
Select all the values from multiple SQL statements.
SQL_Statement_1
UNION ALL
SQL_Statement_2

 

Select all the different values from multiple SQL statements.
SQL_Statement_1
UNION
SQL_Statement_2 Select

 

Populate with selection
Select and insert into another table.
SELECT column_name(s)
INTO new_table_name
FROM source_table_name
WHERE …

 

Select and insert into another database.
SELECT column_name(s)
IN external_database_name
FROM source_table_name
WHERE …

 

Populate a virtual table with the result-set of a SELECT statement.
CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE …

 

facebooktwittergoogle_plusredditpinterestlinkedinmail

How to Fix GitHub Install for Windows Failure – “Application installation did not succeed. Cannot locate application files on the server. “

The issue:

GitHub installation for windows goes through seemingly smoothly, but then an error occurs:

"Application installation did not succeed.  Cannot locate application files on the server.  Contact the application vendor or your administrator for assistance."

 

The detailed message says something along the lines of

ERROR SUMMARY
 Below is a summary of the errors, details of these errors are listed later in the log.
  * Activation of http://github-windows.s3.amazonaws.com/GitHub.application resulted in exception. Following failure messages were detected:
   + Downloading http://github-windows.s3.amazonaws.com/Application Files/GitHub_1_0_47_0/msvcp100.dll.deploy did not succeed.
   + The remote server returned an error: (403) Forbidden.


 

The solution:

Step 1 – Remove a local %appdata% directory

Navigate to C:\Users\{username}\AppData\Local\Apps in windows explorer and delete the 2.0 directory.

Step 2 – download the application

Open Internet ExplorerInternet Explorer and navigate to:

https://github-windows.s3.amazonaws.com/GitHub.application

 

facebooktwittergoogle_plusredditpinterestlinkedinmail

How to Cut a Video using VLC Media Player – 3 Simple Steps

VLC media player doesn’t let you cut a video, but it does let you record a section of the video. Below is the step by step of how it’s done.

1) Launch VLC media player and activate Advanced controls.

How to Cut a Video using VLC Media Player - Advanced controls

How to Cut a Video using VLC Media Player - Record

2) Navigate to the point in the video you would like to record and press the record button.

How to Cut a Video using VLC Media Player - Record

3) Press the record button again to end the recording, and navigate to Libraries\Videos to find your newly cut file.

How to Cut a Video using VLC Media Player - location Libraries Videos

facebooktwittergoogle_plusredditpinterestlinkedinmail

How to Calculate Average (Arithmetic Mean)

How to Calculate Average (Arithmetic Mean) - Average formula - Mean formula

To calculate the average of a group of numbers, all one must do is add all the numbers up and then divide by the total amount of numbers.

Let’s take the following numbers for example:

6, 5, 4, 3

The sigma of 1 through n – or the sum of all the numbers is 18.

6 + 5 + 4 + 3 = 18

The n – or the total count of numbers is 4.
18 divided by 4 is 4.5.

18 / 4 = 4.5

 
It’s easy. Here, you can try it yourself.


Enter your comma separated numbers here:

Enter your calculation result for the average here:




facebooktwittergoogle_plusredditpinterestlinkedinmail