The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
I need SQL help. Â Database .txt file attached
-- Q5 (10pt) List the ten most prolific authors (full name, number of books written).
-- Q6 (10pt) List the authors (full name, number of copies) that have a number of copies in store above the average.
-- Q7 (10pt) Create a promo list for the less than $20 books (title, price, number of copies, promotional price) in which every book is discounted 50%
-- when there are at least two (2) copies in stock and not in excellent conditions (i.e. don't discount the copy in excellent conditions)
-- Q8 (10pt)List the publisher's information (code, name, city, number of books) publishers with the second most published books.
Â
CREATE DATABASE HENRY;USE HENRY;CREATE TABLE Author(AuthorNum DECIMAL(2,0) PRIMARY KEY,AuthorLast CHAR(12),AuthorFirst CHAR(10) );CREATE TABLE Book(BookCode CHAR(4) PRIMARY KEY,Title CHAR(40),PublisherCode CHAR(3),Type CHAR(3),Paperback CHAR(1) );CREATE TABLE Branch(BranchNum DECIMAL(2,0) PRIMARY KEY,BranchName CHAR(50),BranchLocation CHAR(50) );CREATE TABLE Copy(BookCode CHAR(4),BranchNum DECIMAL(2,0),CopyNum DECIMAL(2,0),Quality CHAR(20),Price DECIMAL(8,2),PRIMARY KEY (BookCode, BranchNum, CopyNum) );CREATE TABLE Publisher(PublisherCode CHAR(3) PRIMARY KEY,PublisherName CHAR(25),City CHAR(20) );CREATE TABLE Wrote(BookCode CHAR(4),AuthorNum DECIMAL(2,0),Sequence DECIMAL(2,0),PRIMARY KEY (BookCode, AuthorNum) );INSERT INTO AuthorVALUES(1,'Morrison','Toni');INSERT INTO AuthorVALUES(2,'Solotaroff','Paul');INSERT INTO AuthorVALUES(3,'Vintage','Vernor');INSERT INTO AuthorVALUES(4,'Francis','Dick');INSERT INTO AuthorVALUES(5,'Straub','Peter');INSERT INTO AuthorVALUES(6,'King','Stephen');
Attachments:
-----------