Appendix G. Bonus Exercises

The exercises in this appendix are bonus exercises that are specific to MySQL. We provide an explanation or question and then provide sample MySQL-based SQL code to execute. Remember that the SQL code can vary from implementation to implementation, so some of these statements need to be adjusted depending on what system you are working on. Study the question, code, and results carefully to improve your knowledge of SQL.

1. Create a new database for bonus exercises and name it BONUS.

CREATE DATABASE BONUS;

2. Point MySQL to your new database.

USE BONUS;

3. Create a table to keep track of basketball teams.

CREATE TABLE TEAMS( TEAM_ID        INTEGER(2)    NOT NULL,  NAME           VARCHAR(20)   NOT ...

Get Sams Teach Yourself SQL in 24 Hours, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.