Learn to Code SQL Example – SQL | SELECT Query

(SQL Example for Citizen Data Scientist & Business Analyst)

 

SQL | SELECT Query

Select is the most commonly used statement in SQL. The SELECT Statement in SQL is used to retrieve or fetch data from a database. We can fetch either the entire table or according to some specified rules. The data returned is stored in a result table. This result table is also called result-set.

With the SELECT clause of a SELECT command statement, we specify the columns that we want to be displayed in the query result and, optionally, which column headings we prefer to see above the result table.

The select clause is the first clause and is one of the last clauses of the select statement that the database server evaluates. The reason for this is that before we can determine what to include in the final result set, we need to know all of the possible columns that could be included in the final result set.

Sample Table:
table
Basic Syntax:

SELECT column1,column2 FROM table_name 
column1 , column2: names of the fields of the table
table_name: from where we want to fetch

This query will return all the rows in the table with fields column1 , column2.

  • To fetch the entire table or all the fields in the table:
     SELECT * FROM table_name;
  • Query to fetch the fields ROLL_NO, NAME, AGE from the table Student:
    SELECT ROLL_NO, NAME, AGE FROM Student;

    Output:

    ROLL_NO NAME Age
    1 Ram 18
    2 RAMESH 18
    3 SUJIT 20
    4 SURESH 18
  • To fetch all the fields from the table Student:
     SELECT * FROM Student;

    Output:

    ROLL_NO NAME ADDRESS PHONE Age
    1 Ram Delhi XXXXXXXXXX 18
    2 RAMESH GURGAON XXXXXXXXXX 18
    3 SUJIT ROHTAK XXXXXXXXXX 20
    4 SURESH Delhi XXXXXXXXXX 18

 

SQL tutorials for Business Analyst – SQL | WHERE Clause

 

Learn to Code SQL Example – SQL | SELECT Query

Personal Career & Learning Guide for Data Analyst, Data Engineer and Data Scientist

Applied Machine Learning & Data Science Projects and Coding Recipes for Beginners

A list of FREE programming examples together with eTutorials & eBooks @ SETScholars

95% Discount on “Projects & Recipes, tutorials, ebooks”

Projects and Coding Recipes, eTutorials and eBooks: The best All-in-One resources for Data Analyst, Data Scientist, Machine Learning Engineer and Software Developer

Topics included: Classification, Clustering, Regression, Forecasting, Algorithms, Data Structures, Data Analytics & Data Science, Deep Learning, Machine Learning, Programming Languages and Software Tools & Packages.
(Discount is valid for limited time only)

Disclaimer: The information and code presented within this recipe/tutorial is only for educational and coaching purposes for beginners and developers. Anyone can practice and apply the recipe/tutorial presented here, but the reader is taking full responsibility for his/her actions. The author (content curator) of this recipe (code / program) has made every effort to ensure the accuracy of the information was correct at time of publication. The author (content curator) does not assume and hereby disclaims any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from accident, negligence, or any other cause. The information presented here could also be found in public knowledge domains.

Learn by Coding: v-Tutorials on Applied Machine Learning and Data Science for Beginners

Please do not waste your valuable time by watching videos, rather use end-to-end (Python and R) recipes from Professional Data Scientists to practice coding, and land the most demandable jobs in the fields of Predictive analytics & AI (Machine Learning and Data Science).

The objective is to guide the developers & analysts to “Learn how to Code” for Applied AI using end-to-end coding solutions, and unlock the world of opportunities!