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 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.