Write a Quote of Today PHP program o Make 10 quotes in a MySQL database – name t
ID: 3905484 • Letter: W
Question
Write a Quote of Today PHP program
o Make 10 quotes in a MySQL database – name the database “quote_db” and name the table
“quote_table”. Provide the SQL that creates your database and table in a text file, e.g. db.sql
• NOTE: The assessor will copy your SQL statements (exactly as it is) and run to create
the database/table/records you used in your program. All the database records required
in your program must be correctly created. Test your SQL statements before submit.
• Validate the database structure and its elements against the requirements and provide a
document.
o Your program will randomly read a record (a quote) from the database table for the day and
display on the web browser.
Explanation / Answer
SQL Query
CREATE DATABASE quote_db;
USE quote_db;
CREATE TABLE quote_table ( book_id INT, author_name VARCHAR(30), PRIMARY KEY(book_id));
INSERT INTO quote_table(book_id, author_name) VALUES (101, "Tanenbaum"),(102, "Technical Publications");
SELECT * FROM quote_db ORDER BY book_id;
---------*****---------
Go to phpMyAdmin and select the database quote_db from the left.
Click on "import" and choose the file, in save as section rename the file as "db.sql".
Click on "GO".
Hope you find it useful.
Thanks.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.