Back to Browse

SELECT Statement Everything | SQL Full Course | SQL Tutorial For Beginners

48 views
Premiered Feb 4, 2023
16:09

SELECT Statement Everything | SQL Full Course | SQL Tutorial For Beginners #sql #tutorial #select Chapter 6 DDL Statements : https://youtu.be/DocoAjPqHss Chapter 5 Constraints in SQL : https://youtu.be/nv6Ow0emAJ0 Chapter 4 Datatypes in SQL : https://youtu.be/PedrfjN-PCo Chapter 3 Command Types in SQL : https://youtu.be/VZtRsZ4klhc Chapter 2 Oracle Live Free :- https://youtu.be/g257vfnM2mo Chapter 1 MySQL Download & Installation :- https://youtu.be/ErtPrysapLc Hello friends welcome back to our next session on SQL tutorial for beginners if you haven't watched our previous videos then please find the link in the description and go through the videos so in this tutorial we will learn about select statement in a select statement first of all the basic selection so select is used to access the data from database table the basic element of the syntax of Select statements are select keyword the column you want to select and the table from which you will redo the data so for example you see here the select column 1 column 2 so on up to your column n from table name so this is the basic selection where you are listing the column names if you want to select more than one column list them separated by commas if you want to select all the columns in the table you can use the asterisk another basic selection which is using asterisk select a strict from table name in this case you don't need to list all the columns or you don't need to write down the names of all the columns and that's all the asterisk will bring all the columns from the table let's see they select basic selection examples so we have a world database where CT is the table and we are listing The Columns from the CT table ID name country code district and population select from these columns from City table if we execute this it will give us the list of all the columns in the order which we specified all the records so if you want to change the order of any particular column you can specify that and you can get the result so now population is the shifted before the district basic selection by listing the columns now if you don't want if you want to list all the columns we have another way that is asterisk we can simply put asterisk after select statement select keyword from table name so select asterisk from table name City and let's run it this will also give us all the columns listed over here so this is the basic selection now let's learn about the selecting by criteria in a select statement we can put some criteria to select a specific data if you want and for that where class comes into the picture in select statement and the statement syntax is select column names from table name where a particular column equals to or any operator and the value so in this case where column 2 equals to something this will restrict the data for the particular criteria and give us the result and this is where where Clause is comes in with the picture and it's very important for us to select the data so we will use the same example of City table where we have different columns in City so in this case we will restrict the data or use the criteria to give us the result of country code equals to afg you can see that we have some records showing the country code AS AFC and we will just put a condition that select from those columns from table City where country code equals to afg and if we run this only the records only the country code having is afg will be listed over here or there would be another condition you can write with and operator where District equals to Kabul k a b o l you can see this is the first record and let's see if we execute this query what is the result it will give us only one record because country code afg and District Kabul and that's why it's restricted to only this particular record so this is how we can use a where condition and where can be used in conjunction with and or different object next ordering the results you can order the result set using order by clause for that the syntax is same until the where Clause if you want to use or you can use order by Clause after the from clause so for example we have select all these columns from table name where we are restricting data for a particular column and order by column n this will give us the result set restricted for column 2 and order by column n you can order by ascending and descending let's see this with the example so for order by let's use the same example which we used to restrict the data here we are restricting the data for country code afg and we will order the records in population order so select all these columns from table City CHAPTERS 0:00 | Introduction 00:23 | BASIC Select Statement 03:10 | WHERE Clause 05:44 | ORDER BY Clause 07:41 | LIMIT Clause 09:56 | LIKE Operator 13:17 | GROUP BY Clause SELECT Statement Everything | SQL Full Course | SQL Tutorial For Beginners

Download

0 formats

No download links available.

SELECT Statement Everything | SQL Full Course | SQL Tutorial For Beginners | NatokHD