Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a query that displays the title, ISBN, and retail price of books whose list prices is more than the average of all books.

1. Write a query that displays the title, ISBN, and retail price of books whose list prices is more than the average of all books. Format the retail price with dollars and cents.

2. Write a query that displays the title and publication date of the newest book in the BOOKS table. Format the date with the complete name of the month and a comma after the day of the month, like "January 3, 2011."

3. Write a query that shows the title(s) of the book or books most frequently purchased by the customers in the database.

4. Write a query that displays the names of the customers who purchased the book with the highest retail price in the database. Capitalize the first and last names.

5. Write a query that displays the first name and last name of each author along with the number of books he or she has written. Capitalize the first and last names.

Create Table department

(deptno NUMBER(2),

dname VARCHAR2(20));

INSERT INTO department

VALUES (10, 'General Admin');

INSERT INTO department

VALUES (20, 'Engineering');

INSERT INTO department

VALUES (30, 'Support');

Create table Books_1

(ISBN VARCHAR2(10),

Title VARCHAR2(30),

PubDate DATE,

Retail NUMBER (5,2),

Category VARCHAR2(12),

CONSTRAINT books_1_isbn_pk PRIMARY KEY(isbn));

INSERT INTO BOOKS_1

VALUES ('8843172113','DATABASE IMPLEMENTATION','04-JUN-05',55.95, 'COMPUTER');

INSERT INTO BOOKS_1

VALUES ('3437212490','COOKING WITH MUSHROOMS','28-FEB-06',19.95, 'COOKING'); INSERT INTO BOOKS_1

VALUES ('3957136468','HOLY GRAIL OF ORACLE','31-DEC-05',65.95, 'BUSINESS');

COMMIT;

Create table Books_2

(ISBN VARCHAR2(10),

Title VARCHAR2(30),

PubDate DATE,

Retail NUMBER (5,2),

Category VARCHAR2(12),

CONSTRAINT books_2_isbn_pk PRIMARY KEY(isbn));

INSERT INTO BOOKS_2

VALUES ('8843172113','DATABASE IMPLEMENTATION','04-JUN-05',55.95, 'COMPUTER');

INSERT INTO BOOKS_2

VALUES ('3437212490','COOKING WITH MUSHROOMS','28-FEB-06',29.95, 'COOKING');

INSERT INTO BOOKS_2

VALUES ('3957136468','HOLY GRAIL OF ORACLE','31-DEC-05',75.95, 'COMPUTER');

INSERT INTO BOOKS_2

VALUES ('1915762492','HANDCRANKED COMPUTERS','21-JAN-05',25.00, 'COMPUTER');

INSERT INTO BOOKS_2

VALUES ('0299282519','THE WOK WAY TO COOK','11-SEP-00',28.75, 'COOKING');

COMMIT;

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_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions