Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MySQL - Please provide screenshot /******************************************************** * This script creates the database named my_guitar_shop *********************************************************/ DROP DATABASE IF EXISTS cs431_music_store; CREATE DATABASE cs431_music_store; USE cs431_music_store;

image text in transcribedimage text in transcribed

MySQL - Please provide screenshot

/******************************************************** * This script creates the database named my_guitar_shop *********************************************************/

DROP DATABASE IF EXISTS cs431_music_store; CREATE DATABASE cs431_music_store; USE cs431_music_store;

-- create the tables for the database CREATE TABLE categories ( category_id INT PRIMARY KEY AUTO_INCREMENT, category_name VARCHAR(255) NOT NULL UNIQUE );

CREATE TABLE instruments ( instrument_id INT PRIMARY KEY AUTO_INCREMENT, category_id INT NOT NULL, instrument_code VARCHAR(10) NOT NULL UNIQUE, instrument_name VARCHAR(255) NOT NULL, description TEXT NOT NULL, list_price DECIMAL(10,2) NOT NULL, discount_percent DECIMAL(10,2) NOT NULL DEFAULT 0.00, date_added DATETIME DEFAULT NULL, CONSTRAINT instruments_fk_categories FOREIGN KEY (category_id) REFERENCES categories (category_id) );

1. Write a SELECT statement that returns these columns from the Instruments table: instrument_name, list_price, date_added Return only the rows with a list price that's greater than 500 and less than 2000. Sort the result set by the date_added column in descending sequence. This should return 5 rows. A1 x fx Query 1 A B 1 Query 1 instrument_name list_price date_added 2018-07-30 13:14:15 3 2 Yamaha PSR- 799.99 SX900 61-key High- Level Arranger Keyboard 3 Roland FANTOM-6 699.99 Music Workstation 4 Keyboard Etude EAS-100 799.99 Student Alto Saxophone 5 Lacquer Gibson Les Paul 1199.00 2018-07-30 12:46:40 2018-06-01 11:29:35 5 2017-12-05 16:33:13 6 699.00 Fender Stratocaster 2017-10-30 09:32:40 7

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago