4. The SELECT Statement
Activity 4.01: Displaying Particular Columns from the Table
Solution:
- In the
New Query
window, switch to thePACKT_ONLINE_SHOP
database:USE PACKT_ONLINE_SHOP
- Write the following query, to extract the required data, in the desired format:
SELECT FirstName as 'First Name', LastName as 'Last Name', Phone as 'Phone Number' FROM Customers
- Run the query. Your output should be as follows:
The query will list all the rows of the FirstName
, LastName
, Phone
columns renamed as First Name
, Last Name
, and Phone Number
.
Activity 4.02: Extracting the Top Five Highest Paid Items
Solution:
- Execute the following query:
SELECT Products.ProductName as 'Product Name', Products.NetRetailPrice as 'Product Retail Price', Products.AvailableQuantity as &apos...