Oracle (day 2)

1、 Foreign key: constraint, references
For example: SnO number (7) constraint fk_ sno references student(sno),
2、 Delete (all DDL statements)
drop table; Delete the table structure and the data in the table( (delete table)
truncate table; Delete the data in the table and keep the table structure( (truncated table)
3、 Index
1. Single column index: an index created based on a single column
Format: create index index name on table;
Index building is completed by the owner of the table, which requires the user to have the system permission of create any index or the index object permission on the corresponding table
2. Composite index: an index created based on two or more columns
Format: create index index name on table (table column name 1, table column name 2);
Whether a composite index is used depends on the order of the columns when the index is created and the filtering order of the columns in the where statement
3. Unique index: an index whose index column values cannot be duplicated
Format: create unique index index name on table (table column name 1);
When defining a primary key constraint or uniqueness constraint, Oracle will automatically create a unique index on the corresponding column
4. Rebuild index: alter index name rebuild;
5. Delete index: drop index index name;
4、 Maintenance of constraints
1. Disable constraint: alter table_ name disable constraint constraint_ name;
2. Enable constraint: alter table_ name enable constraint constraint_ name;
3. Delete constraint: alter table_ name drop constraint constraint_ name;
4. Modify constraint name: alter table_ name rename constraint oldname to newname;
5、 Others
1. Insert statement insert:
Format: insert into table_ name (column,column…) values(value,value….);
2. Table data replication:
Format: insert into table_ name (column,column…) subquery;
3. Modify statement update:
Format: update table name set column name =’New_ Value ‘where column name = value;
For example: update student set IDcard = 370285 ‘where SnO = 1002; Change the ID card of student number 1002 to 370285
4. Command line run, see the version

Recommended Today

Looking for frustration 1.0

I believe you have a basic understanding of trust in yesterday’s article. Today we will give a complete introduction to trust. Why choose rust It’s a language that gives everyone the ability to build reliable and efficient software. You can’t write unsafe code here (unsafe block is not in the scope of discussion). Most of […]