Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use SQL Developer to write the queries below. Write a query that displays the first name and last name of each author with the

Please use SQL Developer to write the queries below.

Write a query that displays the first name and last name of each author with the first letters capitalized. Display the first name left justified (lined up on the left) with 12 characters and the last name right justified (lined up on the right) with 12 characters. Use aliases for the column headings and blanks to pad the data in the columns. You will need to nest one function inside another one.

Write a query that shows the first and last name of each customer and whether or not the customer was referred by another customer. If they were referred, display "Referred," and if not, display "Not Referred."

Write a SQL query that displays the full name of the day of the week, the hour, minutes and seconds of the computer you are using.

Determine the amount of profit for order number 1004. Include the book title and the profit, with the profit formatted as dollars and cents. Use the paideach and cost columns to calculate the profit, and make sure to use the quantity purchased in case there was more than one copy of the book purchased.

Using today's date, determine the length of time in months since each book was published. Display the title and publication date along with the number of months. Do not show fractional months, only whole numbers. Use an alias for the length of time.

Required Script:

CREATE TABLE suppliers (sup_name VARCHAR2(20), description VARCHAR2(100) ); INSERT INTO suppliers VALUES ('Second Hand Reads', 'wholesaler of used books only, located in Chicago, 634.555-8787'); INSERT INTO suppliers VALUES ('Leftovers', 'Physical store location, located in Seattle, willing to fill referred sales, sales@leftovers.com'); INSERT INTO suppliers VALUES ('Read Again', 'Chain of used book store fronts, seeking online sales partner, located in western U.S., 919-555-3333'); INSERT INTO suppliers VALUES ('Bind Savers', 'Used book wholsaler, stock includes international titles, 402-555-2323'); INSERT INTO suppliers VALUES ('Book Recyclers', 'Used book chain, located in Canada, large volume of sales, 888.555.5204'); INSERT INTO suppliers VALUES ('Page Shock', 'Book wholsaler for specialty books and graphic novels, help@pageshock.com'); INSERT INTO suppliers VALUES ('RePage', 'Used book vendor, only wholesales, Wash D.C., 555-0122'); COMMIT; CREATE TABLE contacts (name VARCHAR2(40)); INSERT INTO contacts VALUES('LaFodant,Mike,934-555-3493'); INSERT INTO contacts VALUES('Harris,Annette,727-555-2739'); INSERT INTO contacts VALUES('Crew,Ben,352-555-3638'); COMMIT;

There is no other information provided for this assignment, table structure is not provided.

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

More Books

Students also viewed these Databases questions

Question

Azure Analytics is a suite made up of which three tools?

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago