Explore BrainMass
Share

Explore BrainMass

    SQL Statement for Retrieving Data

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Please provide the answer in the order that need to run the script without an error.

    Using the Northwind database, write a SQL SELECT statement that will retrieve the data for the following questions:

    ** Please refer to attachment for the full question description **

    © BrainMass Inc. brainmass.com October 10, 2019, 4:59 am ad1c9bdddf
    https://brainmass.com/computer-science/sql/sql-statement-retrieving-data-487624

    Attachments

    Solution Preview

    ** Please see the attachment for a complete solution **

    Thanks

    --10 SQL Statements
    --Details: Using the Northwind database, write a SQL SELECT statement that will retrieve the data for the following questions:
    USE [Northwind]
    GO

    --1. Display the character constant 'Greeting' with a column heading of 'Hello.'

    SELECT 'Greeting' AS 'Hello.'
    GO
    --o 1 row returned.
    --2. Display all data from the categories tables without specifying the names of the table columns. Order the results by CategoryName.
    SELECT *
    FROM dbo.Categories
    ORDER BY CategoryName

    GO
    --o 8 rows returned.
    --3. Display all employees' names, last name first, and then first name, hire date and home phone number. Order the results by employee name,
    ---last name first, and then first name.

    SELECT [FirstName]
    ,[LastName]
    ,[HireDate]
    ,[HomePhone]
    FROM [dbo].[Employees]
    ORDER BY [LastName] ,[FirstName]

    GO
    --o 9 rows returned.

    --4. Modify query 3 so that the ...

    Solution Summary

    This solution shows how to run a script without an error.

    $2.19