Skip to main content

Posts

Showing posts with the label SQL

SQL Syntax

Some of the most important SQL commands are listed below. These below SQL Syntaxes will be suitable for quick reference. SELECT [hint][DISTINCT] select_list FROM table_list [WHERE conditions] [GROUP BY group_by_list] [HAVING search_conditions] [ORDER BY order_list [ASC DESC] ] [FOR UPDATE for_update_options] SQL Select Statement SELECT "column name" FROM "table name" Example: Select salary from emp; SQL Where SELECT "column name" FROM "table name" WHERE "condition" Example: Select salary from emp Where salary > 2000 SQL Distinct SELECT DISTINCT "column name" FROM "table name" Example: Select DISTINCT name from emp; SQL And/Or SELECT "column name" FROM "table name" WHERE "condition" {[ANDOR] "condition"}+ Example: SELECT salary FROM emp WHERE Salary > 1000 OR (Salary <> 275) SQL Between SELECT "column name" FROM "table name" WHERE "column nam

SQL Introduction

SQL stands for Structured Query Language and it is generally referred to as SEQUEL. SQL is simple language to learn. SQL is a Nonprocedural language, as compared to the procedural or third generation languages (3GLs) such as COBOL and C. SQL was developed by IBM in the 1970s. The American National Standards Institute (ANSI) published its first SQL standard in 1986 and a second widely adopted standard in 1989. ANSI released updates in 1992, known as SQL92 and SQL2 , and again in 1999, termed both SQL99 and SQL3 . Each time, ANSI added new features and incorporated new commands and capabilities into the language. SQL is a simple, yet powerful, language used to create, access, and manipulate data and structure in the database. SQL Statements categories:  DDL - Data Definition Language. DDL is used to define, alter, or drop database objects and their privileges. DDL statements will implicitly perform a commit. DDL Statements: Create It is used to create objects(tables, views) in the data