SQL: Zero to Hero
What is SQL?
SQL (Structured Query Language) is a domain-specific language used in programming and designed for managing data held in a relational database management system (RDBMS), or for stream processing in a relational data stream management system (RDSMS)
SQL Basics
SELECT
The SELECT DISTINCT
statement is used to return only distinct (different) values.
Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values.
SELECT DISTINCT * FROM TABLE_NAME;
OR
SELECT DISTINCT COLUMN1, COLUMN2, ….. FROM TABLE_NAME;
SELECT WITH NO DISTINCT
SELECT * FROM TABLE_NAME;
OR
SELECT COLUMN1, COLUMN2, …. FROM TABLE_NAME;
NOTE: The letter of “ * “ means to select all of columns and the code block in SQL must be ended with the letter of “ ; “.
NOTE2: You can write your code in upper and/or lower case.