lab1 :
Introduction to oracle and review of sql,
objectives:
a) To operate oracle as databae software,
b) To run different SQL commands in Oracle.
Material Required:
a) oracle Software
BAckground Theory:
Oracle is a US based Company which produce multi user and server based RDBMS. It produce highly secure database SQL is implemented vy oracle in 1979 oracle v2 was the first version.
Relational DB properties:
a) Accept SQL queries,
b) Secure
c) Transaction Control
d) Data Sharing
SQl:
Structural Query languages. It is common for all database Sysytem. Every RDNMS uses SQL. SQl can be used in oracle to
- develop the table (relation, Schema)
- develop procedure
- develop views
- create users and roles
- create tablespace
operating oracle:
- Make account in oracle.com
- Download and install oracle latest version.
e.g - Oracle 18g Release and express edition.
- set password for user: SYSYETM or SYS.
- Two ways oracle can be operated.
1) SQL command Line of oracle
- click on SQL command line
- SQL > connect
- Enter username: SYSYTEM
- Enter password: *******
connnected
2) Browesr bases oracle
- Type 127.0.0.1:8080/ apex in browser.
- Login the browser
- System TableSpace by Default can be seen
- In Application express, you can create workspace for user.
command used in Oracle SQL
a) Create table
b) Clear Screen
c) DESC
d) INSERT
e) DELETE
f) UPDATE
g) LIKE
h) order by
i) And etc.
Rules for creating table in Oracle:
a) Table name canbe 30 char long.
b) Table name begin with alphabet.
c) Names are not case sensitive
d) Names can contain a-z, 0-9
e) Names can't be reserved words.
create table student(id number, name varchar2(10), adress varchar2(10));
desc student;
insert into student values(1,'Ram','pkr');
insert into student values(2,'Syham','ktm');
insert into student values(3,'Krishna','Biratnagar');
insert into student values(4, 'Deepak','Jhapa');
insert into student values(5,'Gopal','Butwal');
--insert into student values(6,'Seeta','pkr');
select * from student;
--insert into student values(&id, '&name', '&adress');
--delete from student where id = 3;
--update student set adress= 'jhapa' where id=2;
--select id||'-'||name||'-'||adress from student
select * from student where adress='pkr' and name='seeta';
select * from student order by Name;
select * from Student where name like's%'
--(foe assending order starting letter 's').
-----------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
lab 03
title: familiarizatin with user an role in database sysyem.
objectives:
a) Assigining persmission on role by creating a role.
b) creating tablespace to make a database file.
sql> connect system
password: ----
sql> create tablespace college
DATAFILE 'C:\users\user\college.dbf'
SIZE 20M;
------------------------------------------------------------------------------------------------------------------
delimiter :
changes the end point
0 Comments