NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io


SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 10 15:17:08 2022

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> connect;
Enter user-name: system
Enter password:
Connected.
SQL> ------------------------------------------------Lab 3---------------------------------------------------
SQL> create user Saurabh identified by Soni;

User created.

SQL> grant create session to Saurabh;

Grant succeeded.

SQL> alter user Saurabh identfied by Soni default tablespace system temporary tablespace temp quota unlimited in system;
alter user Saurabh identfied by Soni default tablespace system temporary tablespace temp quota unlimited in system
*
ERROR at line 1:
ORA-00922: missing or invalid option


SQL> grant create table to Saurabh identified by Soni;

Grant succeeded.

SQL> alter user Saurabh identfied by Soni default tablespace system temporary tablespace temp quota unlimited on system;
alter user Saurabh identfied by Soni default tablespace system temporary tablespace temp quota unlimited on system
*
ERROR at line 1:
ORA-00922: missing or invalid option


SQL> alter user Saurabh identfied by Soni default tablespace users temporary tablespace temp quota unlimited on users;
alter user Saurabh identfied by Soni default tablespace users temporary tablespace temp quota unlimited on users
*
ERROR at line 1:
ORA-00922: missing or invalid option


SQL> alter user Saurabh identified by Soni default tablespace system temporary tablespace temp quota unlimited on system;

User altered.

SQL>

User:

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 10 15:20:09 2022

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> connect;
Enter user-name: Saurabh
Enter password:
Connected.
SQL> create table Student(ID varchar(20), First_Name varchar(20),Last_Name varchar(20),Email varchar(20), DOB date);
create table Student(ID varchar(20), First_Name varchar(20),Last_Name varchar(20),Email varchar(20), DOB date)
*
ERROR at line 1:
ORA-01950: no privileges on tablespace 'SYSTEM'


SQL> create table Student(ID varchar(20), First_Name varchar(20),Last_Name varchar(20),Email varchar(20), DOB date);

Table created.

SQL> -----------------------------Add a new Column Branch to the existing ralation----------------------
SQL> alter table Student add ( Branch varchar(20));

Table altered.

SQL> desc Student;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID VARCHAR2(20)
FIRST_NAME VARCHAR2(20)
LAST_NAME VARCHAR2(20)
EMAIL VARCHAR2(20)
DOB DATE
BRANCH VARCHAR2(20)

SQL> ----------------------------------change the datatype of student id from varchar to char------------------
SQL> alter table Student ( ID char(20));
alter table Student ( ID char(20))
*
ERROR at line 1:
ORA-01735: invalid ALTER TABLE option


SQL> alter table Student modify ( ID char(20));

Table altered.

SQL> desc Student;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID CHAR(20)
FIRST_NAME VARCHAR2(20)
LAST_NAME VARCHAR2(20)
EMAIL VARCHAR2(20)
DOB DATE
BRANCH VARCHAR2(20)

SQL> ------------------------------change the name of column first_name to student name-------------------
SQL> alter table Student rename column First_Name to Stu_Name;

Table altered.

SQL> desc Student;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID CHAR(20)
STU_NAME VARCHAR2(20)
LAST_NAME VARCHAR2(20)
EMAIL VARCHAR2(20)
DOB DATE
BRANCH VARCHAR2(20)

SQL> -----------------------------------modify the column width of the job last_name----------------------
SQL> alter table Student modify(Last_Name varchar(50));

Table altered.

SQL> desc Student;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID CHAR(20)
STU_NAME VARCHAR2(20)
LAST_NAME VARCHAR2(50)
EMAIL VARCHAR2(20)
DOB DATE
BRANCH VARCHAR2(20)

SQL> ------------------------------------rename the table from student to Stu_data-----------------------
SQL> rename Student to Stu_data;

Table renamed.

SQL> desc Stu_data;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID CHAR(20)
STU_NAME VARCHAR2(20)
LAST_NAME VARCHAR2(50)
EMAIL VARCHAR2(20)
DOB DATE
BRANCH VARCHAR2(20)

SQL> -----------------------------drop the column email from the table---------------------------
SQL> alter table Stu_data drop column Email;

Table altered.

SQL> desc Stu_data;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID CHAR(20)
STU_NAME VARCHAR2(20)
LAST_NAME VARCHAR2(50)
DOB DATE
BRANCH VARCHAR2(20)

SQL> --------------------------------Lab Finished-------------------------------------
SQL> -----------------------Conclusion: The Lab has Been Studied SuccessFully----------------------
SQL>
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.