Web
Web
• Concepts to Test: HTML Form, Connecting to Database with PHP, Inserting from Form to SQL Table,
Retrieving from Table and Display in HTML Table, Creating Landing Page using HTML5, JavaScript, and
CSS, SQL (creating tables, queries, insert, aggregate functions, joins, group by, altering tables, granting
user privileges, dropping tables)
• Task:
* Create a MySQL database table called books with the following columns:
* publicationYear (INT)
* isbn (VARCHAR(20))
* Create a MySQL database table called authors with the following columns:
* bio (TEXT)
Drop the table authors. Note: This will fail until you remove the foreign key constraint that
references this table. You must remove that constraint first.*
3. SQL Queries:
* Insert at least 5 sample books into the library_books table, referencing the authors.
* Retrieve all books and their authors (using a JOIN). Display the book title, author name, and
publication year.
* Calculate the number of books written by each author. Display the author's name and the book
count (using GROUP BY and COUNT).
* Find all books that contain the word "History" in the title (using LIKE).
4. HTML Form (add_book.html): Create an HTML form that allows the user to enter the information for
a new book (title, publication year, select an author from a dropdown list, and optionally a cover image
URL). The author dropdown list should be dynamically populated from the authors table in the
database.
Implement JavaScript code to perform client-side form validation before* the form is submitted.
Validation should include:
* Checking that all required fields (title, author, publication year) are filled in.
* Retrieves the data submitted from the HTML form to sql table.