SQL Introduction

What is SQL

Stands for Structured Query Language it lets you Access and manipulate databases

What Can SQL do

  1. Create new databases
     Syntax: CREATE DATABASE database_name
  2. create new tables in a database
     Syntax: CREATE TABLE table_name (column1 datatype, column2 datatype, column3 datatype,);
  3. Insert records in a database
     Syntax: INSERT INTO table_name VALUES (value1, value2, value3, ...);
  4. Retrieve data from a database
     Syntax: SELECT * FROM table_name;
    NOTE: insted of * you can use fileds which fileds we want retrive.
  5. Delete records from a database
     Syntax: DELETE FROM table_name WHERE condition;
  6. Update records in a database
     Syntax: UPDATE table_name SET column1 = value1, column2 = value2, WHERE condition;
  • Execute queries against a database
  • Create stored procedures in a database
  • Create views in a database
  • Set permissions on tables, procedures, and views
  • However, to be compliant with the ANSI standard, they all support at least the major commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE) in a similar manner.

Using SQL

To build a web site that shows data from a database, you will need:
An RDBMS database program (i.e. MS Access, SQL Server, MySQL)

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. These Operators are used to specify conditions in an SQL statement and to serve as conjunctions for multiple conditions in a statement.

  1. Arithmetic operators
  2. Comparison operators
  3. Logical operators
  4. Operators used to negate conditions

Comments

Popular posts from this blog

Database Developer vs Database Administrator

AlwaysOn Overview

Long Running queries