>creating a table
create table student(
student_id number(5),
first_name
varchar2(10),
last_name
varchar2(10),
degree varchar2(10)
);
>viewing table
structure
desc student;
>inserting values
insert into student
(STUDENT_ID,
FIRST_NAME, LAST_NAME, DEGREE)
values
(1, 'ali', 'khan',
'metric');
insert into student
values
(2, 'asad', 'amjad',
'middle');
insert into student
(FIRST_NAME,
STUDENT_ID, LAST_NAME, DEGREE)
values
('ahmed', 3, 'malik',
'bsc');
> viewing data
select * from student;
> updating a record
update student
set degree='metric'
where
student_id=2;
> deleting a recor
delete from student
where
student_id=2;
insert into student
(STUDENT_ID,
FIRST_NAME, LAST_NAME, DEGREE)
values
(1, 'faheem', 'khan',
'mba');
delete from student
where
first_name='faheem' or last_name='malik';
No comments:
Post a Comment