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. 1.(5 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 using(accountid) where first- name='John' and lastname='Doe' (e) Other: 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

Step: 3

blur-text-image

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

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

1844804526, 978-1844804528

More Books

Students also viewed these Databases questions

Question

Explain the steps involved in training programmes.

Answered: 1 week ago

Question

What are the need and importance of training ?

Answered: 1 week ago