Logo icon
    • Contents
    • Quick start
    • Concepts
    • For DevOps
    • For Developers
      • Getting started
      • YQL tutorial
        • Creating a table
        • Adding data to a table
        • Selecting data from all columns
        • Selecting data from specific columns
        • Sorting and filtering
        • Data aggregation
        • Additional selection criteria
        • Joining tables with JOIN
        • Inserting and updating data with REPLACE
        • Inserting and updating data with UPSERT
        • Inserting data with INSERT
        • Updating data with UPDATE
        • Deleting data
        • Adding and deleting columns
        • Deleting a table
      • Example applications
      • Primary keys
      • Secondary indexes
      • Query plans optimization
      • Batch upload
      • Paging
      • Timeouts
      • System views
      • Change Data Capture
      • Terraform
      • Custom attributes
    • For Security Engineers
    • For Contributors
    • Reference
    • Recipes
    • Troubleshooting
    • Questions and answers
    • Downloads

    In this article:

    • Adding a column
    • Deleting a column
    1. For Developers
    2. YQL tutorial
    3. Adding and deleting columns

    Adding and deleting columns

    • Adding a column
    • Deleting a column

    Add a new column to the table and then delete it.

    Note

    We assume that you already created tables in step Creating a table and populated them with data in step Adding data to a table.

    Adding a column

    Add a non-key column to the existing table:

    ALTER TABLE episodes ADD COLUMN viewers Uint64;
    

    Deleting a column

    Delete the column you added from the table:

    ALTER TABLE episodes DROP COLUMN viewers;
    

    Was the article helpful?

    Previous
    Deleting data
    Next
    Deleting a table