(31, '978-1-11111-145-1', 1, '2019-11-06', '27.95', NULL, NULL), (32, '978-1-11111-145-1', 1, '2019-11-06', '27.95', NULL, NULL), (33, '978-1-11111-139-1', 2, '2019-11-06', '75.00', '50.00', 9), (34, '978-1-11111-133-1', 1, '2019-11-16', (35, '978-1-11111-126-1', 1, '2019-10-06', '75.00', '75.00', 11), (36, '978-1-11111-130-1', 3, '2018-12-06', (37, '978-1-11111-136-1', 3, '2018-12-06', '75.00', '75.00', 11), (38, '978-1-11111-130-1', 2, '2019-04-06', '200.00', '150.00', 12), (39, '978-1-11111-132-1', 3, '2019-04-06', '75.00', (40, '978-1-11111-129-1', 1, '2012-04-06' (41, '978-1-11111-141-1', 1, '2019-05-16', (42, '978-1-11111-141-1', 1, '2019-05-16', '40.00', '40.00', 14), (43, '978-1-11111-132-1', 1, '2019-11-12', '17.95', NULL, NULL), (44, '978-1-11111-138-1', 1, '2019-11-12', '75.95', NULL, NULL), (45, '978-1-11111-138-1', 1, '2019-11-12', '75.95', NULL, NULL), (46, '978-1-11111-131-1', 3, '2019-11-12', '15.95', NULL, NULL), (47, '978-1-11111-140-1', 3, '2019-11-12', '25.95', NULL, NULL), (48, '978-1-11111-123-1', 2, '2019-08-16', '24.95', NULL, NULL), (49, '978-1-11111-127-1', 2, '2019-08-16', '27.95', NULL, NULL), (50, '978-1-11111-127-1', 2, '2020-01-06', (51, '978-1-11111-141-1', 2, '2020-01-06', '50.00', '50.00', 15), (52, '978-1-11111-141-1', 2, '2020-01-06', '5e.e0', '5e.00', 16), (53, '978-1-11111-123-1', 2, '2020-01-06', (54, '978-1-11111-127-1', 2, '2020-01-06', '40.00', '40.00', 16), (55, '978-1-11111-133-1', 2, '2020-02-06', (56, '978-1-11111-127-1', 2, '2019-02-16' (57, '978-1-11111-135-1', 2, '2019-02-16' (58, '978-1-11111-131-1', 2, '2020-02-16', '25.00', '25.00', 18), (59, '978-1-11111-127-1', 2, '2020-02-25', '35.00', '35.00', 18), (60, '978-1-11111-128-1', 2, '2019-12-16', '50.00', (61, '978-1-11111-136-1', 3, '2019-10-22', '50.00', '50.00', 19), (62, '978-1-11111-115-1', 2, '2019-10-22', '75.00', '75.00', 20), (63, '978-1-11111-130-1', 2, '2019-07-16', '500.00' (64, '978-1-11111-136-1', 2, '2019-03-06', (65, '978-1-11111-136-1', 2, '2019-03-06', '125.00', NULL, NULL), (66, '978-1-11111-137-1', 2, '2019-03-06', '125.00', NULL, NULL), (67, '978-1-11111-137-1', 2, '2019-03-06', '125.00', NULL, NULL), (68, '978-1-11111-138-1', 2, '2019-03-06', '125.00', NULL, NULL), (69, '978-1-11111-138-1', 2, '2019-03-06', '125.00', NULL, NULL), (70, '978-1-11111-139-1', 2, '2019-03-06', 125.00', NULL, NULL), (71, '978-1-11111-139-1', 2, '2019-03-06', '125.00', NULL, NULL); '125.00', '125.00', 10), '50.e0', '50.e0', 11), '25.95' '40.00' '75.00', 12), '25.95', 13), '40.00', 14), '50.00', '50.00', 15), "40.00', '40.e0', 16), *60.00', *40.00' '60.00', 17), '40.00', 17), '40.00', 18), '40.00' *45.00', 19), NULL, NULL), '125.00', NULL, NULL), Table structure for table 'work

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Janice Jones bought three books in May 2018. It was assigned a sale id of 2 in the volume table. Use PARTITION BY to list the ISBNs of those books, the individual selling price, and the total (do this in one query).

CREATE TABLE `volume` (

`inventory_id` int(11) NOT NULL,
`ISBN` char(17) DEFAULT NULL,
`condition_code` int(11) DEFAULT NULL,
`date_acquired` date DEFAULT NULL,
`asking_price` decimal(7,2) DEFAULT NULL,
`selling_price` decimal(7,2) DEFAULT NULL,
`sale_id` int(11) DEFAULT NULL
);

 

*exported_rare_book_store (1).sql - Notepad
File Edit Format View Help
CREATE TABLE `volume` (
inventory_id` int(11) NOT NULL,
`ISBN` char(17) DEFAULT NULL,
condition_code int(11) DEFAULT NULL,
date_acquired` date DEFAULT NULL,
asking_price` decimal(7,2) DEFAULT NULL,
`selling_price decimal(7,2) DEFAULT NULL,
sale_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Dumping data for table `volume
INSERT INTO `volume` (`inventory_id`, `ISBN`, `condition_code`, `date_acquired`, `asking_price`, `selling_price`, `sale_id`) VALUES
(1, '978-1-11111-111-1', 3, '2019-06-12', '175.00', '175.00', 1),
(2, '978-1-11111-131-1', 4, '2019-01-23', '50.00', '50.00', 1),
(3, '978-1-11111-133-1', 2, '2018-04-05', '300.00', '285.00', 1),
(4, '978-1-11111-142-1', 1, '2018-05-05',
(5, '978-1-11111-146-1', 1, '2018-05-05',
(6, '978-1-11111-144-1', 2, '2019-05-15', '80.00', '76.10', 2),
(7, '978-1-11111-137-1', 2, '2019-06-20', '80.00'
(8, '978-1-11111-137-1', 3, '2019-06-20', '50.00',
(9, '978-1-11111-136-1', 1, '2018-12-20', '75.00',
(10, '978-1-11111-136-1', 2, '2018-12-15', '50.00'
(11, '978-1-11111-143-1', 1, '2019-04-05', '25.00', '25.00', 3),
(12, '978-1-11111-132-1', 1, '2019-06-12', '15.00', '15.00', 3),
(13, '978-1-11111-133-1', 3, '2019-04-20',
(14, '978-1-11111-121-1', 2, '2019-04-20', '110.00'
(15, '978-1-11111-121-1', 2, '2019-04-20', '110.00',
(16, '978-1-11111-121-1', 2, '2019-04-20', '110.00'
(17, '978-1-11111-124-1', 2, '2020-01-12', '75.00', NULL, NULL),
(18, '978-1-11111-146-1', 1, '2019-05-11', '30.00', '30.00', 6),
(19, '978-1-11111-122-1', 2, '2019-05-06', '75.00', '75.00', 6),
(20, '978-1-11111-130-1', 2, '2019-04-20', '150.00'
(21, '978-1-11111-126-1', 2, '2019-04-20', '110.00',
(22, '978-1-11111-139-1', 2, '2019-05-16'
(23, '978-1-11111-125-1', 2,
(24, '978-1-11111-131-1', 3, '2019-04-20', '35.00', '35.00', 7),
(25, '978-1-11111-126-1', 2, '2019-11-16',
(27, '978-1-11111-141-1', 1, '2019-11-06', '24.95', NULL, NULL),
(28, '978-1-11111-141-1', 1, '2019-11-06',
(29, '978-1-11111-141-1', 1, '2019-11-06', '24.95', NULL, NULL),
(30, '978-1-11111-145-1', 1, '2019-11-06', '27.95', NULL, NULL),
(31, '978-1-11111-145-1', 1, '2019-11-06',
(32, '978-1-11111-145-1', 1, '2019-11-06', '27.95', NULL, NULL),
(33, '978-1-11111-139-1', 2, '2019-11-06',
(34, '978-1-11111-133-1', 1, '2019-11-16'
(35, '978-1-11111-126-1', 1, '2019-10-06', '75.00', '75.00', 11),
(36, '978-1-11111-130-1', 3, '2018-12-06',
(37, '978-1-11111-136-1', 3, '2018-12-06', '75.00',
'25.95'
'25.95',
2),
'22.95',
'22.95', 2),
NULL, NULL),
NULL, NULL),
NULL, NULL),
NULL, NULL),
'18.00', 3),
'110.00', 3),
'110.00', 5),
NULL, NULL),
'18.00'
6),
'110.00', 6),
'170.00', 6),
' 2019-05-16', '45.00', '45.00', 7),
'120.00',
'200.00'
'35.00', '55.00', 8),
'24.95'
', NULL, NULL),
'27.95', NULL, NULL),
'75.00', '50.00', 9),
'125.00', 10),
'125.00',
'50.00', 11),
'75.00', 11),
'50.00'
Transcribed Image Text:*exported_rare_book_store (1).sql - Notepad File Edit Format View Help CREATE TABLE `volume` ( inventory_id` int(11) NOT NULL, `ISBN` char(17) DEFAULT NULL, condition_code int(11) DEFAULT NULL, date_acquired` date DEFAULT NULL, asking_price` decimal(7,2) DEFAULT NULL, `selling_price decimal(7,2) DEFAULT NULL, sale_id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; Dumping data for table `volume INSERT INTO `volume` (`inventory_id`, `ISBN`, `condition_code`, `date_acquired`, `asking_price`, `selling_price`, `sale_id`) VALUES (1, '978-1-11111-111-1', 3, '2019-06-12', '175.00', '175.00', 1), (2, '978-1-11111-131-1', 4, '2019-01-23', '50.00', '50.00', 1), (3, '978-1-11111-133-1', 2, '2018-04-05', '300.00', '285.00', 1), (4, '978-1-11111-142-1', 1, '2018-05-05', (5, '978-1-11111-146-1', 1, '2018-05-05', (6, '978-1-11111-144-1', 2, '2019-05-15', '80.00', '76.10', 2), (7, '978-1-11111-137-1', 2, '2019-06-20', '80.00' (8, '978-1-11111-137-1', 3, '2019-06-20', '50.00', (9, '978-1-11111-136-1', 1, '2018-12-20', '75.00', (10, '978-1-11111-136-1', 2, '2018-12-15', '50.00' (11, '978-1-11111-143-1', 1, '2019-04-05', '25.00', '25.00', 3), (12, '978-1-11111-132-1', 1, '2019-06-12', '15.00', '15.00', 3), (13, '978-1-11111-133-1', 3, '2019-04-20', (14, '978-1-11111-121-1', 2, '2019-04-20', '110.00' (15, '978-1-11111-121-1', 2, '2019-04-20', '110.00', (16, '978-1-11111-121-1', 2, '2019-04-20', '110.00' (17, '978-1-11111-124-1', 2, '2020-01-12', '75.00', NULL, NULL), (18, '978-1-11111-146-1', 1, '2019-05-11', '30.00', '30.00', 6), (19, '978-1-11111-122-1', 2, '2019-05-06', '75.00', '75.00', 6), (20, '978-1-11111-130-1', 2, '2019-04-20', '150.00' (21, '978-1-11111-126-1', 2, '2019-04-20', '110.00', (22, '978-1-11111-139-1', 2, '2019-05-16' (23, '978-1-11111-125-1', 2, (24, '978-1-11111-131-1', 3, '2019-04-20', '35.00', '35.00', 7), (25, '978-1-11111-126-1', 2, '2019-11-16', (27, '978-1-11111-141-1', 1, '2019-11-06', '24.95', NULL, NULL), (28, '978-1-11111-141-1', 1, '2019-11-06', (29, '978-1-11111-141-1', 1, '2019-11-06', '24.95', NULL, NULL), (30, '978-1-11111-145-1', 1, '2019-11-06', '27.95', NULL, NULL), (31, '978-1-11111-145-1', 1, '2019-11-06', (32, '978-1-11111-145-1', 1, '2019-11-06', '27.95', NULL, NULL), (33, '978-1-11111-139-1', 2, '2019-11-06', (34, '978-1-11111-133-1', 1, '2019-11-16' (35, '978-1-11111-126-1', 1, '2019-10-06', '75.00', '75.00', 11), (36, '978-1-11111-130-1', 3, '2018-12-06', (37, '978-1-11111-136-1', 3, '2018-12-06', '75.00', '25.95' '25.95', 2), '22.95', '22.95', 2), NULL, NULL), NULL, NULL), NULL, NULL), NULL, NULL), '18.00', 3), '110.00', 3), '110.00', 5), NULL, NULL), '18.00' 6), '110.00', 6), '170.00', 6), ' 2019-05-16', '45.00', '45.00', 7), '120.00', '200.00' '35.00', '55.00', 8), '24.95' ', NULL, NULL), '27.95', NULL, NULL), '75.00', '50.00', 9), '125.00', 10), '125.00', '50.00', 11), '75.00', 11), '50.00'
NULL, NULL),
(32, '978-1-11111-145-1', 1, '2019-11-06', '27.95', NULL, NULL),
'75.00', '50.00', 9),
'125.00', 10),
(35, '978-1-11111-126-1', 1, '2019-10-06', '75.00', '75.00', 11),
'50.00', 11),
(37, '978-1-11111-136-1', 3, '2018-12-06', '75.00', '75.00', 11),
'150.00', 12),
'75.00', '75.00', 12),
'25.95', 13),
'40.00', 14),
(42, '978-1-11111-141-1', 1, '2019-05-16', '40.00', '40.00', 14),
(43, '978-1-11111-132-1', 1, '2019-11-12', '17.95', NULL, NULL),
(44, '978-1-11111-138-1', 1, '2019-11-12', '75.95', NULL, NULL),
(45, '978-1-11111-138-1', 1, '2019-11-12', '75.95', NULL, NULL),
(46, '978-1-11111-131-1', 3, '2019-11-12', '15.95', NULL, NULL),
(47, '978-1-11111-140-1', 3, '2019-11-12', '25.95', NULL, NULL),
(48, '978-1-11111-123-1', 2, '2019-08-16', '24.95', NULL, NULL),
(49, '978-1-11111-127-1', 2, '2019-08-16', '27.95', NULL, NULL),
'50.00', '50.00', 15),
(51, '978-1-11111-141-1', 2, '2020-01-06', '50.00', '50.00', 15),
(52, '978-1-11111-141-1', 2, '2020-01-06', '50.00', '50.00', 16),
'40.00', 16),
(54, '978-1-11111-127-1', 2, '2020-01-06', '40.00', '40.00', 16),
'60.00', '60.00', 17),
'40.00', 17),
'40.00',
(31, '978-1-11111-145-1', 1, '2019-11-06',
'27.95',
(33, '978-1-11111-139-1', 2, '2019-11-06',
(34, '978-1-11111-133-1', 1, '2019-11-16',
'125.00'
(36, '978-1-11111-130-1', 3, '2018-12-06', '50.00'
(38, '978-1-11111-130-1', 2, '2019-04-06', '200.00',
(39,
(40, '978-1-11111-129-1', 1, '2012-04-06', '25.95',
(41, '978-1-11111-141-1', 1, '2019-05-16', '40.00',
'978-1-11111-132-1', 3, '2019-04-06'
(50, '978-1-11111-127-1', 2, '2020-01-06'
(53,
'978-1-11111-123-1', 2, '2020-01-06'
'40.00'.
(55, '978-1-11111-133-1', 2, '2020-02-06'
(56, '978-1-11111-127-1', 2, '2019-02-16'.
(57, '978-1-11111-135-1', 2, '2019-02-16',
(58, '978-1-11111-131-1', 2, '2020-02-16', '25.00'
'40.00'
18),
'25.00', 18),
(59, '978-1-11111-127-1', 2, '2020-02-25', '35.00', '35.00', 18),
'45.00', 19),
(61, '978-1-11111-136-1', 3, '2019-10-22', '50.00', '50.00', 19),
(62, '978-1-11111-115-1', 2, '2019-10-22', '75.00', '75.00', 20),
'500.00', NULL, NULL),
'125.00', NULL, NULL),
(65, '978-1-11111-136-1', 2, '2019-03-06', '125.00', NULL, NULL),
(66, '978-1-11111-137-1', 2, '2019-03-06', '125.00', NULL, NULL),
NULL, NULL),
NULL, NULL),
'125.00', NULL, NULL),
'125.00', NULL, NULL),
(71, '978-1-11111-139-1', 2, '2019-03-06', '125.00', NULL, NULL);
'40.00'
(60, '978-1-11111-128-1', 2, '2019-12-16', '50.00'
(63, '978-1-11111-130-1', 2, '2019-07-16'
(64, '978-1-11111-136-1', 2, '2019-03-06'.
(67, '978-1-11111-137-1', 2, '2019-03-06'
(68, '978-1-11111-138-1', 2, '2019-03-06', '125.00'
(69, '978-1-11111-138-1', 2, '2019-03-06'
(70, '978-1-11111-139-1', 2, '2019-03-06'
'125.00'
Table structure for table `work
Transcribed Image Text:NULL, NULL), (32, '978-1-11111-145-1', 1, '2019-11-06', '27.95', NULL, NULL), '75.00', '50.00', 9), '125.00', 10), (35, '978-1-11111-126-1', 1, '2019-10-06', '75.00', '75.00', 11), '50.00', 11), (37, '978-1-11111-136-1', 3, '2018-12-06', '75.00', '75.00', 11), '150.00', 12), '75.00', '75.00', 12), '25.95', 13), '40.00', 14), (42, '978-1-11111-141-1', 1, '2019-05-16', '40.00', '40.00', 14), (43, '978-1-11111-132-1', 1, '2019-11-12', '17.95', NULL, NULL), (44, '978-1-11111-138-1', 1, '2019-11-12', '75.95', NULL, NULL), (45, '978-1-11111-138-1', 1, '2019-11-12', '75.95', NULL, NULL), (46, '978-1-11111-131-1', 3, '2019-11-12', '15.95', NULL, NULL), (47, '978-1-11111-140-1', 3, '2019-11-12', '25.95', NULL, NULL), (48, '978-1-11111-123-1', 2, '2019-08-16', '24.95', NULL, NULL), (49, '978-1-11111-127-1', 2, '2019-08-16', '27.95', NULL, NULL), '50.00', '50.00', 15), (51, '978-1-11111-141-1', 2, '2020-01-06', '50.00', '50.00', 15), (52, '978-1-11111-141-1', 2, '2020-01-06', '50.00', '50.00', 16), '40.00', 16), (54, '978-1-11111-127-1', 2, '2020-01-06', '40.00', '40.00', 16), '60.00', '60.00', 17), '40.00', 17), '40.00', (31, '978-1-11111-145-1', 1, '2019-11-06', '27.95', (33, '978-1-11111-139-1', 2, '2019-11-06', (34, '978-1-11111-133-1', 1, '2019-11-16', '125.00' (36, '978-1-11111-130-1', 3, '2018-12-06', '50.00' (38, '978-1-11111-130-1', 2, '2019-04-06', '200.00', (39, (40, '978-1-11111-129-1', 1, '2012-04-06', '25.95', (41, '978-1-11111-141-1', 1, '2019-05-16', '40.00', '978-1-11111-132-1', 3, '2019-04-06' (50, '978-1-11111-127-1', 2, '2020-01-06' (53, '978-1-11111-123-1', 2, '2020-01-06' '40.00'. (55, '978-1-11111-133-1', 2, '2020-02-06' (56, '978-1-11111-127-1', 2, '2019-02-16'. (57, '978-1-11111-135-1', 2, '2019-02-16', (58, '978-1-11111-131-1', 2, '2020-02-16', '25.00' '40.00' 18), '25.00', 18), (59, '978-1-11111-127-1', 2, '2020-02-25', '35.00', '35.00', 18), '45.00', 19), (61, '978-1-11111-136-1', 3, '2019-10-22', '50.00', '50.00', 19), (62, '978-1-11111-115-1', 2, '2019-10-22', '75.00', '75.00', 20), '500.00', NULL, NULL), '125.00', NULL, NULL), (65, '978-1-11111-136-1', 2, '2019-03-06', '125.00', NULL, NULL), (66, '978-1-11111-137-1', 2, '2019-03-06', '125.00', NULL, NULL), NULL, NULL), NULL, NULL), '125.00', NULL, NULL), '125.00', NULL, NULL), (71, '978-1-11111-139-1', 2, '2019-03-06', '125.00', NULL, NULL); '40.00' (60, '978-1-11111-128-1', 2, '2019-12-16', '50.00' (63, '978-1-11111-130-1', 2, '2019-07-16' (64, '978-1-11111-136-1', 2, '2019-03-06'. (67, '978-1-11111-137-1', 2, '2019-03-06' (68, '978-1-11111-138-1', 2, '2019-03-06', '125.00' (69, '978-1-11111-138-1', 2, '2019-03-06' (70, '978-1-11111-139-1', 2, '2019-03-06' '125.00' Table structure for table `work
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY