Oracle Database notes --- basic usage of pl/SQL

Source: Internet
Author: User

Oracle Database notes --- basic usage of pl/SQL 2.pl/ SQL: Create a table:. enter your account and enter the password www.2cto.com B. select All objects in the drop-down box on the left. There are many tables, which are built-in tables. In the drop-down box on the left, select My objects. The tables in it does not exist. Here you can create your own table c. create your own table: tables, right-click a new table; under the General label, Name: users. Note that user cannot be entered here, because user is a keyword and columns is a field: create id type: number name: varchar2 (10), pwd type: varchar2 (10), click keys to add a Primary key, and name it pk_users type: Primary with Enabled selected. d. click view SQL to view the SQL statement: www.2cto.com -- Create tablecreate table USERS (ID NUMBER not null, NAME NVARCHAR2 (10), PWD NVARCHAR2 (10 )) tablespace TESTpctfree 10 initrans 1 maxtrans 255 storage (initial 64 Kminextents 1 maxextents unlimited); -- Create/Recreate primary, unique and foreign key constraints alter table USERSadd constraint begin primary key (ID) using index tablespace TESTpctfree 10 initrans 2 maxtrans 255 storage (initial 64 Kminextents 1 maxextents unlimited); ------------------------------------------------ 3. to add data to the new users table, right-click the users table in the left tables, and select edit data: add data id 1 name: admin pwd: 123id 2 name: user pwd: 123 Add a piece of data: click a downward arrow in the menu bar to submit the transaction ------------------------------------------------------------------------- 4. query data from the newly created users table: Right-click the users table in the left tables and choose query data: --------------------------------------------------- 5. change the structure of the users table. In the tables on the left, right-click the users table and choose Edit: ------------------------------------------ 6. run SQL statement in users: Select users table in tables on the left, right-click and SELECT query data: Write SQL statement in SQL view, click the icon of a gear to execute the command ;----------------------------------------------------------
 

Related Article

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.