From the course: Complete Guide to T-SQL for Data Analysts by Microsoft Press

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Basic SQL

Basic SQL

- [Instructor] All right, in this sub-lesson, we are going to look at basic SQL. So we're going to start diving into some of the individual clauses now. So, first, we'll take a look at the SELECT clause. Its purpose is, it retrieves rows and columns from one or more tables or views in a SQL Server database. It's the core of most queries. So we have the general syntax on the screen there where we can see we have the SELECT statement followed by the ALL keyword or DISTINCT, we'll discuss both later on. We can also add in a TOP ( expression ), or percentage, or WITH TIES, so if we have a situation where we want to get the top X number of rows from a result set with some different criteria. Once again, we'll talk about those ones as well, but this is our general SELECT clause criteria. Next, we'll take a look at the FROM clause. The FROM clause is usually required on the SELECT statement. It specifies the data source for a…

Contents