In this video we will learn
1. Select specific or all columns
2. Distinct rows
3. Filtering with where clause.
4. Wild Cards in SQL Server
5. Joining multiple conditions using AND and OR operators
6. Sorting rows using order by
7. Selecting top n or top n percentage of rows
Text version of the video
All SQL Server Text Articles
All SQL Server Slides
All Dot Net and SQL Server Tutorials in English
All Dot Net and SQL Server Tutorials in Arabic
Hi Venkat ,
By using IN operator we can able to get Records at time multiple Integer columns values. But What about character columns. I m not able to get the character columns (varchar data type columns) When I am going using IN Operator. If we have an any another operator, Plzzzz clarify me.
Hi Friends, There is no mistake in result BUT example was incorrect . Example should be something like this, if two person has same name i.e. JOSH one with age 24 and another with age 27. Name column is sorted in DESC order and age is in ASC order then JOSH with age 24 will get first priority and THEN JOSH with age 27 will come (Name DESC order and AGE is in ASC order). If there is same name then it will look for age in ASC order.
For starters, it depends on how your db server was set up in the Server Properties, General, Server Collation. If you have a scheme like "SQL_Latin1_General_CP1_CI_AS" then it is: (CP1) Code Page 1252 characters, and searches are Case Insensitive and Accent Sensitive.
Venkat, Your videos are awesome. Thank you so much. Can you pleses upload all the ppts alone somewhere. This will help us a quick recap day before interview. Going through all videos just before interview is not possible.
Hello Dear Aswathi,
The image version of the slides are available on my blog at no cost.
However, if you want to download all the original PPTs, you can order them from the following link. Hope you will find them useful.
I've notice you said something on using order by so that you can you use it on more than one column,
i.e. name desc,age asc.
but in the example I saw there was different input so I am not sure it truly explained I mean to the part close to the end in the 18th min. aprox.
What do you think?
I think he meant it like, that you can order items by more arguments. For instance, first you order them by NAME, but, if there are more items with same name, than they will be ordered by second argument, in this case AGE...
I hope we are speaking about same thing :)
At 15:04 I think it is important to note that the only reason why he was able to use this SQL code: Select * from tblPerson Where Name LIKE [MST%] to select the people whose name start with M, S, or T is because the names in the Name column in tblPerson all start with a **SINGLE** capital letter. So if either capital M, S , or T is in the name then it will be selected. But for example if you had a name like bMSTj (Completely made up name :)) then that query would still Select this name since the character list MST is present in bMSTj.
Your tutorials are awesome, keep up the good work! But I would like to point a small mistake; when you are talking about sorting asc and desc, there is JOSH and JOHN, not Josh x2. Following that, "age asc" is not applied in this particular example, since we don't have any of the names repeated.
Thanks for that, was watching in small window and just took him saying that the names were the same for granted and couldn't figure out why the 29 was above the 20 if they were supposedly in ascending order.
+Ankaj Jha Here is a solution for even:
Select * from MyTable where MyNumberColumn % 2 == 0
here is for odd:
Select * from MyTable where MyNumberColumn % 2 == 1
MyTable is the table you want to select from, and MyNumberColumn is the column with numbers, from which you want to filter either odd or even numbers.
Hope it helped
I have a question in this part 10 video you have given an example where we can sort on two columns. I don't think so this will work if we look into the output. I think practically its not possible?. Could you please confirm on this?
Thanks in Advance.
Awesome! channel, I need your help. I have a web form that surfaces data based on a phone number from my Microsoft SQL DB 2008. I would like for people to have to put their first name in and their phone number before any data surfaces on the screen??? Please help or suggest a resource...
Hi Vankut, You are simply awesome. Your ways of presentation connect to anyone with little or no knowledge of the technology you are teaching. I wish you all the best for your continuous support to the beginners like me. God bless you. :)
Hi Venkat, I have a doubt here. Could u tell me... among order by and top (say top 10) which one has the priority. I mean will the rows be ordered first and then top 10 are picked up. Or will top 10 be picked up and then ordered. Imagine the data in table is in disordered randomly.
Ya... Its not. He said josh is repeated twice and the age is given in ascending, but it is not it is josh and john which are two different names. Before adding age ascending and after the result is same.
Check out the link above but the accepted answer Ignacio Vazquez-Abrams says:
Select * from tblPerson order by Name DESC, Age ASC:
Sorts everything by Name (descending) first, and then by column2 (ascending) whenever the Name fields for two rows are equal.
Hey Venkat, I am taking this lessons of yours / 10th of 68 atm / and I ´ve feel I should say thanks for all these lessons..
Very nice of you that you made it free of charge.. and with this all support of yours.
Sending best regards from Slovakia,
Thank you very much for taking time to give feedback. In the description of this video, I have included the link for ASP .NET, C#, and SQL Server playlists. All the videos are arranged in logical sequence in these playlists, which could be useful to you. Please share the link with your friends who you think would also benefit from them. If you like these videos, please click on the THUMBS UP button below the video. For email alerts, when new videos are uploaded, you may subscribe to my channel.
Hi Venkat, I have a question in DISTINCT. Here is how my table looks like[ID Name City] [1 ubaidh pune] [2 hajra Mumbai ] [3 Misbah Goa] [4 pune pune] Now if i fire this query "select distinct name,city from table1" i get the following result [hajra Mumbai] [Misbah Goa] [pune pune] [ubaidh pune]. But in the video you said that DISTINCT on multiple columns will give value distinct across the 2 columns but in the 3rd record you can see i have [pune pune] in both columns. Can u please explain
First of all, great videos, very usefuls and very well organizeds. Keep on make this good work.
But this one in particular you have a bug on the AND OR operators.
You have city='Mumabi' instead of Mumbai and the table as only one record with age > 25 so that particular query allways return only one row.
Hi Rajiv, if you have the rows matching with what you have in the where clause, then you should get data. Can you please share your query and the data in one or two rows of your table that you are querying. Without looking at the table and the query I wouldn't be able to tell what's wrong. Good Luck.
Hi Rajiv, escape the single quote with another single quote. So, your query will be something like this - Select * from TableName where ColumnName in ('40'' Standard Dry','20'' Standard Dry'). Hope this helps. If you want to receive email alerts, when new videos are uploaded, please feel free to subscribe to my youtube channel. May I ask you for a favour. I want these tutorials to be helpful for as many people as possible. Please share with your friends and family.
Dear sir, how could we give in command if the data type is something like 20' standard dry or any data has a ' sign? for example i gave one command like this,
select * from shipment data where container type name in (40' Standard Dry, 20' Standard Dry)
will not be executed while i tried... please help me
Thanks for your time and efforts in creating such videos. Your teaching style is really amazing. I'm a oracle programming but wanted to Learn SQL Server. This learning by doing and examples makes it much easier. Once I complete this SQL Server tutorial, I'm looking forward to get into your .net tutorial which I'm sure would be a wonderful resource for a .net beginner like me.
Hello Venkat...Thanks for the great video tutorial series..I like your way of teaching...really I became your follower..I am practicing your all video tutorials step by step..waiting for your more tutorials ...once again thanks lots for your very great and useful tutorials....keep it up :)
Hi Venkat! Thanks very much for these videos, they're really helpful. Just thought it was worth mentioning that using the != operator in a query doesn't return NULL values in the selected column. It appears that NULLs require special handling in SQL and I hope this gets covered in a future video :)
Hi, great job! but funny mistake @18:20. I wondered why this AGE column isn't realy in ASC order like You said. The answer is: there aren't Josh and Josh but Josh and John, it takes me some time to realize it :)
Hi Venkat, Real big thanks for videos they are really helpful. can you cover examples on selection the 2ND highest salary from tables using triggers and also concatenating the date according to persons date of birth i.e. (if we enter person's DOB,The present age of the person with days should be returned )
Learning how to draw cartoon animals from the farm is not such a difficult task! Weve grown up surrounded by them! Farm animals are everywhere: In blockbuster movies, childs books, greeting cards. their shapes and images are printed in our minds!
In this section, I will show you how to determine what are the physical uniqueness of each animal and how to work with them. Then, you can practice drawing each cartoon character using basic shapes.
You will have the opportunity to make nice illustrations, practice sketching and cartooning using short easy lessons and complete your creation using a drawing software to create vector art if you want to! Cartoon drawing is really fun once you get into it!
Dont be afraid to try until you get it right. This method is really simple, but requires practice and observation. So, sit back and relax. Learn how to draw animals from the farm and start your journey on a good note!
Lets try s few basic characters to get started! :)
A cute turkey to begin with.
In this first tutorial, you can learn how to draw a fun turkey mostly made from small rectangles and large circular shapes. The posture of the character is really interesting. Not only is it easier to draw than a front version, but its also easier to add some perspective (as we can see with the legs). The fact that we just need to draw one wing is also interesting.
Most of these cartoon animals are not filled with complex textures or digital effects. In this case, the subject is filled with plain colors and only a few basic details (inside the tail) were added.
A nice turtle also from a side view.