Coder Social home page Coder Social logo

adventureworks's Introduction

Adventureworks Logo

Exploring the Adventureworks dataset using AZURE Data Studio

25 Excersises out of 81 (can be found on w3resource.com)

30

Preview (1 - 5):

Excersise 1

From the following table write a query in SQL to retrieve all rows and columns from the employee table in the Adventureworks database. Sort the result set in ascending order on jobtitle.

Sample table: humanresources.employee

SELECT *
FROM humanresources.employee
ORDER BY JobTitle;

Excersise 2

From the following table write a query in SQL to retrieve all rows and columns from the employee table using table aliasing in the Adventureworks database. Sort the output in ascending order on lastname.

Sample table: person.person

SELECT Q2.*
FROM Person.Person AS Q2
ORDER BY LastName;

Excersise 3

From the following table write a query in SQL to return all rows and a subset of the columns (FirstName, LastName, businessentityid) from the person table in the AdventureWorks database. The third column heading is renamed to Employee_id. Arranged the output in ascending order by lastname.

Sample table: person.person

SELECT FirstName
    , LastName
    , BusinessEntityID AS Employee_id
FROM Person.Person
ORDER BY LastName;

Excersise 4

From the following table write a query in SQL to return only the rows for product that have a sellstartdate that is not NULL and a productline of 'T'. Return productid, productnumber, and name. Arranged the output in ascending order on name.

Sample table: production.product

SELECT ProductID
    , ProductNumber
    , Name
FROM Production.Product
WHERE SellStartDate IS NOT NULL
    AND ProductLine = 'T'
ORDER BY Name;

Excersise 5

From the following table write a query in SQL to return all rows from the salesorderheader table in Adventureworks database and calculate the percentage of tax on the subtotal have decided. Return salesorderid, customerid, orderdate, subtotal, percentage of tax column. Arranged the result set in ascending order on subtotal.

Sample table: sales.salesorderheader

SELECT SalesOrderID
    , CustomerID
    , OrderDate
    , SubTotal
    , (TaxAmt / SubTotal) * 100 AS TaxPercent
FROM Sales.SalesOrderHeader
ORDER BY SubTotal DESC;

adventureworks's People

Contributors

tareqhaboukh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.