SQL ADVANCE
1. Make a database and name it Henry Books.
2. Assume that the Henry Books designs a database with the following tables.
AUTHOR (AuthorNum, Author_Last, Author_First, Author_Initial, Author_Birthday, Author_Add)
BOOK (BookCode, Title, Price, Publisher, AuthorNum)
Table Layout for the Henry Books database
Provide SQL statement in producing the tables.
a. AUTHOR [5pts]
Field Name Data Type Length Description
AuthorNum Text 2 Primary Key
Author_Last Text 12 Last Name
Author_First Varchar First Name
Author_Initial Text 1
Author_Birthday Date/Time
Author_Add Varchar
b. BOOK [5pts]
Field Name Data Type Length Description
BookCode Number/Decimal 2 Primary Key
Title Varchar
Price Number/Currency
Publisher Varchar
AuthorNum Text 2 Foreign Key
1. Insert the following records on AUTHOR TABLE using INSERT INTO command. [6pts]
AuthorNum AuthorLast AuthorFirst AuthorInitial AuthorBirthday AuthorAdd
A1 Dela Cruz Juan Aguinaldo 1/15/1986 San Verga
A2 Jose Rizal Protascio 6/21/1896 Calamba Laguna
A3 Apolinario Mabini Jacinto 5/23/1895
2. Insert the following records on BOOK TABLE using INSERT INTO command. [12pts]
BookCode Title Price Publisher AuthorNum
01 El Filibusterismo 1500 Liwayway A1
02 Harry Potter 2600 A1
03 Frozen 1400 Disney A3
04 X-Men 3000 Marvel A2
05 Narnia 500 Pixar A3
06 Captain America 4000 Johnson A2
3. List the complete Author Table. [1pt]
4. List the complete Book Table. [1pt]
5. Update the following: [10pts]
a. X-Men Price- 2650.
b. Harry Potter’s Publisher - Abracadabra.
c. Apolinario Mabini’s Address – Random Park
d. Juan Dela Cruz’s Birthday – 1/16/1986
e. Frozen Publisher – Animax
6. Add the Price and name the field as Total_Price. [2pts]
7. Query the Maximum(Max) Book Price
8. Query the Minimum(Min) Book Price
9. List the book code, title, price, and publisher of each book with a price between 1500-3000.
[2pts]
10. Delete Narnia on Book Table. [3pts]
11. Using Join list all the books of: [9pts]
a. Juan Dela Cruz
b. Jose Rozal
c. Apolinario Mabini
Total Items : 56 pts