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

أوامر ال SQL


shadiaonline

Recommended Posts

﴿SQL * PLUS :rolleyes

 

 

- 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;

رابط هذا التعليق
شارك

  • بعد 2 أسابيع...

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية