Selecting Display Fields and Specifying the Data Source
Explore how to select specific columns using the SQL SELECT clause and specify data sources with FROM. Discover techniques to reorder fields, select all columns by name, and use SELECT * efficiently while understanding its limitations.
We'll cover the following...
Selecting specific display fields
Let’s assume that the following dataset is stored in a relational database table named SalesData.
We want to generate the following report:
Let’s start with finding the answer to the first question:
(Select all that apply.) What are the fields/attributes we want to show in our result set? Multi-select
SaleID
SalesPerson
ProductCategory
SaleDate
ProductName
SalesAmount
When creating an SQL query, the goal is to precisely select the necessary information. Often, it’s as straightforward as shown in this exercise. Yet, occasionally, it can also be quite challenging!
Let’s answer the following question:
Below is a list of keywords. Your task is to choose the keyword that corresponds to retrieving the identified field in the result set:
SalesPerson, SalesData, ProductName, SalesAmount
FROM
SELECT
WHERE
Now let’s answer the ...