Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write an SQL query that will return the most a book has been sold for exported_rare_book_stora 1.9l Notepad Fic Cdit exported rare bookstore (Tel. Notepad
Write an SQL query that will return the most a book has been sold forexported_rare_book_stora 1.9l Notepad Fic Cdit
"exported rare bookstore (Tel. Notepad File Edit Format View Hela -- Teble structure for table 'euther CREATE TABLE 'author" author_numb int(11) NOT NULL, author_last_first char(128) DEFAULT NULL ) ENGINE-INNODB DEFAULT CHARSET-utf8mb4; -- Dumping data for table "author INSERT INTO `author`author_numb", "author_last_First) VALUES (1, 'Bronte, Charlotte'). (2, 'Doyle, Sir Arthur Conan'), (3, 'Twain, Mark'), (4, Stevenson, Robert Louis'), (5, 'Rand, Ayn), (6, 'Barrie, Janes'), (7, "Ludlum, Robert'), (8, 'Barth, John'), (9, "Herbert, Frank'), (10, 'Asimov, Isaac'), (11, 'Funke, Cornelia'), (12, 'Stephenson, Neal'); -- Teble structure for table 'book CREATE TABLE 'book ( ISBN char (17) NOT NULL, work_numb int(11) DEFAULT NULL, publisher_id' int(11) DEFAULT NULL, 'edition int(11) DEFAULT NULL, "binding char(20) DEFAULT NULL, copyright_year' char(4) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utfAmb4; Dumping data for table 'book' INSERT INTO `book (158N', 'work_numb', 'publisher_id', 'edition', 'binding', 'copyright_year') VALUES ('978-1-11111-111-1', 1, 1, 2, 'Board', '1857'), ('978-1-11111-112-1', 1, 1, 1, 'Board', '1847'), ('978-1-11111-113-1, 2, 4, 1, 'Board', '1842'). ('978-1-11111-114-1', 3, 4, 1, 'Board', '1801'), ('978-1-11111-115-1', 3, 4, 10, 'Leather', '1925'), ('978-1-11111-116-1', 4, 3, 1, 'Board', '1805'), (1978-1-11111-117-1', 5, 5, 1, 'Board', 1808"), ('978-1-11111-118-1', 5, 2, 19, 'Leather', '1956'), eported_Gara_bank_store). Notapad Fic Edit Format Vic Fielp - Dumping data for table 'book -- INSERT INTO `book (ISON', 'work_numb', 'publisher_id', 'edition, 'binding, 'copyright_year') VALUES ('978-1-11111-111-1', 1, 1, 2, Board', '1957'), ('978-1-11111-112-1', 1, 1, 1, 'Board', '1947'), ('978-1-11111-112-1', 2, 4, 1, 'Board', '1942), ('978-1-11111-114-1, 3, 4, 1, 'Board', '1801'), ('978-1-11111-115-1', 3, 4, 18, 'Leather', '1925'). ('978-1-11111-116-1', 4, 3, 1, 'Board', '1895), ('978-1-11111-117-1', 5, 5, 1, 'Board', '1808'), 1978-1-11111-11R-1 5.2.19 Leather! 1056 ('978-1-11111-118-1', 5, 2, 19, 'Leather', '1956'), ('978-1-11111-119-1', 6, 2, 3, 'Board', '1956'), ('978-1-11111-120-1', 3, 4, 5, 'Board', '1996'), ('978-1-11111-121-1', 8, 1, 12, 'Leather', * 1982'>, ('978-1-11111-122-1', 9, 1, 12, 'Leather', '1982'), ('978-1-11111-122-1', 11, 2, 1, 'Boerd', '1988'), ('978-1-11111-124-1', 12, 2, 1, 'Board', '1989), ('978-1-11111-125-1', 13, 2, 3, 'Board', '1965), (1978-1-11111-126-1', 13, 2, 9, 'Leather', '2001). (978-1-11111-127-1', 14, 2, 1, 'Board', '1960), ('978-1-11111-128-1', 16, 2, 12, 'Board', '1968), ('978-1-11111-129-1', 16, 2, 14, 'Leather', '2002'), ('978-1-11111-130-1', 17, 3, 6, 'Leather', '1985'), ('978-1-11111-131-1', 18, 4, 6, 'Board', '1957'), ('978-1-11111-132-1', 19, 4, 1, 'Boerd', '1962'), (978-1-11111-133-1', ze, 4, 1, 'Board', '1964'), ('978-1-11111-134-1', 21, 5, 1, 'Boerd', '1964), (978-1-11111-135-1', 22, 5, 1, 'Board', '1962'), ('978-1-11111-126-1, 22, 5, 4, "Leather', '2001), ('978-1-11111-127-1', 24, 5, 4, "Leather', '2881'), ('978-1-11111-138-1', 23, 5, 4, 'Leather', '2001), ('978-1-11111-139-1', 25, 5, 4, 'Leather', '2001'). ('978-1-11111-140-1', 26, 5, 1, 'Board" 2001), ('978-1-11111-141-1', 27, 5, 1, 'Board 2005 ('978-1-11111-142-1', 28, 5, 1, 'Board 2008'), ('978-1-11111-143-1', 29, 5, 1, 'Board', '1992), ('978-1-11111-144-1', 30, 1, 1, 'Boerd, 1952), ('978-1-11111-145-1', 3, 5, 1, 'Boerd, 2001), ("978-1-11111-146-1', 31, 5, 1, Board', '1999); -- Table structure for table condition_codes CREATE TABLE condition_codes ( *exported_rare_book_store (1):59 Notepad File Edit Format View Help Table structure for table condition_codes CREATE TABLE condition_codes ( condition_code int(11) NOT NULL, condition_description varchar(128) DEFAULT NULL > ENGINEINNODB DEFAULT CHARSET=utf8mb4; -- Dumping data for table condition_codes INSERT INTO `condition_codes condition_code", "condition_description) VALUES (1, 'New'), (2, 'Excellent'), (3, 'Fine'), (4, 'Good), able structure for table Customer CREATE TABLE customer'( customer_numb int(11) NOT NULL, first_name varchar(30) DEFAULT NULL, "last_name' varchar(30) DEFAULT NULL, street varchar(50) DEFAULT city' varchar(30) DEFAULT NULL, state_province char(2) DEFAULT NULL, zip_postcode char(10) DEFAULT NULL, contact_phone char(12) DEFAULT NULL ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; NULL, -- Dumping data for table customer Jones', INSERT INTO customer ( customer_numb', 'first_name, 'last_name, street, "city', 'state_province, zip_postcode, 'contact_phone) VALUES (1, 'Janice' 'Jones', 125 Center Road', 'Anytown', 'NY', '11111', '518-555-1111'), (2, 'Jon 25 Elm Road "Next Town' "NI', '18888 209-555-2222'), (3, 'John Doe', '821 Elm Street', 'Next Town', 'N]', '18888', '209-555-3333'), (4, 'Jane', 'Doe', '852 Main Street', 'Anytown', 'NY', '11111 '518-555-4444'), (5, 'Jane', 'Smith', '1919 Main Street', 'New Village, NY '13333 '518-555-5555'), (6, 'Janice', 'Smith', '800 Center Road', 'Anytown', 'NY', '11111' '518-555-6666'), (7, 'Helen' 'Brown', '25 Front Street', 'Anytown', NY', '11111', '518-555-7777'), exported_rare_book_store (1).sql - Notepad File Edit Format View Help -- Dumping data for table customer INSERT INTO 'customer' (customer_numb", "first_name", "last_name', 'street', 'city', 'state_province, 'zip_postcode, 'contact_phone") VALUES (1, 'Janice', 'Jones', '125 Center Road', 'Anytown', 'NY', '11111', '518-555-1111'), (2, 'Jon', 'Jones', '25 Elm Road', 'Next Town', 'NJ '18888', '209-555-2222'), (3, 'John', 'Doe', '821 Elm Street', 'Next Town', 'NI', '18888', '209-555-3333'), (4, 'Jane', 'Doe', '852 Main Street', 'Anytown', 'NY', '11111 '518-555-4444'), (5, 'Jane', 'Smith' '1919 Main Street', 'New Village', 'NY', '13333 '518-555-5555'), (6, 'Janice', 'Smith '800 Center Road', 'Anytown', 'NY', '11111 518-555-6666'), (7, 'Helen' Brown', 25 Front Street', 'Anytown', 'NY', ' 11111' '518-555-7777'), (8, 'Helen', 'Jerry', '16 Main Street', 'Newtown', 'Nj', '18886' 209-555-8888'), (9, Mary', 'Collins', '301 Pine Road, Apt. 12', 'Newtown', 'NI', '18886', '209-555-9999'), (10, 'Peter', 'collins', '18 Main Street', 'Newtown', 'NI', '18886' '209-555-1010'), (11, 'Edna', 'Hayes', '209 Circle Road', 'Anytown', 'NY', '11111', '518-555-1110'), (12, 'Franklin', 'Hayes', '615 Circle Road', 'Anytown', 'NY', '11111', '518-555-1212'), (13, 'Peter', 'Johnson', '22 Rose Court', 'Next Town', 'NI', '18888 209-555-1313'), (14, Peter Johnson', '881 Front Street', 'Next Town', 'N)', '18888', '209-555-1414'), (15, 'John', 'Smith', '881 Manor Lane', 'Next Town', 'NU', '18888', '209-555-1515'); Table structure for table 'publisher CREATE TABLE `publisher ( publisher_id' int(11) NOT NULL, publisher_name char(50) DEFAULT NULL ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- Dumping data for table 'publisher INSERT INTO `publisher (publisher_id, publisher_name) VALUES (1, 'Wiley'), (2, 'Simon & Schuster'), (3, 'Macmillan'), (4, 'Tor), (5, "DAW'); Table structure for table 'sale -- Table structure for table sale CREATE TABLE 'sale'( sale_id' int(11) NOT NULL, customer_numb' int(11) DEFAULT NULL, "sale_date date DEFAULT NULL, sale_total_amt decimal(8,2) DEFAULT NULL, credit_card_numb char(20) DEFAULT NULL, exp_month int(11) DEFAULT NULL, exp_year int(11) DEFAULT NULL ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; Dumping data for table 'sale INSERT INTO `sale (sale_id, customer_numb, 'sale_date`, `sale_total_amt, credit_card_numb, exp_month", exp_year') VALUES (1, 1, 2021-10-13', '510.00', '1234 5678 9101 1121', 10, 18), (2, 1, '2021-01-05', '125.00', '1234 5678 9101 1121', 10, 18), (3, 1, '2021-06-15', '58.00', '1234 5678 9101 1121', 10, 18), 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', '25.95', '25.95', 2), (5, '978-1-11111-146-1', 1, '2018-05-05', '22.95', '22.95', 2), (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', NULL, NULL), (8, '978-1-11111-137-1', 3, 2019-06-20', '50.00', NULL, NULL), (9, '978-1-11111-136-1', 1, '2018-12-20', '75.00', NULL, NULL), (10, '978-1-11111-136-1', 2, '2018-12-15 '50.00', NULL, NULL), (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', '18.00 '18.00', 3), (14, '978-1-11111-121-1', 2, '2019-04-20', '110.00', '110.00', 3), (15, '978-1-11111-121-1', 2, '2019-04-20', '110.00', '110.00', 5), (16, '978-1-11111-121-1', 2, '2019-04-20', '110.00', NULL, NULL), (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', '120.00', 6), (21, '978-1-11111-126-1', 2, '2019-04-20', '110.00', '110.00', 6), (22, '978-1-11111-139-1', 2, '2019-05-16', '200.00', '170.00', 6), (23, '978-1-11111-125-1', 2, '2019-05-16', '45.00', '45.00', 7), (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', '35.00', '55.00', 8), (27, '978-1-11111-141-1', 1, '2019-11-06', '24.95', NULL, NULL), (28, '978-1-11111-141-1', 1, '2019-11-06', '24.95', NULL, NULL), (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', '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', '125.00', '125.00', 10), (35, '978-1-11111-126-1', 1, '2019-10-26', '75.00', '75.00', 11), (36, '978-1-11111-130-1', 3, '2018-12-06', '50.00', '50.00', 11), (37, 978-1-11111-136-1', 3, '2018-12-06', '75.00', '75.00', 11), (31, '978-1-11111-145-1', 1, 2019-11-05', (32, '978-1-11111-145-1', 1, 2019-11-06', (33, 978-1-11111-129-1', 2, 2019-11-25, (34 978-1.11111.133.1' 1 2019.11.16 27.95', NULL, NULL), 27.95, NULL, NULL), 75.00', '50.88', 9), "125 AR "125. AR. a) (36, '978-1-11111-130-1', 3, 2018-12-06', '50.00', '50.80, 11), (37, 978-1-11111-136-1', 3, 2018-12-06 75.ee 75.ee', 11), (38, 978-1-11111-130-1', 2, '2019-04-06', 200.00', '150.ee', 12), (39, 978-1-11111-122-1', 3, 2819-84-86', '75.ee', '75.ee', 12), (40, '978-1-11111-129-1', 1, 2012-04-26 *25.95', '25.95', 13), (41, 978-1-11111-141-1', 1, 2819-85-16', 40.eo', '40.ee', 14), (42, 978-1-11111-141-1', 1, '2019-65-16', '40.00', '40.00', 14), (43, 978-1-11111-132-1', 1, 2819-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, 2819-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, 'zez0-01-05', '50.00', '50.80', 15), (51, 978-1-11111-141-1', 2, 2e28-01-26', '50.ee', '50.80', 15), (52,978-1-11111-141-1', 2, 2020-01-05', '50.00', '50.00', 16), (53, 978-1-11111-123-1', 2, 2e28-01-26', '40.ee', '40.80', 16), (54, '978-1-11111-127-1', 2, '2e28-01-05', '40.00', '49.60', 16), (55, 978-1-11111-133-1', 2, 2e20-02-e6', '60.ee, "60.80', 17), (56, '978-1-11111-127-1', 2, '2019-02-16', *40.ee', '40.00', 17), (57, 978-1-11111-135-1', 2, 2019-02-16', '40.ee', '40.80', 18), (58, 978-1-11111-131-1', 2, 2020-02-16', '25.00', 25.ee', 18) (59, 978-1-11111-127-1', 2, 2e28-02-25 35.ee', '35.80, 18), (60, '978-1-11111-128-1', 2, 2019-12-16', '50.eo', '45.00', 19), (61, 1978-1-11111-136-1', 3, 2019-10-22', '50.ee', '50.80', 19), (62, '978-1-11111-115-1', 2, 2019-10-22', '75.00 75.00', 20), (63, 1978-1-11111-130-1', 2, 2019-07-16 "500.ee', NULL, NULL), (54, 978-1-11111-126-1', 2, 2019-03-06', '125.00', NULL, NULL), (65, '978-1-11111-136-1', 2, '2019-3-66', '125.0', NULL, NULL), (66, '978-1-11111-127-1', 2, 2019-03-06', '125.00', NULL, NULL), (67, '978-1-11111-137-1', 2, '2e19-03-05', '125.00', NULL, NULL), (68, 1978-1-11111-198-1', 2, '2019-03-06, 125.00', NULL, NULL), (59, 978-1-11111-138-1', 2, '2019-03-05', '125.00', NULL, NULL), (70, 1978-1-11111-139-1', 2, 2019-03-06, 125.00', NULL, NULL), (71, '978-1-11111-139-1', 2, 'ze19-03-05', '125.00', NULL, NULL); Table structure for table work -- Table structure for table work ` CREATE TABLE 'work'( work_numb' int(11) NOT NULL, author_numb' int(11) DEFAULT NULL, 'title' char(50) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; INSERT INTO `work' ( work_numb`, `author_numb', 'title') VALUES (1, 1, 'Jane Eyre'), (2, 1, 'Villette'), (3, 2, 'Hound of the Baskervilles'), (4, 2, 'Lost World, The'), (5, 2, 'Complete Sherlock Holmes'), (6, 3, 'Connecticut Yankee in King Arthurs Court, A'), (7, 3, 'Prince and the Pauper'), (8, 3, 'Tom Sawyer'), (9, 3, 'Adventures of Huckleberry Finn, The'), (10, 7, 'Bourne Identity, The'), (11, 7, 'Matarese Circle, The'), (12, 7, 'Bourne Supremacy, The'), (13, 5, 'Fountainhead, The'), (14, 5, 'Atlas Shrugged'), (15, 6, 'Peter Pan'), (16, 4, 'Kidnapped'), (17, 4, 'Treasure Island'), (18, 8, 'Sot Weed Factor, The'), (19, 8, 'Lost in the Funhouse'), (20, 8, 'Giles Goat Boy'), (21, 9, 'Dune'), (22, 9, 'Dune Messiah'), (23, 10, 'Foundation'), (24, 10, 'Last Foundation'), (25, 10, 'I, Robot'), (26, 11, 'Inkheart'), (27, 11, 'Inkdeath'), (28, 12, 'Anathem'), (29, 12, 'Snow Crash'), (30, 5, 'Anthem'), (31, 12, 'Cryptonomicon'), (32, 10, 'Foundation and Empire'); Indexes for dumped tables Indexes for table "author ALTER TABLE `author ADD PRIMARY KEY ( "author_numb"); ALTER TABLE `author ADO PRIMARY KEY (author_numb"); Indexes for table 'book ALTER TABLE "book ADD PRIMARY KEY (ISBN, ADO KEY publisherBook (publisher_id' ), ADD KEY workbook ('work_numb"); Indexes for table condition_codes ALTER TABLE condition_codes ADD PRIMARY KEY ( condition_code"); Indexes for table 'customer ALTER TABLE customer ADD PRIMARY KEY ( customer_numb" ); -- Indexes for table 'publisher ALTER TABLE 'publisher ADD PRIMARY KEY publisher_10'); -- Indexes for table 'sele ALTER TABLE 'sale ADO PRIMARY KEY (sale_id"), ADD KEY 'saleCustoner (customer_numb"); -- Indexes for table 'volume ALTER TABLE 'volume ADD PRIMARY KEY (inventory_id"). ADO KEY "haak Volume (ISBN), ADD KEY "conditionVolume ("condition_code), ADD KEY 'salevolume' (sale_id' ); Indexes for table work ALTER TABLE 'work ADD PRIMARY KEY 'work_numb). ADD KEY "authorwork' (author_numb"); Constraints for dumped tables -- Constraints for table "book ADD PRIMARY KEY ( sale_id"), ADD KEY 'saleCustomer ( customer_numb"); ADD PRIMARY KEY ( sale_id"), ADD KEY 'saleCustomer' ('customer_numb"); -- Indexes for table 'volume ALTER TABLE 'volume ADD PRIMARY KEY ( inventory_id"), ADD KEY "bookVolume' (ISBN), ADD KEY "conditionVolume ( condition_code"), ADD KEY `saleVolume (sale_id'); -- Indexes for table work ALTER TABLE 'work ADD PRIMARY KEY ( work_numb"), ADD KEY `authorWork' ("author_numb"); -- Constraints for dumped tables -- Constraints for table book ALTER LE "book ADD CONSTRAINT `publisherBook' FOREIGN KEY ( publisher_id") REFERENCES `publisher C publisher_id"), ADD CONSTRAINT `workBook' FOREIGN KEY (work_numb) REFERENCES 'work' ('work_numb"); Constraints for table 'sale ALTER TABLE 'sale ADD CONSTRAINT `saleCustomer'. FOREIGN KEY ( customer_numb) REFERENCES customer' ('customer_numb"); - Constraints for table 'volume ALTER TABLE 'volume ADD CONSTRAINT book Volume FOREIGN KEY (ISBN) REFERENCES 'book' (ISBN), ADD CONSTRAINT "conditionVolume FOREIGN KEY ( condition_code") REFERENCES .condition_codes ( condition_code), ADD CONSTRAINT `saleVolume' FOREIGN KEY ("sale_id") REFERENCES 'sale' ("sale_id"); -- Constraints for table 'workStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started