Appendix B. Code Examples to Create Tables

This appendix contains the CREATE TABLE statements for the tables that we used for examples in this book. To create these tables in your database, simply log in to your database as a valid user, and then execute each one of these commands.

Note that the exact syntax of some implementations of SQL may vary slightly from this code. This is basic SQL code to create tables; the implementations used are Oracle and MySQL.

The CREATE TABLE statements are as follows:

 Oracle create table checks (check# number(6) not null, payee varchar(20) not null, amount number(6,2) not null, remarks varchar(20) not null); MySQL create table checks (check numeric(6) not null, payee varchar(20) not null, amount decimal(6,2) not ...

Get Sams Teach Yourself SQL in 21 Days, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.