SQL Basic And Datatypes

SQL (Structured Query Language) 

In this blog. let’s see SQL introduction and datatypes. 

Introduction 

Database

The database is a collection of data or related data.

SQL performs CRUD operations on the database.

  • C – create  
  • R – read  
  • U – update  
  • D – deleted  

A Database Management system (DBMS) is software. It interfaces between Database and end-user. That is responsible for authentication concurrency, logging, backup, optimization, etc.

There are many types of databases - Relational, Hierarchical, Network, NoSQL, etc.

Examples of RDBMS  

  • MYSQL – opensource.  
  • SQL Server – Microsoft. 
  • Oracle – IBM. 
  • PostgreSQL – opensource.  

Datatypes

Character data

Char is stored in max 255 bytes. 

Varchar is stored in max 65535 bytes.  

 Character set

The Default character set is Latin1. 

SHOW CHARACTER SET; -- shows Various character sets that are supported - -  

Example

VARCHAR (20) CHARACTER SET utf8; -- the particular column is set to utf8 --  
CREATE DATABASE student CHARACTER SET utf8; -- entire database is set to utf8 --  

In this example, we used the utf8 character set. If not used utf8 character set it takes the default character set Latin1.  

The Text data

Blob stands for a binary large object. This data type is used to store large amounts of data such as images, media, files.  

The Numerical data

Whole numbers

Tinyint is used to store boolean. 

The Decimal Numbers

The Temporal data

I hope this blog is most helpful for you.