/    /  DBMS – Intro to SQL

Introduction to SQL

 

SQL: It stands for Structured Query Language. It allows us to access and manipulate the data. 

 

What can an SQL do?

An SQL can perform queries against a database, get data from a database,  insert records in a database, update records in a database, remove records from a database, create new databases, create new tables in a database, create stored procedures in a database, create views in a database, set permissions on tables, procedures, and views. 

 

An SQL has several parts:

 

  • Data Definition Language (DDL):

For defining relation schemas, deleting relations, and modifying relation schemas, SQL DDL provides those commands.

 

  • Data Manipulation Language (DML):

This gives the ability to query information from the database and to insert tuples into, delete tuples from, and modify tuples in the database.

 

Data Definition of SQL

Basic Data Types :

 

  1. a)     Char(n) : It’s a fixed-length character string with user-specified length n.

 

  1. b)   Varchar(n) : It is a variable-length character string with a user specified maximum length n.

 

  1. c)     int : It is an integer.

 

  1. d)   date : It’s a date

 

  1. e)     numeric (p,d) : It’s a fixed point number with user specified precision.

 

  1. f) float : It’s a floating-point number.

 

Reference

Introduction to SQL