CREATE OWN LIBRARY

SQL ASSINGMENT 4 WITH SOLUTION

Back to Programming

Description

Student (Rollnonumber(6) PK, Name varchar2 (20) NOT NULL, Stream varchar (20))

a)   Alter the table by adding new column class varchar(20).

b)   Delete records from the table where second letter of stream is ‘E’.

c)    Modify column width of stream.

d)    Alter table by changing the datatype of rollno to varchar2 (8).

e)    Delete record of the student except IT, CSE, ME.

f)     Delete the table along with data.


CREATE Table STUDENT:

CREATE TABLE       STUDENT (

ROLLNO NUMBER

NUMBER(5) PRIMARY KEY,

Name VARCHAR(20) NOT NULL,

STREAM VARCHAR(20)); 


Table STUDENT is created.



Insert the values in the table "STUDENT" :

 INSERT INTO STUDENTVALUES(102, 'ABC', ‘CSE’,)

INSERT INTO Employee VALUES(104, 'RAM', ‘IT’,)

INSERT INTO Employee VALUES(100, 'SHYAM', ‘ME’,)

INSERT INTO Employee VALUES(023, 'RAHUL', ‘ECE’)

INSERT INTO Employee VALUES(044, 'PUSHPA', ‘EE’) ;


Output:

5 rows created


Student

Code