Getting Started with SQL Language Tutorial: Lesson fifth Deleting a database table

Source: Internet
Author: User

Lesson five deleting a database table

Use the drop TABLE command in the SQL language to delete a table and all records in that table. The use format of the drop TABLE command is:

drop table TableName;

For example:

drop table employee;

If the user wants to delete a database table completely, simply enter the name of the table that you want to delete after the drop table command. The drop TABLE command works differently from all records in the delete table. After you delete all the records in the table, the table still exists and the information in the table is not changed. Using the drop TABLE command removes all information from the entire database table.

Above, we introduce the main commands and statements of SQL language in more detail. It should be said that the syntax of the SQL sentence structure and style is quite simple and intuitive, as long as the user combined with practice more practice, will be quickly mastered in the short term.

For example, in the Store_information datasheet, we can set the following field and datasheet alias in the SQL command used in the Group by section:

select A1.store_name Store, SUM (sales) "Total Sales"

from store_information A1

group by A1.store_name

The results of the query are shown as:

store Total Sales

los Angeles $1800

san Diego $

boston $700



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.