This question is based on the following data and tables. Create a database named books( make sure you don’t forget to select the database) and run the MySQL queries below to be able to complete the following MySQL Queries. For each MySQL query, screenshot the output and include the MySQL query in your submission PDF. -- Authors Table CREATE TABLE authors ( author_id INT PRIMARY KEY AUTO_INCREMENT, author_name VARCHAR(255) NOT NULL, birth_year INT ); -- Sample Data INSERT INTO authors (author_name, birth_year) VALUES ('J.K. Rowling', 1965), ('George Orwell', 1903), ('Jane Austen', 1775); -- Books Table CREATE TABLE books ( book_id INT PRIMARY KEY AUTO_INCREMENT, title VARCHAR(255) NOT NULL, publication_year INT, author_id INT, FOREIGN KEY (author_id) REFERENCES authors(author_id) ); -- Sample Data INSERT INTO books (title, publication_year, author_id) VALUES ('Harry Potter and the Sorcerer''s Stone', 1997, 1), ('1984', 1949, 2), ('Pride and Prejudice', 1813, 3); a-  Write a MySQL query that selects the author with the earliest birth year. b-  WriteaMySQLquerythatwillfindthetitlesofbookspublishedaftertheyear1900from the books table. c-  Write a MySQL query that utilizes a join to retrieve the names of authors and the titles of their books (if any) from the authors and books tables. d-  WriteaMySQLquerythatwillcalculatetheaveragebirthyearforallauthors. e-  Write a MySQL query that will count the number of books written by each author. Include the author's name and the count of books. Show authors even if they have written zero books

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

This question is based on the following data and tables. Create a database named books( make sure you don’t forget to select the database) and run the MySQL queries below to be able to complete the following MySQL Queries. For each MySQL query, screenshot the output and include the MySQL query in your submission PDF.

-- Authors Table CREATE TABLE authors (

author_id INT PRIMARY KEY AUTO_INCREMENT, author_name VARCHAR(255) NOT NULL, birth_year INT

);

-- Sample Data
INSERT INTO authors (author_name, birth_year) VALUES ('J.K. Rowling', 1965),
('George Orwell', 1903),
('Jane Austen', 1775);

-- Books Table CREATE TABLE books (

book_id INT PRIMARY KEY AUTO_INCREMENT, title VARCHAR(255) NOT NULL, publication_year INT,
author_id INT,

FOREIGN KEY (author_id) REFERENCES authors(author_id) );

-- Sample Data

INSERT INTO books (title, publication_year, author_id) VALUES ('Harry Potter and the Sorcerer''s Stone', 1997, 1),
('1984', 1949, 2),
('Pride and Prejudice', 1813, 3);

  1. a-  Write a MySQL query that selects the author with the earliest birth year.

  2. b-  WriteaMySQLquerythatwillfindthetitlesofbookspublishedaftertheyear1900from

    the books table.

  3. c-  Write a MySQL query that utilizes a join to retrieve the names of authors and the titles

    of their books (if any) from the authors and books tables.

  4. d-  WriteaMySQLquerythatwillcalculatetheaveragebirthyearforallauthors.

  5. e-  Write a MySQL query that will count the number of books written by each author.

    Include the author's name and the count of books. Show authors even if they have written zero books. 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Can I get a screen shot for each querirs 

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
SQL Query
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education