Posts

Showing posts from 2017

SQL Syntax

In this page, we list the SQL syntax for each of the SQL commands in this tutorial, making this an easy reference for someone to learn SQL. For detailed explanations of each SQL syntax, please go to the individual section by clicking on the keyword. The purpose of this page is to have a quick reference page for SQL syntax, so you can learn SQL more quickly. Bookmark this page now by pressing Control-D so you can have this syntax page handy. You can also download a 1-page PDF version here. Select Statement SELECT "column_name" FROM "table_name"; Distinct SELECT DISTINCT "column_name" FROM "table_name"; Where SELECT "column_name" FROM "table_name" WHERE "condition"; And/Or SELECT "column_name" FROM "table_name" WHERE "simple condition" {[AND|OR] "simple condition"}+; In SELECT "column_name" FROM "table_name" WHERE "c...

Operator in SQL

What is an Operator in SQL? An operator is a reserved word or a character used primarily in an SQL statement's WHERE clause to perform operation(s), such as comparisons and arithmetic operations. Operators are used to specify conditions in an SQL statement and to serve as conjunctions for multiple conditions in a statement. Arithmetic operators Comparison operators Logical operators Operators used to negate conditions SQL Arithmetic Operators: Assume variable a holds 10 and variable b holds 20, then: Show Examples Operator Description Example + Addition - Adds values on either side of the operator a + b will give 30 - Subtraction - Subtracts right hand operand from left hand operand a - b will give -10 * Multiplication - Multiplies values on either side of the operator a * b will give 200 / Division - Divides left hand operand by right hand operand b / a will give 2 % Modulus - Divides left hand operand by right hand operand and returns remainder ...

SQL Commands

SQL Commands: SQL commands are instructions, coded into SQL statements, which are used to communicate with the database to perform specific tasks, work, functions and queries with data. SQL commands can be used not only for searching the database but also to perform various other functions like, for example, you can create tables, add data to tables, or modify data, drop the table, set permissions for users. SQL commands are grouped into four major categories depending on their functionality: Data Definition Language (DDL) - These SQL commands are used for creating, modifying, and dropping the structure of database objects. The commands are CREATE, ALTER, DROP, RENAME, and TRUNCATE. Data Manipulation Language (DML) - These SQL commands are used for storing, retrieving, modifying, and deleting data. These Data Manipulation Language commands are: SELECT, INSERT, UPDATE, and DELETE. Transaction Control Language (TCL) - These SQL commands are used for managing cha...