Ø Tables are the basic unit of data
storage in a Database.
Ø Data is stored in rows and
columns .
Ø We define a table with a table
name ,each column with a column name, And each row has a unique row id.
Ø A table has a specified number of
columns, but can have any number of rows
Ø If data that are not physically
stored in the database it can be called as Views
Types Of Tables:
àRelational
Tables: It have
simple columns and are the most common
table type
Eg: emp
CREATE TABLE
emp (empno NUMBER(3),
name VARCHAR2(20),
address ADDRESS_OBJ);
name VARCHAR2(20),
address ADDRESS_OBJ);
Ø Object
Tables: An object table is a special kind of table in
which each row represents an object
Ø Before Creating Object Table we
have to create an Object Type
Ø To create Object
type .
Ø CREATE OR REPLACE TYPE address_obj as OBJECT(
street VARCHAR2(20),
city VARCHAR2(20),
state CHAR(2),
zip CHAR(5));
street VARCHAR2(20),
city VARCHAR2(20),
state CHAR(2),
zip CHAR(5));
Ø Then We can create
its object Tables
Ø E.g: CREATE TABLE address_table OF ADDRESS_OBJ;
Ø CREATE TABLE address_table _new
OF ADDRESS_OBJ;
Ø à
Heap
Organized table
Ø àIt Does not
Store Rows In any Particular Order
Ø à
Index Organised Table
Ø àIt Orders rows
According to the primary key Value.
No comments:
Post a Comment