SQL and Internet Security Lab 1. Creating, Modifying and Dropping Tables Creating Table
SQL and Internet Security Lab 1. Creating, Modifying and Dropping Tables Creating Table
Table created.
Finding the column details of a table created
SQL> desc Student1
Name Null? Type
------------------------------- -------- ----
REGNO VARCHAR2(8)
NAME VARCHAR2(30)
DEPT VARCHAR2(15)
YEAR VARCHAR2(6)
Table altered.
SQL> desc student1
Name Null? Type
------------------------------- -------- ------------------
REGNO VARCHAR2(8)
NAME VARCHAR2(30)
DEPT VARCHAR2(15)
YEAR VARCHAR2(6)
MARK NUMBER(6,2)
SQL> Alter table Student1 Modify ( RegNo varchar2(10) );
Table altered.
SQL> desc student1
Name Null? Type
------------------------------- -------- ----
REGNO VARCHAR2(10)
NAME VARCHAR2(30)
DEPT VARCHAR2(15)
YEAR VARCHAR2(6)
MARK NUMBER(6,2)
Destroying Table
SQL> drop table student1 ;
SQL> desc student1
ERROR:
ORA-04043: object student1 does not exist
2. Inserting, Modifying and Deleting rows
SQL> insert into student1 ( regno, name, dept, year ) values ('18ACS65', 'Amar',
'Computer','Third');
1 row created.
SQL> insert into student1 ( regno, name, dept, year ) values('18AMA75', 'Akbar',
'Mathematics', 'Third' );
1 row created.
3 rows deleted.
no rows selected