Creating a BONUS Table in Oracle

This SQL statement creates a table named 'BONUS' in Oracle with the following columns:

  • ename: Employee name (VARCHAR2 data type, maximum length 10 characters)
  • job: Employee job title (VARCHAR2 data type, maximum length 9 characters)
  • sal: Employee salary (NUMBER data type, maximum length 10 digits)
  • comm: Employee commission (NUMBER data type, maximum length 10 digits)
CREATE TABLE BONUS
(
  ename VARCHAR2(10),
  job   VARCHAR2(9),
  sal   NUMBER(10),
  comm  NUMBER(10)
);

Explanation:

  • CREATE TABLE: This keyword initiates the table creation process.
  • BONUS: This is the name of the table being created.
  • ename, job, sal, comm: These are the column names within the BONUS table.
  • VARCHAR2(10), VARCHAR2(9), NUMBER(10): These specify the data types and maximum lengths for each column.
    • VARCHAR2: Used for storing variable-length strings.
    • NUMBER: Used for storing numeric values.

This SQL statement provides a basic structure for storing employee bonus information within an Oracle database.

Oracle CREATE TABLE BONUS Statement

原文地址: https://www.cveoy.top/t/topic/nxnM 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录