Example 1: Create a schema that has an inventory part table and an index over the part number. Give authority to the schema to the user profile JONES.
CREATE SCHEMA INVENTORY CREATE TABLE PART (PARTNO SMALLINT NOT NULL, DESCR VARCHAR(24), QUANTITY INT) CREATE INDEX PARTIND ON PART (PARTNO) GRANT ALL ON PART TO JONES
Example 2: Create a schema using the authorization ID of SMITH. Create a student table that has a comment on the student number column.
CREATE SCHEMA AUTHORIZATION SMITH CREATE TABLE SMITH.STUDENT (STUDNBR SMALLINT NOT NULL UNIQUE, LASTNAME CHAR(20), FIRSTNAME CHAR(20), ADDRESS CHAR(50)) COMMENT ON STUDENT (STUDNBR IS 'THIS IS A UNIQUE ID#')
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.