SQL For Beggineers

Total Blog Views: 66

Blog Status: publish

Created By: vishnu Created at: 09-06-2021

Tags: basicprogramming blogs database DBMS Tutorial wikipedia sql trending DDL DML DCL RDBMS content writer datatype

Introduction of SQL: -

   Structure Query Language (SQL) uses the combination of relational algebra and relation calculas. SQL is a standard language of RDBMS which organises data of any relational databse, Manage the existing data and used to retrieval of data from Relational database.

      RDBMS vendors like Oracle IBM, DB2. Sybase and ingress uses SQL as programming language of their database. Basis version of this is called sequel which was developed by IBM.

It has many versions like SQL-86, SQL 89 (extended standard), SQL 92 and SQL 1999 and current version of SQL-SQL 2003 is not only a database query language but also a standard in itself which has following parts-

  1. Data Definition Language ( DDL )
  2. Data Manipulation Language ( DML)
  3. Data Control Language ( DCL)

Mostly commercial relational database like IBM, Oracle, Microsoft, Sybase uses SQL. All database version of SQL do not support all it's features so we should features according to version of database system.

Benifits of SQL - SQL is beneficial in all system database either it is commercial ( Oracle,IBM,DB2,Sybase) or open source ( MySQL,Postgres) It's benefits are as follows-

  1. High speed - It is a kind of language which can give data quickly and efficiently from database of large organization so it is a high speed language.
  2. Easy to learn - It is very easy to learn SQL language because it is not having long program code means it is not require more coding.
  3. Well defined language - SQL is a standard language which is standardized by ANSI & ISO.

Data Definition languageDDL is a part of SQL with the help of it we can specify base schema of data base.

DDL not only specified the base schema of database but also it keeps specification about each relation some of which are as-

  1. Schema for each relation
  2. Domain of values of each attribute
  3. For constraints
  4. For Index
  5. For security and authorization of any schema
  6. For physical storage of each relation.

Basic Domain type of SQL : -

Built in domain types using by SQL are as-

  1. Numeric data type - it has included following data type

(i) Int or Integer - It is used for large size integers. It is requiers 4 byte storage.

(ii) Tiny Int - It is used for very small size integers on unsignd storage integer. 

(iii) Float (M.D) - For floating point numbers. It is used only for sign number where M is the total digit of that number and D is the number of decimal.

(iv) Double (M.D) - It is float point number of double precision which is smilar woeld of 'Real'.

      2. String Type - MySQL has following string data types.

             (i) Char (C) - This data type is used for string of fixed length. Here C is the length of string which is given by user gives string less than given length than it stores space in remaining part.

            (ii) Var Char (c) - It is for string of variable length, Here C is the maximum length of string which is specify by user.

       3. Date and Time data types - MySQL has following date & time data types.

               (i) Date - In this data type, any date store in the format of YYYY-MM-DD and it can be in between 1000-01-01 & 9999-12-31. For example 'age' of any student in 'student table' is 1st July,1980 than it will store in the format of 1980-07-01,

            (ii) DATE TIME - By this data type we can store the match or conbination of date and time, Format of it is YYYY-MM-DD HH:MM:SS. It can be between 1000-01-01 00:00:00 and 9999-12-31 23:59:50 date & time. For example 2.35 noon date 1st July, 1980 can be store as 1980-07-01 14:35:00.

            (iii) Time - It stores time in the format of HH:MM:SS.

            (iv) Year - It store year in the format of 2 digit or 4 digit.

Data Manipulation languageIt is part of SQL which is also known as query language.So DML and query language both are similar words. DML is used to manipulate (Insert, delete, update or retrieval) of data which is store in key relation.

DML keep following manipulation commands-

  1. ​ SELECT
  2.  UPDATE
  3.  INSERT
  4.  DELETE

Data Control language - Data control language is collection of subcommands of SQL which are related to security and manipulation rights of data in database.

DCL keeps following commands -

  1. COMMI I
  2. ROLL BACK
  3. GRANT
  4. REVOKE

 


vishnu

I'm doing Collage Study Right Now and Make Blog About information technology & Info. Programming Share my blogs and comment on it Give me more suggestion on it!



Comments



  • swazahmad | almost 4 years ago
    Usefull for beginners 💘💘💘
Buy traffic for your website

About Shadbox

we have the “Get things executed” lifestyle at our place of work. There are not any excuses, no if’s or however’s in our dictionary. committed to navigating the ship of creativity to create cell answers, we resolve the real-lifestyles troubles of our clients and their clients. Our passion for work has won us many awards, year after 12 months.

Services

Downloads