MySql database Introduction
MySql : Database Management System
A Database is a collection of data stored in a format that can easily by accessed.
There are two types of Database : Relational(RDBMS) and NoSQL
Relational : Relational Database (RDBMS)
RDBMS use SQL (Structured Query Language).
There are many RDBMS in the World : Oracle, MySQL, MS SQL Server, PostgreSQL.
NoSQL : NoSQL is not a Table-based Database.
NoSQL databases are document based.
MongoDB, Redis, Cassandra etc.
Advantages of MySQL :
=> Cross Platform (That means we can MySQL code on any platform or OS like Windows, McOS, Linux).
=> Used with multiple languages(PHP, NodeJS, Python, C#).
=> MySQL software is Open Source(means free of Cost).
=> MySQL is RDBMS(Relational Database Management System).
=> The MySQL Database Server is fast, reliable, scalable(means we can use MySQL Database with Smallest
as well as Biggest Websites) and easy to use.
=> MySQL Server works in client/server or embedded systems.
Popular Websites Using MySQL :
=> Wikipedia
=> Youtube
=> Flickr
Content Management System Using MySQL :
=> Wordpress
=> Joomla
=> Drupal
=> Magento
=> phpBB
=> TYPO3
=> MODx
Create Table Systax :
CREATE TABLE table_name (
column1 datatype, column2 datatype, column3 datatype, ...
);
Datatypes in MySQL :
3 Type of Category in Datatypes :
1.String
2.Numeric
3.Date and Time
To Create Table SQL Command :
CREATE TABLE personal(id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50), birth_date DATE, phone VARCHAR(12),
gender VARCHAR(1));
To Insert Data in Tables with SQL :
INSERT INTO table_name(column1, column2,...) VALUES(value1, value2,...);
To Insert Multiple Row Data in Tables with SQL :
INSERT INTO table_name(column1, column2,...) VALUES(value1, value2,...), (value1, value2,...), (value1, value2,...);
List of Constraints(Restrictions) in MySQL : NOT NULL, UNIQUE, DEFAULT, CHECK, FOREIGN KEY, PRIMARY KEY
SQL Syntax as shown below :
CREATE TABLE table_name(id INT NOT NULL UNIQUE, name VARCHAR(50) NOT NULL, age INT NOT NULL CHECK(age>=18),
gender VARCHAR(10) NOT NULL, phone VARCHAR(10) NOT NULL UNIQUE, city VARCHAR(10) NOT NULL DEFAULT "Agra");
Comments
Post a Comment