The Syntax of MySQL

  • 23-03-2022
  • 800
  • MYSQL
  • Haresh Chauhan

Here I will teach you about MYSQL syntax.

MYSQL is mostly used by web developers use MYSQL inside their language to build applications that access data in a database.

Database work on four fundamentals.

  • Read Data From Database - SELECT
  • Insert new data into Database - INSERT
  • Update exist data into Database - UPDATE
  • Delete Data from Database - DELETE

This four fundamental referred to as CRUD (Create, Read, Update, Delete).

The MYSQL SELECT Syntax

SELECT column-names
    FROM table-names
    WHERE conditions
    ORDER BY sort-order

Example

SELECT name, surname, email, city 
    FROM users
    WHERE email = 'contact@webappfix.com'
    ORDER BY name

The MYSQL INSERT Syntax

INSERT table-name (column-names)
    VALUES (column-values)

Example

INSERT users (name, surname, email, city)
    VALUES ('Dharmesh', 'Chauhan', 'contact@webappfix.com', 'Rajkot')

Laravel 6 validation with error message

The MYSQL UPDATE Syntax

UPDATE tableName
    SET columnName = columnValue
    WHERE condition

Example

UPDATE users
    SET city = 'Ahemdabad'
    WHERE id = 3908

The MYSQL DELETE Syntax

DELETE table-name
    WHERE condition

Example

DELETE users
    WHERE email = 'contact@webappfix.com'

I hope it can helpful for you.

Thanks for read.


We always thanks to you for reading our blogs.


dharmesh-image

Dharmesh Chauhan

(Swapinfoway Founder)

Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us

haresh-image

Haresh Chauhan

(Co-Founder)


We Are Also Recommending You :