QuestionQ108

VerifiedCreating and Managing Tables

You need to create a sales table with these column specifications and data types:

  • SALESID: Number -
  • STOREID: Number -
  • ITEMID: Number -
  • QTY: Number; set to 1 when no value is specified
  • SLSDATE: Date; set to the current date when no value is specified
  • PAYMENT: Characters up to 30 characters; set to CASH when no value is specified

Which statement creates the table?

Question Image

Explanation

In Oracle SQL, a DEFAULT value is used when an INSERT omits the column. 1 is a valid NUMBER default, SYSDATE supplies the current DATE, and a VARCHAR2 default such as CASH must be a single-quoted character literal. VARCHAR2(30) provides the required maximum length.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!