Adding and Deleting database attributes Add,drop,modify

Source: Internet
Author: User

Create a new table: Create table nac_user.a_bt (dept VARCHAR2( 5)); Note: There must be at least one field in the table when you create a new table To delete an entire table: Drop  TableNAC_USER.A_BT; to add a property to a table: alter table nac_user.t_p_merchant add sex char( 1 ) default(' M ')
New FOREIGN KEY properties: ALTER TABLE T_fix_bind_route add constraint fk_t_fix_bi_reference_t_l_term foreign key (Lt_termno, Lt_merchno) References T_l_terminal (Lt_termno, Lt_merchno);
to delete a property of a table: alter table nac_user.t_p_merchant drop (pm_status) to change a property of a table: alter table nac_user.t_p_merchant Modify dept Char( (Original dept char (20)) at this time to ensure that the value of dept under the length of no more than ten)
---- Specify Constraint name disable /activate constraint (disable/ activate constraint causes the operation to Delete and rebuild the index) ALTER TABLE employees disable/  Enable unique Emailalter Table employees disable/enable constraint emp_ename_pkhttp://  Www.codesky.net/article/200911/143229.html

Adding and Deleting database attributes Add,drop,modify

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.