Answered step by step
Verified Expert Solution
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,qtyprice It is a schema for a digitalasset 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.
points Find account id of John Doe. a select lastname,firstname from account where firstname'John' and lastname'Doe' b select accountid from transaction where firstname'John' and lastname'Doe' c select accountid from account where firstname'John' and lastname'Doe' d select accountid from account inner join transactiondetail usingaccountid where first name'John' and lastname'Doe' e Other:
points Find the average price of a digitalasset. a select avgprice from transactiondetail b select avgdollarprice from digitalasset c select avgqtydollarprice from digitalasset d select avgprice from digitalasset e Other:
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:
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 alastname'Doe' and afirstname'John' b select description from account a natural inner join transaction b natural inner join transac tiondetail c natural inner join digitalasset d where alastname'Doe' and afirstname'John' group by description c select description from account a natural inner join digitalasset d where alastname'Doe and afirstname'John' group by description d select distinct description from account a natural inner join digitalasset d where alastname"Don and afirstname'John' e Other:
points Find all transactions that total more than $a select tranid from transaction a natural inner join transactiondetail b group by tranid having sumqtyprice ntials b select tranid from transaction a natural inner join transactiondetail b where qtyprice group by tranid c select tranid from account a inner join transaction a natural inner join transactiondetail b where qtyprice group by tranid d select tranid from transactiondetail b where qtyprice e Other:
points Find accounts who have never purchased anything. a select a from account a natural inner join transaction b where btranid is null b select a from account a left join transactiondetail b on aaccountidbaccountid where btranidc select a from account a inner join transaction b on aaccountidbaccountid where btranid d select a from account a natural left outer join transaction b where btranid is null e Other::
points Find top accounts who spent the most in a select top accountid from transaction a natural inner join transactiondetail b where timstamp and timstamp b select accountid from transaction a natural inner join transactiondetail b where timstamp and timstamp order by sumqtyprice desc c select accountid,rownumber over order by sumqtyprice desc rn from transaction a natural inner join transactiondetail b where timstamp and timstamp and rn d select accountid,sumqtyprice v from transaction a natural inner join transactiondetail b where timstamp and timstamp group by accountid order by desc limit e Other:
points What is the most appropriate in a Btree Index b Bitmap Index c Clustered Index account.username fieldd Bitmap Clustered Index e Other:
points What is the most appropriate index for digitalasset.description field? pione a Btree Index b Bitmap Index c Clustered Index d Bitmap Clustered Index e Other:
points What is the most appropriate index for digitalasset.assetid field? a Btree Index b Bitmap Index c Clustered Index d Bitmap Clustered Index e Other:
points The below code tip: write out the first few output numbers: yola il coll with recursive nn as select n union all select n from n where n berolineas nie goe select an from n a left join n b on bn sqrtan group by an having an or min an bn accounts nick a Is invalid b Will generate a list of number
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started