Professional Documents
Culture Documents
7
EXPERIMENT 1
Description
The Oracle CREATE TABLE statement allows you to create and define a table.
Syntax
The syntax for the CREATE TABLE statement in Oracle/PLSQL is:
Constraints are used to make sure that the integrity of data is maintained in the database.
Following are the most used constraints that can be applied to a table.
• NOT NULL
• UNIQUE
• PRIMARY KEY
• FOREIGN KEY
• CHECK
• DEFAULT
NOT NULL:
UNIQUE:
CHECK:
EXPERIMENT 4
The Cartesian product, also referred to as a cross-join, returns all the rows in all the tables
listed in the query. Each row in the first table is paired with all the rows in the second table. This
happens when there is no relationship defined between the two tables.
TABLES CONSIDERED:
CARTESIAN PRODUCT:
EXPERIMENT 5
TABLES considered:
INNER JOIN (simple join)
Syntax
SELECT columns
FROM table1
INNER JOIN table2
ON table1.column = table2.column;
LEFT OUTER JOIN
Syntax
SELECT columns
FROM table1
LEFT JOIN table2
ON table1.column = table2.column;
RIGHT OUTER JOIN
Syntax
SELECT columns
FROM table1
RIGHT [OUTER] JOIN table2
ON table1.column = table2.column;