Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For the below questions, use the following schema definition. account ( accountid , username, firstname, lastname ) digitalasset ( assetid , description, dollarprice ) transaction

For the below questions, use the following schema definition. account (accountid, username, firstname, lastname) digitalasset (assetid, description, dollarprice) transaction (tranid, accountid, timstamp) transactiondetail (tranid, assetid,qty.price) It is a schema for a digital-asset store, with accounts, digitalassets, and transactions that link accounts to digitalassets. Each transaction can have multiple items, which are in transactiondetail table. Pick the best answer that fits the question. Not all of the answers may be correct. If none of the answers fit, write your own answer. 2.(5 points) Find the average price of a digitalasset. (a) select avg(price) from transactiondetail (b) select avg(dollarprice) from digitalasset (c) select avg(qty*dollarprice) from digitalasset (d) select avg(price) from digitalasset (e) Other: 3.(5 points) Find number of transactions by account. (a) select accountid,count(*) from transaction natural inner join transactiondetail group by accountid (b) select assetid,count(*) from transactiondetail group by assetid (c) select tranid,count(*) from transactiondetail group by tranid (d) select accountid,count(*) from transaction group by accountid (e) Other: 4.(5 points) Find names (descriptions) of all digital assets ever purchased by 'John Doe'. (a) select count(*) from account a natural inner join transaction b natural inner join transac- tiondetail c where a.lastname='Doe' and a.firstname='John' (b) select description from account a natural inner join transaction b natural inner join transac- tiondetail c natural inner join digitalasset d where a.lastname='Doe' and a.firstname='John' group by description

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions