Menu

X

Introduction to MySQL || MySQL Beginner Guide

Introduction: MySQL is a free and open-source relational database management system (RDBMS). A relational database management system organizes data into one or more data tables in which data types may be related to each other. These relations help structure the data. SQL(Structured Query Language) is a language that provides a facility to interact with the database, programmers use to create, modify and extract data from the relational database, as well as control user access to the database. In addition to relational database management systems, SQL  like MySQL works with an operating system to implement a relational database in a computer’s storage system, manages users, allows for network access, and facilitates testing database integrity and creation of backups. 

In this article we will use XAMPP Server for run MySQL

Download and install XAMPP Server 

Open XAMPP Control panel and start apache and mysql server

 Set class path for mysql

goto xampp installed location inside (xampp>mysql>bin) Copy path

go to This Pc > property >Advance System setting > Environment variable > path >Edit >New > paste path link >ok

Class path set successfully we are ready to work with  MySQL

We can access mysql tool in two ways

  1. Graphical user interface (GUI)
  2. Using SQL (Structured Query Language)

In this article, we will use SQL to work with MySQL Database. So we are ready to run SQL commands Open command prompt and type

>mysql –u root –p (for login into MySQL default user name = ‘root’   password=‘’)

Some commands for create and get information about the database

>show databases for see all database available in our MySQL system

> create database database_name for create a new database in our MySQL System        

> use database_name for use existing database in our MySQL system.

>show tables for see all tables inside the database.

>Create table and describe table For create table and see structure of table.

>inserting values into a table

  1. Insert single row value
  2. Insert multiple row values

>select command for Display all records from a table

> where for Search and display records with some conditions

>sorting record using order by

>alter command for add column and drop column

>rename table and drop table

>update table data using update.

>Delete table record using delete

>in() and not in()

>Group by for remove duplicate data

>Aggregate functions: Aggregate functions are built-in functions or a set of functions that operate on a set of values. They can do operations for any specific task for us and then return one final value.

SQL JOIN

An SQL join clause is used to combine rows from two or more tables based on a common field between them. 

The most common type of join is sql inner join. 

Different SQL joins 

  1. Inner join 
  2. Left join 
  3. Right join 
  4. Full join 

Inner join: returns all row’s data when there is at least one match in both tables. 

Left join: returns all row’s data from the left table and the matched rows from the right table. 

Right join: returns all row’s data from the right table and the matched rows from the left table.

Full join: returns all row’s data where there is a match in one row of the tables.

Practical   

Step 1 : create two tables  

Step 2 : insert data into a table  

Inner join operation : 

Left join operation:  

Right Join operation:  

Full join operation : 

SQL triggers

Triggers is a stored program executed automatically to respond to a specific event 

Eg. Insert, update or delete operation occurred in a table.

Practical:

  1. Create table sales.
  2. Insert data without create trigger.
  3. Insert data with create trigger.

CREATE TABLE SALES

INSERT DATA INTO TABLE BEFORE CREATE TRIGGER.

INSERT DATA INTO TABLE AFTER CREATE TRIGGER.

 3,148 views

6170cookie-checkIntroduction to MySQL || MySQL Beginner Guide

About Author

Hi there! I'm Lokesh Pandey. I work as a Software Engineer i love computer programming, technology and love to share my knowledge. Please visit my website http://lokeshpandey.in/

You May Also Like

Comments

Rosalinda

Alzheimer’s finding could aid drug hunt – Pittsburgh Post-Gazette saleviabuy.com is
viagra covered by insurance

Hai

This symptom can be due to a condition called
intrahepatic cholestasis of pregnancy ICP. canadian pharmacy viagra generic best generic viagra site forum

vorbelutr ioperbir

Usually I don’t learn post on blogs, but I would like to say that this write-up very forced me to take a look at and do so! Your writing style has been surprised me. Thanks, very great article.

graliontorile

I have been surfing on-line greater than 3 hours these days, but I never discovered any interesting article like yours. It is pretty value enough for me. Personally, if all web owners and bloggers made excellent content material as you did, the internet will be much more helpful than ever before.

graliontorile

Hi my loved one! I wish to say that this article is amazing, nice written and come with almost all significant infos. I’d like to look extra posts like this .

Jamestah

https://kamagra.icu/# Kamagra 100mg

BrianFot

canadian pharmacy online reviews: canadian pharmacies online – canadian pharmacy phone number canadapharmacy.guru

Richardcoomi

https://indiapharmacy.pro/# world pharmacy india indiapharmacy.pro

Leave a Comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Enable Notifications    Ok No thanks