Académique Documents
Professionnel Documents
Culture Documents
Overview
Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing data integrity using constraints
Implementing business rules at the database level using triggers and sequences
Managing Tables
There is a generic table definition syntax in Oracle and SQL Server There are various types of tables in Oracle and SQL Server Components of column definition are column name, data type, default value and constraints (optional)
Managing Constraints
Types of constraints found in Oracle and SQL Server are:
NOT NULL
CHECK UNIQUE
PRIMARY KEY
FOREIGN KEY Constraints can be defined in-line with column definition or out-of-line as table constraints Constraints on single columns can be defined as column constraints or table constraints, and multi-column constraints are defined as table constraints Primary key constraints are enforced using unique indexes and NOT NULL constraints in both Oracle and SQL Server
In this demonstration you will see how to: Define a table with a Primary Key Validate with Foreign Keys
Managing Triggers
SQL Server INSTEAD OF triggers similar to BEFORE triggers in Oracle SQL Server triggers are at the statement level Oracle uses pseudo-row structures :new and :old SQL Server - pseudo-tables DELETED and INSERTED Unlike Oracle, SQL Server can define First and Last Trigger in a set.
Managing Indexes
Unique and non-unique non-clustered B-tree indexes are found in both Oracle and SQL Server SQL Server clustered indexes are similar to Oracle index-organized tables
SQL Server indexes can be created, dropped, rebuilt, or reorganized offline or online
SQL Server provides indexing on XML and Spatial data types SQL Server 2012 includes xVelocity memory optimized columnstore indexes to speed up data warehousing queries
Managing Views
Oracle views can be created even with lack of permissions or absence of the base objects, using FORCE clause In SQL Server definition of the view can be stored in encrypted form in the system catalog Oracle views can be defined with constraints and can be read-only WITH CHECK OPTION is found in both DBMSs
Demonstration:
Create indexed view
Review
We learned how Oracle and SQL Server differ in the interpretation of identifier names in schema object definitions We compared types of tables and indexes found in Oracle and SQL Server and learned how to create and maintain them We went over the differences in selection of storage parameters between Oracle and SQL Server We compared other schema objects in Oracle and SQL Server such as constraints, triggers, views and sequences and learned how to manage them