Completely Solved C, C++ Programs Assignment.




Structured Query Language

Filed Under:

SQL Home
SQL Commands
SQL SELECT
SQL INSERT INTO
SQL WHERE
SQL DISTINCT
SQL UPDATE
SQL DELETE
SQL TRUNCATE TABLE
SQL ORDER BY
SQL Aggregate Functions
SQL GROUP BY
SQL HAVING
SQL AND & OR
SQL JOIN  
SQL UNION
SQL Replication
SQL Top  
SQL Like
SQL Wildcards
SQL In
SQL Between
SQL Alias
SQL Joins
SQL Inner Join
SQL Left Join
SQL Right Join
SQL Full Join
SQL Union
SQL Select Into
SQL Create DB
SQL Create Table
SQL Constraints
SQL Not Null
SQL Unique
SQL Primary Key
SQL Foreign Key
SQL Check
SQL Default
SQL Create Index
SQL Drop
SQL Alter
SQL Increment
SQL Views
SQL Dates
SQL Nulls
SQL isnull()
SQL Data Types
SQL Functions:
SQL avg()
SQL count()
SQL first()
SQL last()
SQL max()
SQL min()
SQL sum()
SQL Group By
SQL Having
SQL ucase()
SQL lcase()
SQL mid()
SQL len()
SQL round()
SQL now()
SQL format()



































































































  What is SQL?
 SQL often referred to as Structured Query Language, was designed for        managing   data in relational database management systems (RDBMS). SQL was   one of the first commercial languages for Edgar F. Codd's relational model, as described in his influential 1970 paper, "A Relational Model of Data for Large Shared Data Banks".
SQL was developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in   the early 1970s. This version, initially called SEQUEL (Structured English Query Language), was designed to manipulate and retrieve data stored in IBM's original quasi-relational database management system, System R, which a group at IBM San Jose Research Laboratory had developed during the 1970s.The acronym SEQUEL was later changed to SQL because "SEQUEL" was a trademark of the UK-based Hawker Siddeley aircraft company.
Properties of SQL:
         SQL stands for Structured Query Language.
         SQL lets you access and manipulate databases.( MySQL, SQL Server, Access, Oracle, Sybase, DB2, and other database systems.)
      SQL is an ANSI (American National Standards Institute) standard. (Although SQL is an ANSI standard, there are many different versions of the SQL language. 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. Most of the SQL database programs also have their own proprietary extensions in addition to the SQL standard.)
       SQL is not case sensitive.

  SQL can be divided into two parts: The Data Manipulation Language  (DML) and the Data Definition Language (DDL).
The query and update commands form the DML part of SQL:
   v  SELECT - extracts data from a database
   v  UPDATE - updates data in a database
   v  DELETE - deletes data from a database
   v  INSERT INTO - inserts new data into a database
  The DDL part of SQL permits database tables to be created or deleted. It also defines indexes (keys), specifies links between tables, and imposes constraints between tables. The most important DDL statements in SQL are:
   v  CREATE DATABASE - creates a new database
   v  ALTER DATABASE - modifies a database
   v  CREATE TABLE - creates a new table
   v  ALTER TABLE - modifies a table
   v  DROP TABLE - deletes a table
   v  CREATE INDEX - creates an index (search key)
   v  DROP INDEX - deletes an index

Why semicolon after SQL statements?
Some database systems require a semicolon at the end of each SQL statement. Semicolon is the standard way to separate each SQL statement in database systems that allow more than one SQL statement to be executed in the same call to the server.
If you using MS Access and SQL Server 2000 then you do not have to put a semicolon after each SQL statement, but some database programs force you to use it.









































































































Get Free Programming Tutorials and Solved assignments