SlideShare a Scribd company logo
Lab of the Database
System
Sulieman Khudruj
Database : a collection of organized data , or set
of tables with relations.
Why oracle ??
 High capacity.
 Performance.
 Security
 Web ready
Oracle :
1)Databse
a.SQL : Structured Query Langauge
b.PL/SQL.
2)Developer
a.Forms
b.Reports
Other Tools:
 Designer
 Portals
 Jdevelopers
 Discoverer
 EM
 Grid controls
Certifications
SQL+PL/SQL  OCA
Forms  OCP
DBA
Entity Relation Ship Diagram
(ERD)
Symbol Meaning
Entity type
Weak Entity type
Relationship type
Identifying
Relationship type
attribute
Key attribute
Multi valued attribute
Composite attribute
Derived attribue
Simple Example
Database contains 2 tables
Table 1: Emplyee
Empno Ename Sal Birthdate Mobile# Age
1 Ali 5000 14/2/1977 05467756
Table 1: Dept
Deptno Deptname
10 Computer
20 Research
30 Sales
40 Accounting
Empn
o
Enam
e
Employee
s
Sal
Mobile
#
Birthdat
e
Age
Dept
Dento
n
Deptname
Wor
k
1
M
SQL
Commands Types
 DDL : Data Definition language
Create, Drop, Alter, Rename,….
 DML: Data Manipulation language
Insert, Delete, Update, select
 DCL : Data Control Language
Grant, Revoke, …….
 Transactions : Commit, Rollback, Save
point,…
Constraints
 Not null : we must enter a value but duplication
is allowed.
 Unique : duplication is not allowed but null
values is acceptance.
 Check : Any values but must have a condition.
 Primary key : Not null and Unique
 Foreign key : it is a primary key or unique key
from a nother table.
Data Types
 Number (5) , can be upto 5
 Number (6,2)
 Number , it can reserve to the highest value
but it is not recommended
 Char (10) , Ahamed- - - -
 Varchar2(20)
 Date : Store Date in many formats
1) Create user , grant create session , grant connect,
resource
2.Create table
3.Select * from tab
4.desc name_table
5.drop table, show recyclebin, flashback
6. drop table table_name purge
7. insert
Dept table
Deptno Depname
10 Computer
20 Resaech
30 Accounting
40 Marketing
Employee
Empno Ename Sal Birthdate Mobile#
1 abdulelah 5000 14/2/1977 054545454
2 omar 6000 14/4/1993 054564645
3 khaled 8000 1/4/1990 054564564
4 mubark 5500 1/1/1990 054645646
5 saad 9000 1/1/1994 056456445
6 adel 29000 13/11/1993 045645644
7 Abd allah 30000 14/5/1996 056456564
8 amer 16000 5/7/1992 045564454
9 Abd aziz 55000 7/4/1979 045645645
10 hamad 50000 4/5/1993 045645666
8. alter
a) add column
b)modify length of column
c)drop column
d)drop more than one column
e) add more than one column
9. Rename table
10. Browsing data (select)
- Firstly create the following table (empdata)
- Then enter the data
Empno Ename Sal Birthdate Mobile# nationality
1 Abdullah 5000 14/2/1977 054545454 Saudi
2 omar 6000 14/4/1993 054564645 Saudi
3 khaled 8000 1/4/1990 054564564 Saudi
4 mubark 5500 1/1/1990 054645646 Saudi
5 saad 9000 1/1/1994 056456445 Saudi
6 saad 29000 13/11/1993 045645644 Jordanian
7 Abd allah 30000 14/5/1996 056456564 Jordanian
8 Amer 16000 5/7/1992 045564454 Egyptian
9 Amer 55000 7/4/1979 045645645 Egyptian
10 hamad 60000 4/5/1993 045645666 Suadi
Until empno=10
a) select * from empdata
b) select ename,sal,nationality from empdata
c) select ename, sal*12 as ann_sal from empdata
d) select sysdate from dual;
e) select 545*87 from dual;
f) select ename || ' earns ' || sal || ' every month '
info from empdata
g) select * from empdata
where empno=10;
Note
Type Symbol meaninig
Logical operators
= equal
< > , != , ^ = Not equal
> Less than
< Greater than
>= Less than or equal
<= Greater than or equal
Logical Bitwise and , or , not Contacts between
conditions
h) select * from empdata
where sal >5000 and nationality='Saudi';
i) select ename, sal , mobile
from empdata
where sal between 10000 and 60000
j) select ename , sal , nationality
from empdata
where ename like '%m%'
k) select * from empdata
where ename like 'm%';
L) select * from empdata
where ename like '%h';
m) select ename, sal
from empdata
where ename like '_b%';
n) select * from empdata
where ename like '____';
o) select * from empdata
where ename like 'o__r';
p) select * from empdata
where sal in (6000,5000,55000,60000)
q) select * from empdata
where ename in ('omar','Amer')
r) select ename,sal ,mobile from empdata
order by sal asc
Revision (1)
A)
1)Create table “Student_info” as follows :
Filed Name Type
Student_no Number(4) , primary key
Student_name Varchar2(20)
Student_mobile Number (10)
Student_age Number(4)
1) Insert 2 rows to this table
Student_no Student_name Student_mobile Student_age
100 Ali 054465477 29
101 Omar 059089035 32
3)Display the fields with properties
B)
1) list the steps to create new (RCC with password
KSU) user and
a) log in to user System / Manager
b) write  create user RCC identified by KSU
2) give RCC user all the privileges
grant create session to RCC
grant connect, resource to RCC
c)
study to the following empdata and answer the quesions
a) modify length of filed nationality to 50
alter table empdata
modify nationality varchar2(50)
b) rename the name of table to empinfo
rename empdata to empinfo;
c) delete the column birthdate
alter table empinfo
drop column birthdate;
d) drop the table to recyclein
drop table empinfo;
e) show the contents of the recyclein
show recyclein ;
d)
study the following table and answer the quesions
a) calculate the annual salary for each employee with
column alias "emp_ann_sal”, and display the name
and the annual salary
select ename , sal*12 as emp_ann_sal from empinfo;
b) display the records of empno = 6 and empno=9
select * from empinfo
where empno in (6,9);
c) display all records of employee who earn salary
between 8000 to 16000
select * from empinfo
where sal between 8000 and 16000
d) display all records , that names contain d letter
select * from empinfo
where ename like ‘%d%’;
e)display all records , that names contain 8 letters
select * from empinfo
where ename like ‘________’;
f) return the system date
select sysdate from dual;
g) return the value of 18*35
select 18*35 from dual;
Functions
1) Single
2) Group
2) Single
a. Character
b. Number
c. Date
d. General
e. Conversion
I. Character
a. Upper
b. Lower
c. Initcap
d. Substr
e. Instr
f. Replace
g. Translate
h. Lpad ,rpad ,ltrim ,rtrim
i. length
a)
select ename, upper(ename), lower(ename), initcap(ename)
from empdata
b)
select * from empdata
where upper(ename) like '%S%';
c)
select ename, substr(ename,1,3) from empdata;
d) select ename, instr(ename,'a',1) from empdata
e) select ename, instr(ename,'a',1,2) from empdata;
f) select ename ,replace(ename,'Abdullah','Abdulelah')
from empdata
g) select ename ,translate(ename,'ah','ox')
from empdata
h) select ename, lpad(sal,10,'*') , rpad(sal,10,'*') from empdata;
i) select ename , length (ename), ltrim(ename,'A'), rtrim (ename,'h')
from empdata
II) Number Function
a. Mod
b. Round
c. Trunk
a. select mod (1.5,1), mod (5,2) , mod (5,1) from dual
b. select round (137.74), trunc(137.74) from dual
III) Date Functions and Conversation functions
‘dd-mon-yy’  default , example : 15-jun-02
Rules :
a. date1-date2 = number of days
b. date1(+/-) number of days = date2
c. date1 (+/-) hours/24=date2
d. date+date = not allowed
a. select months_between ('02-12-2013', '04-6-2013') from
dual
b. select add_months ( '2-7-2013',2) from dual
c. select next_day ('2-7-2013', 1) from dual
note : 1(Saturday) , 2( Sunday),………..
d. select last_day ('2-7-2013') from dual
e. select to_char (sysdate, 'dd/mm/yy') from dual;
IV) General Functions
a.
insert into empdata (empno,ename,birthdate,mobile,nationality)
values (11,'Ali','4/6/1990',054546454,'Egyption');
select ename, nvl(sal,0) as " annual salary" from empdata
b. select ename, nullif (sal,60000) from empdata
c. select to_char(sysdate, 'HH:MI:SS AM ') from dual;
IIV) Group functions
a. select count (sal), sum (sal), avg(sal) from empdata
b. select min(sal), max(sal) from empdata
b. suppose this table
no name salary deptno job
1 Ali 5000 10 programmer
2 Khaled 6000 10 analyst
3 Omar 40000 10 designer
4 Sami 55000 20 manager
5 Amer 70000 20 manager
6 Nasser 5440 20 accouter
7 Rami 45400 20 programmer
8 Mubark 20000 30 advisor
9 anas 15000 30 programmer
10 mostafa 22000 30 analyst
c. select deptno ,sum(salary) from empcomp
group by deptno;
d. select deptno,job, sum(salary) from empcomp
group by deptno,job;
d. select job ,sum(salary) from empcomp
group by job;
e. select deptno,job,sum(salary) from empcomp
where deptno <> 30
having sum(salary)>10000
group by deptno, job;
c.
select nationality, sum (sal)
from empdata
group by nationality;
delete rows , update data
a. delete from empdata
where empno=11;
d.
update empdata
set nationality ='Saudi'
where empno =10;
Constraints
 Not null : we must enter a value but duplication
is allowed.
 Unique : duplication is not allowed but null
values is acceptance.
 Check : Any values but must have a condition.
 Primary key : Not null and Unique
 Foreign key : it is a primary key or unique key
from a nother table.
Example:
Table 1 : patient
Pat_no(pk) Pat_name Pat_db Pat_gender
10 Ali 4/4/1992 M
20 Omar 10/5/1998 M
30 Sami 5/5/1978 M
40 Osman 8/9/1990 M
50 Susan 7/6/1981 F
60 Asma 6/7/1997 F
70 Toni 5/7/1985 M
80 Rania 6/9/1978 F
90 Suad 6/7/1995 M
100 Tareq 5/9/1997 M
references
Table 2: visit
vst_no(pk) Pat_no(FK) vst_date
1 10 1/5/2011
2 40 6/5/2012
3 10 6/5/2011
4 60 8/7/2012
5 80 2/2/2013
6 40 6/6/2012
7 70 9/9/2012
8 80 4/2/2013
Join
1) Cartesian join
select pat_name ,pat_db,vst_date
from patient, visit;
2) Equi join
select pat_name, pat_db,vst_date
from patient,visit
where patient.pat_no=visit.pat_no
order by pat_name
3) Outer join
select pat_name, pat_db,vst_date
from patient,visit
where patient.pat_no (+) =visit.pat_no
4) Non - equi join

More Related Content

What's hot

Intoduction to php arrays
Intoduction to php arraysIntoduction to php arrays
The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185
Mahmoud Samir Fayed
 
Introducing Monads and State Monad at PSUG
Introducing Monads and State Monad at PSUGIntroducing Monads and State Monad at PSUG
Introducing Monads and State Monad at PSUG
David Galichet
 
ORACLE NOTES
ORACLE NOTESORACLE NOTES
ORACLE NOTES
Sachin Shukla
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
Pranav Ghildiyal
 
ملخص البرمجة المرئية - الوحدة السادسة
ملخص البرمجة المرئية - الوحدة السادسةملخص البرمجة المرئية - الوحدة السادسة
ملخص البرمجة المرئية - الوحدة السادسة
جامعة القدس المفتوحة
 
libcat 콘솔과 함께 하는 아이폰아이패드 앱 개발
libcat 콘솔과 함께 하는 아이폰아이패드 앱 개발libcat 콘솔과 함께 하는 아이폰아이패드 앱 개발
libcat 콘솔과 함께 하는 아이폰아이패드 앱 개발
WooKyoung Noh
 
Arrays in php
Arrays in phpArrays in php
Arrays in php
Laiby Thomas
 
Swift 성능 이해하기
Swift 성능 이해하기Swift 성능 이해하기
Swift 성능 이해하기
Hangyeol Lee
 
Stanfy MadCode Meetup #9: Functional Programming 101 with Swift
Stanfy MadCode Meetup #9: Functional Programming 101 with SwiftStanfy MadCode Meetup #9: Functional Programming 101 with Swift
Stanfy MadCode Meetup #9: Functional Programming 101 with Swift
Stanfy
 
Oracle SQL
Oracle SQLOracle SQL
Oracle SQL
Anar Godjaev
 
λ | Lenses
λ | Lensesλ | Lenses
λ | Lenses
Open-IT
 
โปรแกรมภาษาซีเบื้องต้น
โปรแกรมภาษาซีเบื้องต้นโปรแกรมภาษาซีเบื้องต้น
โปรแกรมภาษาซีเบื้องต้น
เทวัญ ภูพานทอง
 
The Ring programming language version 1.2 book - Part 20 of 84
The Ring programming language version 1.2 book - Part 20 of 84The Ring programming language version 1.2 book - Part 20 of 84
The Ring programming language version 1.2 book - Part 20 of 84
Mahmoud Samir Fayed
 
CS 151 Classes lecture 2
CS 151 Classes lecture 2CS 151 Classes lecture 2
CS 151 Classes lecture 2
Rudy Martinez
 

What's hot (15)

Intoduction to php arrays
Intoduction to php arraysIntoduction to php arrays
Intoduction to php arrays
 
The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185
 
Introducing Monads and State Monad at PSUG
Introducing Monads and State Monad at PSUGIntroducing Monads and State Monad at PSUG
Introducing Monads and State Monad at PSUG
 
ORACLE NOTES
ORACLE NOTESORACLE NOTES
ORACLE NOTES
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
 
ملخص البرمجة المرئية - الوحدة السادسة
ملخص البرمجة المرئية - الوحدة السادسةملخص البرمجة المرئية - الوحدة السادسة
ملخص البرمجة المرئية - الوحدة السادسة
 
libcat 콘솔과 함께 하는 아이폰아이패드 앱 개발
libcat 콘솔과 함께 하는 아이폰아이패드 앱 개발libcat 콘솔과 함께 하는 아이폰아이패드 앱 개발
libcat 콘솔과 함께 하는 아이폰아이패드 앱 개발
 
Arrays in php
Arrays in phpArrays in php
Arrays in php
 
Swift 성능 이해하기
Swift 성능 이해하기Swift 성능 이해하기
Swift 성능 이해하기
 
Stanfy MadCode Meetup #9: Functional Programming 101 with Swift
Stanfy MadCode Meetup #9: Functional Programming 101 with SwiftStanfy MadCode Meetup #9: Functional Programming 101 with Swift
Stanfy MadCode Meetup #9: Functional Programming 101 with Swift
 
Oracle SQL
Oracle SQLOracle SQL
Oracle SQL
 
λ | Lenses
λ | Lensesλ | Lenses
λ | Lenses
 
โปรแกรมภาษาซีเบื้องต้น
โปรแกรมภาษาซีเบื้องต้นโปรแกรมภาษาซีเบื้องต้น
โปรแกรมภาษาซีเบื้องต้น
 
The Ring programming language version 1.2 book - Part 20 of 84
The Ring programming language version 1.2 book - Part 20 of 84The Ring programming language version 1.2 book - Part 20 of 84
The Ring programming language version 1.2 book - Part 20 of 84
 
CS 151 Classes lecture 2
CS 151 Classes lecture 2CS 151 Classes lecture 2
CS 151 Classes lecture 2
 

Similar to Oracle (SQL), Sulieman Khudruj

SQL (1).pptx
SQL (1).pptxSQL (1).pptx
SQL (1).pptx
AdnanHaque6
 
90 Informatics Practices.pdf
90 Informatics Practices.pdf90 Informatics Practices.pdf
90 Informatics Practices.pdf
vikas500500
 
The purpose of this C++ programming project is to allow the student .pdf
The purpose of this C++ programming project is to allow the student .pdfThe purpose of this C++ programming project is to allow the student .pdf
The purpose of this C++ programming project is to allow the student .pdf
Rahul04August
 
Oren nakdimon oh really... i didn't know it is supported in standard edition
Oren nakdimon   oh really... i didn't know it is supported in standard editionOren nakdimon   oh really... i didn't know it is supported in standard edition
Oren nakdimon oh really... i didn't know it is supported in standard edition
Oren Nakdimon
 
Oracle sql tuning
Oracle sql tuningOracle sql tuning
Oracle sql tuning
bishnupriya Panda
 
The Five Best Things To Happen To SQL
The Five Best Things To Happen To SQLThe Five Best Things To Happen To SQL
The Five Best Things To Happen To SQL
Connor McDonald
 
Beg sql
Beg sqlBeg sql
Beg sql
KPNR Jan
 
Beg sql
Beg sqlBeg sql
Mysql Functions with examples CBSE INDIA 11th class NCERT
Mysql Functions with examples CBSE INDIA 11th class NCERTMysql Functions with examples CBSE INDIA 11th class NCERT
Mysql Functions with examples CBSE INDIA 11th class NCERT
Harish Gyanani
 
Database object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab AssignmentDatabase object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab Assignment
Arun Sial
 
Chapter1.pptx
Chapter1.pptxChapter1.pptx
Chapter1.pptx
WondimuBantihun1
 
Db2考试测试题
Db2考试测试题Db2考试测试题
Db2考试测试题
fm2008
 
Select To Order By
Select  To  Order BySelect  To  Order By
Select To Order By
Krizia Capacio
 
SQL techniques for faster applications
SQL techniques for faster applicationsSQL techniques for faster applications
SQL techniques for faster applications
Connor McDonald
 
Objectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdfObjectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdf
fcsondhiindia
 
C++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdfC++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdf
SumitSingh813090
 
Qno 2 (c)
Qno 2 (c)Qno 2 (c)
Latin America Tour 2019 - 10 great sql features
Latin America Tour 2019  - 10 great sql featuresLatin America Tour 2019  - 10 great sql features
Latin America Tour 2019 - 10 great sql features
Connor McDonald
 
KScope19 - SQL Features
KScope19 - SQL FeaturesKScope19 - SQL Features
KScope19 - SQL Features
Connor McDonald
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
NEERAJ KUMAR
 

Similar to Oracle (SQL), Sulieman Khudruj (20)

SQL (1).pptx
SQL (1).pptxSQL (1).pptx
SQL (1).pptx
 
90 Informatics Practices.pdf
90 Informatics Practices.pdf90 Informatics Practices.pdf
90 Informatics Practices.pdf
 
The purpose of this C++ programming project is to allow the student .pdf
The purpose of this C++ programming project is to allow the student .pdfThe purpose of this C++ programming project is to allow the student .pdf
The purpose of this C++ programming project is to allow the student .pdf
 
Oren nakdimon oh really... i didn't know it is supported in standard edition
Oren nakdimon   oh really... i didn't know it is supported in standard editionOren nakdimon   oh really... i didn't know it is supported in standard edition
Oren nakdimon oh really... i didn't know it is supported in standard edition
 
Oracle sql tuning
Oracle sql tuningOracle sql tuning
Oracle sql tuning
 
The Five Best Things To Happen To SQL
The Five Best Things To Happen To SQLThe Five Best Things To Happen To SQL
The Five Best Things To Happen To SQL
 
Beg sql
Beg sqlBeg sql
Beg sql
 
Beg sql
Beg sqlBeg sql
Beg sql
 
Mysql Functions with examples CBSE INDIA 11th class NCERT
Mysql Functions with examples CBSE INDIA 11th class NCERTMysql Functions with examples CBSE INDIA 11th class NCERT
Mysql Functions with examples CBSE INDIA 11th class NCERT
 
Database object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab AssignmentDatabase object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab Assignment
 
Chapter1.pptx
Chapter1.pptxChapter1.pptx
Chapter1.pptx
 
Db2考试测试题
Db2考试测试题Db2考试测试题
Db2考试测试题
 
Select To Order By
Select  To  Order BySelect  To  Order By
Select To Order By
 
SQL techniques for faster applications
SQL techniques for faster applicationsSQL techniques for faster applications
SQL techniques for faster applications
 
Objectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdfObjectives 1. using indirect addressing 2. passing parameters.pdf
Objectives 1. using indirect addressing 2. passing parameters.pdf
 
C++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdfC++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdf
 
Qno 2 (c)
Qno 2 (c)Qno 2 (c)
Qno 2 (c)
 
Latin America Tour 2019 - 10 great sql features
Latin America Tour 2019  - 10 great sql featuresLatin America Tour 2019  - 10 great sql features
Latin America Tour 2019 - 10 great sql features
 
KScope19 - SQL Features
KScope19 - SQL FeaturesKScope19 - SQL Features
KScope19 - SQL Features
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 

Recently uploaded

How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Diana Rendina
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 

Recently uploaded (20)

How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 

Oracle (SQL), Sulieman Khudruj

  • 1. Lab of the Database System Sulieman Khudruj
  • 2. Database : a collection of organized data , or set of tables with relations. Why oracle ??  High capacity.  Performance.  Security  Web ready Oracle : 1)Databse a.SQL : Structured Query Langauge b.PL/SQL. 2)Developer a.Forms b.Reports Other Tools:  Designer  Portals  Jdevelopers  Discoverer  EM  Grid controls
  • 4. Entity Relation Ship Diagram (ERD) Symbol Meaning Entity type Weak Entity type Relationship type Identifying Relationship type attribute Key attribute Multi valued attribute Composite attribute Derived attribue Simple Example
  • 5. Database contains 2 tables Table 1: Emplyee Empno Ename Sal Birthdate Mobile# Age 1 Ali 5000 14/2/1977 05467756 Table 1: Dept Deptno Deptname 10 Computer 20 Research 30 Sales 40 Accounting Empn o Enam e Employee s Sal Mobile # Birthdat e Age Dept Dento n Deptname Wor k 1 M
  • 6. SQL Commands Types  DDL : Data Definition language Create, Drop, Alter, Rename,….  DML: Data Manipulation language Insert, Delete, Update, select  DCL : Data Control Language Grant, Revoke, …….  Transactions : Commit, Rollback, Save point,… Constraints  Not null : we must enter a value but duplication is allowed.  Unique : duplication is not allowed but null values is acceptance.  Check : Any values but must have a condition.  Primary key : Not null and Unique  Foreign key : it is a primary key or unique key from a nother table.
  • 7. Data Types  Number (5) , can be upto 5  Number (6,2)  Number , it can reserve to the highest value but it is not recommended  Char (10) , Ahamed- - - -  Varchar2(20)  Date : Store Date in many formats
  • 8. 1) Create user , grant create session , grant connect, resource
  • 9. 2.Create table 3.Select * from tab 4.desc name_table
  • 10. 5.drop table, show recyclebin, flashback 6. drop table table_name purge
  • 11. 7. insert Dept table Deptno Depname 10 Computer 20 Resaech 30 Accounting 40 Marketing Employee Empno Ename Sal Birthdate Mobile# 1 abdulelah 5000 14/2/1977 054545454 2 omar 6000 14/4/1993 054564645 3 khaled 8000 1/4/1990 054564564 4 mubark 5500 1/1/1990 054645646 5 saad 9000 1/1/1994 056456445 6 adel 29000 13/11/1993 045645644 7 Abd allah 30000 14/5/1996 056456564 8 amer 16000 5/7/1992 045564454 9 Abd aziz 55000 7/4/1979 045645645 10 hamad 50000 4/5/1993 045645666
  • 12.
  • 13. 8. alter a) add column b)modify length of column
  • 14. c)drop column d)drop more than one column
  • 15. e) add more than one column 9. Rename table
  • 16. 10. Browsing data (select) - Firstly create the following table (empdata) - Then enter the data Empno Ename Sal Birthdate Mobile# nationality 1 Abdullah 5000 14/2/1977 054545454 Saudi 2 omar 6000 14/4/1993 054564645 Saudi 3 khaled 8000 1/4/1990 054564564 Saudi 4 mubark 5500 1/1/1990 054645646 Saudi 5 saad 9000 1/1/1994 056456445 Saudi 6 saad 29000 13/11/1993 045645644 Jordanian 7 Abd allah 30000 14/5/1996 056456564 Jordanian 8 Amer 16000 5/7/1992 045564454 Egyptian 9 Amer 55000 7/4/1979 045645645 Egyptian 10 hamad 60000 4/5/1993 045645666 Suadi
  • 17. Until empno=10 a) select * from empdata
  • 19. c) select ename, sal*12 as ann_sal from empdata d) select sysdate from dual; e) select 545*87 from dual;
  • 20.
  • 21. f) select ename || ' earns ' || sal || ' every month ' info from empdata
  • 22. g) select * from empdata where empno=10; Note Type Symbol meaninig Logical operators = equal < > , != , ^ = Not equal > Less than < Greater than >= Less than or equal <= Greater than or equal Logical Bitwise and , or , not Contacts between conditions
  • 23. h) select * from empdata where sal >5000 and nationality='Saudi'; i) select ename, sal , mobile from empdata where sal between 10000 and 60000
  • 24. j) select ename , sal , nationality from empdata where ename like '%m%' k) select * from empdata where ename like 'm%';
  • 25. L) select * from empdata where ename like '%h'; m) select ename, sal from empdata where ename like '_b%';
  • 26. n) select * from empdata where ename like '____'; o) select * from empdata where ename like 'o__r';
  • 27. p) select * from empdata where sal in (6000,5000,55000,60000) q) select * from empdata where ename in ('omar','Amer')
  • 28. r) select ename,sal ,mobile from empdata order by sal asc
  • 29. Revision (1) A) 1)Create table “Student_info” as follows : Filed Name Type Student_no Number(4) , primary key Student_name Varchar2(20) Student_mobile Number (10) Student_age Number(4) 1) Insert 2 rows to this table Student_no Student_name Student_mobile Student_age 100 Ali 054465477 29 101 Omar 059089035 32 3)Display the fields with properties B)
  • 30. 1) list the steps to create new (RCC with password KSU) user and a) log in to user System / Manager b) write  create user RCC identified by KSU 2) give RCC user all the privileges grant create session to RCC grant connect, resource to RCC
  • 31. c) study to the following empdata and answer the quesions a) modify length of filed nationality to 50 alter table empdata modify nationality varchar2(50) b) rename the name of table to empinfo rename empdata to empinfo; c) delete the column birthdate alter table empinfo drop column birthdate; d) drop the table to recyclein drop table empinfo; e) show the contents of the recyclein show recyclein ;
  • 32. d) study the following table and answer the quesions a) calculate the annual salary for each employee with column alias "emp_ann_sal”, and display the name and the annual salary select ename , sal*12 as emp_ann_sal from empinfo; b) display the records of empno = 6 and empno=9 select * from empinfo where empno in (6,9); c) display all records of employee who earn salary between 8000 to 16000 select * from empinfo where sal between 8000 and 16000
  • 33. d) display all records , that names contain d letter select * from empinfo where ename like ‘%d%’; e)display all records , that names contain 8 letters select * from empinfo where ename like ‘________’; f) return the system date select sysdate from dual; g) return the value of 18*35 select 18*35 from dual;
  • 34. Functions 1) Single 2) Group 2) Single a. Character b. Number c. Date d. General e. Conversion I. Character a. Upper b. Lower c. Initcap d. Substr e. Instr f. Replace g. Translate h. Lpad ,rpad ,ltrim ,rtrim i. length
  • 35. a) select ename, upper(ename), lower(ename), initcap(ename) from empdata b) select * from empdata where upper(ename) like '%S%';
  • 36. c) select ename, substr(ename,1,3) from empdata; d) select ename, instr(ename,'a',1) from empdata
  • 37. e) select ename, instr(ename,'a',1,2) from empdata; f) select ename ,replace(ename,'Abdullah','Abdulelah') from empdata
  • 38. g) select ename ,translate(ename,'ah','ox') from empdata h) select ename, lpad(sal,10,'*') , rpad(sal,10,'*') from empdata;
  • 39. i) select ename , length (ename), ltrim(ename,'A'), rtrim (ename,'h') from empdata
  • 40. II) Number Function a. Mod b. Round c. Trunk a. select mod (1.5,1), mod (5,2) , mod (5,1) from dual b. select round (137.74), trunc(137.74) from dual
  • 41. III) Date Functions and Conversation functions ‘dd-mon-yy’  default , example : 15-jun-02 Rules : a. date1-date2 = number of days b. date1(+/-) number of days = date2 c. date1 (+/-) hours/24=date2 d. date+date = not allowed a. select months_between ('02-12-2013', '04-6-2013') from dual b. select add_months ( '2-7-2013',2) from dual
  • 42. c. select next_day ('2-7-2013', 1) from dual note : 1(Saturday) , 2( Sunday),……….. d. select last_day ('2-7-2013') from dual
  • 43. e. select to_char (sysdate, 'dd/mm/yy') from dual;
  • 44. IV) General Functions a. insert into empdata (empno,ename,birthdate,mobile,nationality) values (11,'Ali','4/6/1990',054546454,'Egyption'); select ename, nvl(sal,0) as " annual salary" from empdata b. select ename, nullif (sal,60000) from empdata
  • 45. c. select to_char(sysdate, 'HH:MI:SS AM ') from dual; IIV) Group functions a. select count (sal), sum (sal), avg(sal) from empdata
  • 46. b. select min(sal), max(sal) from empdata b. suppose this table no name salary deptno job 1 Ali 5000 10 programmer 2 Khaled 6000 10 analyst 3 Omar 40000 10 designer 4 Sami 55000 20 manager 5 Amer 70000 20 manager 6 Nasser 5440 20 accouter 7 Rami 45400 20 programmer 8 Mubark 20000 30 advisor 9 anas 15000 30 programmer 10 mostafa 22000 30 analyst
  • 47. c. select deptno ,sum(salary) from empcomp group by deptno; d. select deptno,job, sum(salary) from empcomp group by deptno,job;
  • 48. d. select job ,sum(salary) from empcomp group by job; e. select deptno,job,sum(salary) from empcomp where deptno <> 30 having sum(salary)>10000 group by deptno, job;
  • 49. c. select nationality, sum (sal) from empdata group by nationality;
  • 50. delete rows , update data a. delete from empdata where empno=11; d. update empdata set nationality ='Saudi' where empno =10;
  • 51. Constraints  Not null : we must enter a value but duplication is allowed.  Unique : duplication is not allowed but null values is acceptance.  Check : Any values but must have a condition.  Primary key : Not null and Unique  Foreign key : it is a primary key or unique key from a nother table.
  • 52. Example: Table 1 : patient Pat_no(pk) Pat_name Pat_db Pat_gender 10 Ali 4/4/1992 M 20 Omar 10/5/1998 M 30 Sami 5/5/1978 M 40 Osman 8/9/1990 M 50 Susan 7/6/1981 F 60 Asma 6/7/1997 F 70 Toni 5/7/1985 M 80 Rania 6/9/1978 F 90 Suad 6/7/1995 M 100 Tareq 5/9/1997 M references Table 2: visit vst_no(pk) Pat_no(FK) vst_date 1 10 1/5/2011 2 40 6/5/2012 3 10 6/5/2011 4 60 8/7/2012 5 80 2/2/2013 6 40 6/6/2012 7 70 9/9/2012 8 80 4/2/2013
  • 53.
  • 54.
  • 55. Join 1) Cartesian join select pat_name ,pat_db,vst_date from patient, visit; 2) Equi join select pat_name, pat_db,vst_date from patient,visit where patient.pat_no=visit.pat_no order by pat_name
  • 56. 3) Outer join select pat_name, pat_db,vst_date from patient,visit where patient.pat_no (+) =visit.pat_no 4) Non - equi join