| |

Basic SQL – DQL Command Structure Syntax – Quickest Way to Remember It!

SQL DQL database

In this quick guide, we will be looking at the simply command structure/syntax of SQL – DQL.

SQL – Stands for  Structured Query Language. It is a language that is used to communicate with a database.

DQL– Data Query Language aspect of  MySQL.

As an Data Scientist or aspiring one,  you will be interacting with lots of databases and SQL will be in the way.

A simple way to remember the simple query structure/syntax of DQL is:

SELECT 

FROM 

WHERE 

GROUP (BY)

HAVING 

ORDER (BY) ;

The First 2 KEYWORDS – that is SELECT and FROM are required. The others are optional.

Hence you get:

SELECT  the data you want

FROM these database and tables

WHERE these criteria are met

GROUP (BY) this field

HAVING this property

ORDER (BY) this field or list ;

These keywords are not case sensitive, but it is always a good practice to distinguish them from other words by capitalising them.

And also though you can write them as one full English sentence it is always a good practice to start EACH KEYWORD on a new line.

 

Want more information like this?

Similar Posts

  • | |

    Connect Push Commit Pull Your GitHub Repository To Your Local Computer’s Directory

    Introduction Github is a web version control system which is very useful when you are working on various projects or you want to keep track of changes you make to your project over time. It is a very useful tool as you venture into Data Science and Programming   Objective After you have created a…

  • Visual Explanation illustration and presentation of SQL JOINS query statements

    SQL Joins can sometimes be a bit confusing, particularly if you a newbie. I have below 2 visual representations which should help enhance your visual understanding of SQL JOINS First is from From CodeProject, by C L Moffatt You can check full explanation here: Sql Joins visually explained   2. Second was from Duke University….

  • | | | |

    Free Entity Relationship and Relational Schema Diagram Tool

    ERDPLUS One tool I generally use when working on a projects, mini tasks and exploration is the ERDPLUS tool . It is quite simple and easy to use. It is a Free tool as well. Below are some diagrams I generated when i first got in contact with with tool. ERD DIAGRAMS: 1. 2.  A…

  • |

    Creating Oracle PL/SQL Tables for Intercollegiate Athletic Database – Data Warehousing

    Creating Oracle  tables for Intercollegiate Athletic Database. Part of Assignment one of Data Warehousing for Business Intelligence on Coursera

    After creating the tables lets insert values

      In case you want to change a constraint on a field, you can use a syntax examples as the following. ALTER TABLE FACILITY ADD CONSTRAINT UNQ_FAC UNIQUE (FACNAME)…

  • |

    Quick Graphs On Normal Distribution, Skewness, Mean ,Mode, Median And Central Limit Theorem

    These are quick reference charts about basic Statistics of your data.       Skewness of the Data is described by the tail of the data. Left skewed means the tail points to the left and Right Skewed means the tail points to the right   The Skewness and the position of the Mean and Median…

Leave a Reply

Your email address will not be published. Required fields are marked *