Beginning SQL
Beginning SQL Beginning SQL
Figure A-2 Notice that Table1 is renamed BooksForSale and that all the columns except ISBN, PublisherCode, and BookSellerId are deleted. The database is now in second normal form. Exercise 2 Solution The FavCategory table links to two other tables: Category and MemberDetails. They are both the primary tables, the columns in FavCategory being foreign keys. Therefore, you must create two FOREIGN KEY constraints: ALTER TABLE FavCategory ADD CONSTRAINT favcat_cat_fk FOREIGN KEY (CategoryId) REFERENCES Category(CategoryId); ALTER TABLE FavCategory ADD CONSTRAINT favcat_member_fk FOREIGN KEY (MemberId) REFERENCES MemberDetails(MemberId); Exercise Answers 377
- Page 744: Chapter 13 Gigahertz Networks or Co
- Page 748: Chapter 13 Database Cache 354 In ad
- Page 752: Chapter 13 Again, the shotgun appro
- Page 756: Chapter 13 358 Figure 13-3 Leaf Ind
- Page 760: Chapter 13 Try It Out Dropping Inde
- Page 764: Chapter 13 64k Block 64k Block Figu
- Page 768: Chapter 13 ❑ Inner joins look lik
- Page 774: Chapter 1 Exercise 1 Solution A Exe
- Page 778: Chapter 2 Exercise 1 Solution There
- Page 782: Email, DateOfJoining ) VALUES ( 7,
- Page 786: Chapter 3 Exercise 1 Solution First
- Page 790: As well as joining the tables, you
- Page 796: Appendix A Chapter 5 Exercise 1 Sol
- Page 800: Appendix A 380 You might receive sl
- Page 804: Appendix A 382 You should use the f
- Page 808: Appendix A Your answer may differ,
- Page 812: Appendix A WHERE (SELECT COUNT(*) f
- Page 816: Appendix A Exercise 2 Solution CREA
- Page 820: Appendix A Chapter 13 Exercise 1 So
- Page 824: Appendix B 392 Click the database i
- Page 828: Appendix B 394 Click Install to beg
- Page 832: Appendix B 396 Select the Detailed
- Page 836: Appendix B 398 Leave it at the defa
- Page 840: Appendix B 400 Having entered your
Figure A-2<br />
Notice that Table1 is renamed BooksForSale and that all the columns except ISBN, PublisherCode, and<br />
BookSellerId are deleted. The database is now in second normal form.<br />
Exercise 2 Solution<br />
The FavCategory table links to two other tables: Category and MemberDetails. They are both the primary<br />
tables, the columns in FavCategory being foreign keys. Therefore, you must create two FOREIGN<br />
KEY constraints:<br />
ALTER TABLE FavCategory<br />
ADD CONSTRAINT favcat_cat_fk<br />
FOREIGN KEY (CategoryId)<br />
REFERENCES Category(CategoryId);<br />
ALTER TABLE FavCategory<br />
ADD CONSTRAINT favcat_member_fk<br />
FOREIGN KEY (MemberId)<br />
REFERENCES MemberDetails(MemberId);<br />
Exercise Answers<br />
377