Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

The basic relations of the DB are Book, Author, Publisher, and people. However, do not forget to decompose the relations appropriately in order to avoid

image text in transcribedimage text in transcribed

The basic relations of the DB are Book, Author, Publisher, and people. However, do not forget to decompose the relations appropriately in order to avoid any anomalies and redundancies. Also, determine the relationships between your entities carefully. For the book, you need to keep the information that includes its, ISBN, title, category, number of pages, author, and publisher. For the author, you need to keep the information that includes his/her name and surname, the books written, gender, birthdate, and country. For the people, you need to keep the information that includes his/her name and surname, the book that was read, birthdate, and year of the book that was read. For the publisher, you need to keep the name and address. Depending on your design, you can add more attributes (such as Authorld, PublisherID, etc.) to the relevant relations. 1. Design the entity relationship diagram (according to the E/R model you learned in the lecture). Make sure the multiplicities of the relationships are set logically. 2. Also, implement your entity relationship diagram in MySql. 3. Create the tables in your design in MySql. Put a constraint on the attribute gender so that the only characters in a component for this attribute can be 'F' or 'M'. 4. Insert (at least) 5 sample tuples into each table. You can insert values such as Name1, Name2, Booki, Book2, etc. 5. Write the Sql queries that answers the following. Also, execute each query and show a sample output. a. Show the author name(s) and surname(s) whose name starts with a given string. b. Show the title of the books written by a given author. C. Show the book title, author name, surname and country, publisher name and address for a given book's ISBN d. Count how many different people has read a given book. e. Show the name and surname of the author whose books were read the most in a given year. f. Update the address of a given publisher. g. Insert a book that a person has read in a specific year. Before insertion, check if the given book data exists in the DB. h. Delete a person (from all the relevant tables of your DB) who has not read a book for the last 20 years. Make sure to maintain the Referential Integrity. Implement a simple Desktop Application using Java Programming which interacts with your DB. . Specifications: You can decide on how to design the GUI of your app. However, it is should be simple and easy to follow. You need to implement the queries only between a and d (including a and d) of Step-5. Create a separate button for each query in a-d items of Step-5. When a button is pressed, it should return (display) the output of the corresponding query in Step-5. Using JTextFields, JComboBoxes, etc., get the required input from the user for the queries in Step-5. When the user enters the input and the corresponding button is pressed, the correct output should be displayed on the GUI. You can decide on the JComponent that displays the outputs in your GUI

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions