Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
BD / Labs / English / Lab1-Table creation altering and deletion.doc
Скачиваний:
26
Добавлен:
20.02.2016
Размер:
234.5 Кб
Скачать

Laboratory work 1

Creation altering and deletion a table in SQL Oracle

Contents

1. Purpose of the lab 1

2. Theoretical backgrounds 1

2.1. Table creation 1

2.1.1. Syntax 1

2.1.2. Purpose 2

2.1.3. Prerequisites 2

2.1.4. Keywords and Parameters 2

2.1.5. Oracle Built-In Datatypes 3

2.1.5.1. Comparison Semantics 3

2.1.5.2. Using the NUMBER Datatype 3

2.1.5.3. Using the DATE Datatype 4

2.1.5.4. ANSI/ISO Datatypes 5

2.2. Altering Tables 6

2.2.1. Syntax 6

2.2.2. Purpose 6

2.2.3. Prerequisites 7

2.2.4. Keywords and Parameters 7

2.3. Dropping Tables 10

2.3.1. Syntax 10

2.3.2. Purpose 10

2.3.3. Prerequisites 10

2.3.4. Keywords and Parameters 10

3. Lab tasks 11

3.1.1. Tables creation 11

3.1.2. Altering the tables 12

3.1.3. Deleting the tables 12

4. Control questions 12

  1. Purpose of the lab

  • To study SQL Oracle possibilities in table creation, altering and deletion.

  • To acquire practical skills in table creation, altering and deletion by using SQL*Plus.

  1. Theoretical backgrounds

    1. Table creation

      1. Syntax

      1. Purpose

To create a relational table, the basic structure to hold user data. Tables are created with no data. You can add rows to a table with the INSERT statement. After creating a table, you can define additional columns and integrity constraints with the ADD clause of the ALTER TABLE statement. You can change the definition of an existing column with the MODIFY clause of the ALTER TABLE statement.

      1. Prerequisites

To create a relational table in your own schema, you must have CREATE TABLE system privilege. To create a table in another user's schema, you must have CREATE ANY TABLE system privilege.

To enable a UNIQUE or PRIMARY KEY constraint, you must have the privileges necessary to create an index on the table. You need these privileges because Oracle creates an index on the columns of the unique or primary key in the schema containing the table.

Соседние файлы в папке English