إنتقال للمحتوى

  • تسجيل الدخول عبر الفيس بوك تسجيل الدخول عبر تويتر Log In with LinkedIn Log In with Google      تسجيل دخول    
  • إنشاء حساب

صورة
- - - - -

statment of sql


لا توجد ردود على هذا الموضوع

#1 shadiaonline

shadiaonline

    عضو

  • الأعضــاء
  • 2 مشاركة

تاريخ المشاركة 11 November 2004 - 01:37 PM

Chapter3

SQL * PLUS


- SQL *PLUS: = is an Oracle Tool that lets you access the database structure directly.
It can let you:
1-Build Tables, indexes.
2-Execute Queries.
3-Up date Database Objects, etc.
SQL *PLUS: Enter your user name and SQL *PLUS will display the prompt "Enter password:"
Using (SCOTT as a username) and (TIGER as a password)
Then SQL *PLUS will display its prompt:
SQL>.

1-Creating a Table: = to create a table in an ORACLE database use the
CREATE TABLE table_ name:

(Column name type (size) [Null / Not Null],
Column type (size) [Null / Not Null]...);
*Example:-

Create table
To see a description of the my_emp table


*How to create a table from other table:-

SQL>create table DEPT 30
As select EMPNO, ENAME, SAL from MY_EMP where DEPTNO=30;
Create table
*To see the description of dept30, enter:



2- Altering a Table: - Use the Altering Table command to change the definition of a table.
*Alter Table can do:

1-Add
2-Modify


For example: =

Alter table






3-Rename a Table:- To Rename a database object ,the syntax is :
(RNAME old TO new)
Example: SQL>Rename my_emp to B4cse;


4-Dropping a Table: Mean Delete a Table;

Example:- SQL>Drop table my_emp;












:D