Knowledge in NoSQL

Introduction to NoSQL

Following document giver a basic idea of how a Nosql database was created and how it can easily help us in managing a database system.

SQL Aliases

SQL Aliases SQL aliases are used to give a table, or a column in a table, a temporary name. Aliases are often used to make column names more readable. An alias only exists for the duration of the query. Alias Column Syntax SELECT column_name AS alias_name FROM table_name; Alias Table Syntax SELECT column_name(s) FROM table_name AS alias_name

SQL Comments

SQL Comments Comments are used to explain sections of SQL statements, or to prevent execution of SQL statements. Note: The examples in this chapter will not work in Firefox and Microsoft Edge! Comments are not supported in Microsoft Access databases. Firefox and Microsoft Edge are using Microsoft Access database in our examples. ________________________________________ Single Line Comments Single line comments start with --. Any text between -- and the end of the line will be ignored (will not be executed).

SQL Wildcard Characters

SQL Wildcard Characters A wildcard character is used to substitute one or more characters in a string. Wildcard characters are used with the SQL LIKE operator. The LIKE operator is used in a WHERE clause to search for a specified pattern in a column

SQL Tutorial

SQL TutorialSQL is a standard language for storing, manipulating and retrieving data in databases.Our SQL tutorial will teach you how to use SQL in: MySQL, SQL Server, MS Access, Oracle, Sybase, Informix, Postgres, and other database systems.Examples in Each ChapterWith our online SQL editor, you can edit the SQL statements, and click on a button to view the result.ExampleSELECT * FROM Customers;

RDBMS

RDBMS stands for Relational Database Management System.RDBMS is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.The data in RDBMS is stored in database objects called tables. A table is a collection of related data entries and it consists of columns and rows.Look at the "Customers" table:ExampleSELECT * FROM Customers;

SQL Syntax

Database TablesA database most often contains one or more tables. Each table is identified by a name (e.g. "Customers" or "Orders"). Tables contain records (rows) with data.In this tutorial we will use the well-known Northwind sample database (included in MS Access and MS SQL Server).SQL StatementsMost of the actions you need to perform on a database are done with SQL statements.The following SQL statement selects all the records in the "Customers" table:ExampleSELECT * FROM Customers;

SQL SELECT Statement

SQL SELECT StatementThe SQL SELECT StatementThe SELECT statement is used to select data from a database.The data returned is stored in a result table, called the result-set.SELECT SyntaxSELECT column1, column2, ...FROM table_name;Here, column1, column2, ... are the field names of the table you want to select data from. If you want to select all the fields available in the table, use the following syntax:SELECT * FROM table_name;

SQL SELECT DISTINCT Statement

The SQL SELECT DISTINCT StatementThe SELECT DISTINCT statement is used to return only distinct (different) values.Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values.SELECT DISTINCT Syntax SELECT DISTINCT column1, column2, ... FROM table_name; SELECT Example Without DISTINCTThe following SQL statement selects ALL (including the duplicates) values from the "Country" column in the "Customers" table:Example SELECT Country FROM Customers;

SELECT DISTINCT Examples

SELECT DISTINCT ExamplesThe following SQL statement selects only the DISTINCT values from the "Country" column in the "Customers" table:Example SELECT DISTINCT Country FROM Customers; The following SQL statement lists the number of different (distinct) customer countries:Example SELECT COUNT(DISTINCT Country) FROM Customers;

SQL WHERE Clause

The SQL WHERE ClauseThe WHERE clause is used to filter records.The WHERE clause is used to extract only those records that fulfill a specified condition.WHERE Syntax SELECT column1, column2, ... FROM table_name WHERE condition; WHERE Clause ExampleThe following SQL statement selects all the customers from the country "Mexico", in the "Customers" table:Example SELECT * FROM Customers WHERE Country='Mexico'; 

SQL AND, OR and NOT Operators

SQL AND, OR and NOT OperatorsThe WHERE clause can be combined with AND, OR, and NOT operators.The AND and OR operators are used to filter records based on more than one condition:The AND operator displays a record if all the conditions separated by AND are TRUE.The OR operator displays a record if any of the conditions separated by OR is TRUE.The NOT operator displays a record if the condition(s) is NOT TRUE.AND Syntax SELECT column1, column2, ... FROM table_name WHERE condition1 AND condition2 AND condition3 ...; OR Syntax SELECT column1, column2, ... FROM table_name WHERE condition1 OR condition2 OR condition3 ...; NOT Syntax SELECT column1, column2, ... FROM table_name WHERE NOT condition;