How to run this SQL

Tags:
SQL
SSMS
  • Display Product Id (obtained by replacing ‘PR’ into ‘Product ’ of ProductId), Product Name (obtained from product name in uppercase format), MaterialName, and Average Product Purchased (obtained from average quantity of product purchased) for product which price is more than 20000 and Average Product Purchased is greater than average of all sales transaction quantity.
(alias subquery)
  • Display DistributorName, Distributor Phone (obtained from replace ‘08’ to ‘+628’ on DistributorPhone), DistributorAddress, and PurchaseDate for every distributor whose handle purchase transaction with the most variant product in a purchase transaction.
(alias subquery) Can you give me the query to answer this please?


Software/Hardware used:
ssms
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Subhendu Sen
    Have you written some code? You asked for that? At least have you tried for that? First you can try to write the SQL according to your knowledge and then back here if there is something wrong.
    140,020 pointsBadges:
    report
  • Subhendu Sen
    Assuming you know the SQL coding. You can link here for various SQL syntax & concepts: https://www.w3schools.com/sql/.
    140,020 pointsBadges:
    report
  • ToddN2000
    Sounds like a class assignment. Try it and if you cannot figure it out, post your code and we can help you straighten it out. Right now we have no clue what the table names are.
    133,595 pointsBadges:
    report
  • TheRealRaven
    Without table definitions, there's no useful way to guess about SQL. There's no way even to know for certain if SQL is appropriate for this. Please provide enough detail for us to comment.
    35,600 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: