Loading topic
CREATE TABLE statement names a table, lists its columns, and optionally attaches rules and storage settings. This chapter covers the statement's structure and the choices you make before any constraints are added. Later chapters go deeper on data types, constraints, and identity columns.6 min readCREATE TABLE statement and how to give columns default values. It assumes you can write basic SELECT, INSERT, UPDATE and DELETE statements and can run SQL against an Oracle Database 12c or later schema. Constraints and identi6 min readSELECT, INSERT, UPDATE and DELETE statements. It also assumes you have seen a simple CREATE TABLE and know what a primary key is. You need an Oracle Database 12c or later schema where you can create tables.6 min readSELECT, INSERT, UPDATE and DELETE statements. It also assumes you have run a simple CREATE TABLE and can connect to an Oracle Database 12c or later schema. You do not need to know the other constraint types yet. They have their own chapters.7 min readCREATE TABLE statement, know what a primary key is, and have the departments and employees tables from earlier chapte6 min readCREATE TABLE statements, know what NOT NULL, PRIMARY KEY and UNIQUE do, and have an Oracle Database 12c or later schema to run the examples in. You will learn how a CHECK constraint works, which expressions it accepts and rejects, how it treats `NUL7 min readCREATE TABLE statements, know what a primary key is, and have an Oracle Database 12c or later schema to run the examples in. Identity columns first appeared in Oracle 12c. Every example below runs as shown on 12c and later.5 min readCREATE TABLE statement and that you know what an identity column is from the previous chapter. It covers how Oracle's three identity generation modes behave on INSERT and UPDATE, which errors each one raises, and how to choose between them.5 min readCREATE TABLE statement and that you know how PRIMARY KEY and UNIQUE constraints work. It covers how a foreign key links a child table to a parent table, what Oracle checks on each DML statement, the ON DELETE options, and the errors you will meet mo6 min readGENERATED ALWAYS, BY DEFAULT and BY DEFAULT ON NULL. It covers the options in parentheses after AS IDENTITY. These control where the numbers start, how far apart they are, and how many5 min readCREATE TABLE with inline and out-of-line constraints and give constraints explicit names. It also assumes you have the departments and employees tables from the earlier chapters in an Oracle Database 12c or later schema.5 min readSELECT statements. This chapter shows how to check what a table enforces, which constraints are disabled, and which sequence feeds an identity5 min readALTER TABLE ... ADD CONSTRAINT, as covered in earlier chapters. You also need a schema on Oracle Database 12c or later where you can create tables. Every constraint has a state. The state controls whether Oracle checks new c5 min read