SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
Veri Modelleme ve Iliskisel
Veritabanlari Dersi

Proje Dökümanı
                              Murat Gülci
                              Bu projede bir Helpdesk database’i tasarlandı ve
                              oluşturuldu. Kullanıcıların takibi, problemlerin ve problemin
                              geçmişinin takibi, envanter takibi ve Bilgi işlem
                              çalışanlarının yeteneklerinin takibi yapılabilmesi
                              sağlandı.Hazırlanan bütün sorgular, karşılaşılabilinecek
                              gerçek senaryolar düşünülerek hazırlandı.




   Bahceşehir Üniversitesi

                  BEŞİKTAŞ

             ALPER TUNGA

    Veritabanı ve İlişkisel
            Veritabanları

                  YZM5507
1. Database E-R şeması
2. Database oluşturma
                        Query                         Result
CREATE TABLE "REF_EQUIPMENT_TYPES"
   (    "EQUIPMENT_TYPE_CODE" NUMBER(5,0),
        "EQUIPMENT_TYPE_DESCRIPTION" VARCHAR2(50),
         PRIMARY KEY ("EQUIPMENT_TYPE_CODE") ENABLE
   ) ;




                        Query                         Result
CREATE TABLE "REF_SKILL_CODES"
   (    "SKILL_CODE" NUMBER(5,0),
        "SKILL_DESCRIPTION" VARCHAR2(50),
         PRIMARY KEY ("SKILL_CODE") ENABLE
   ) ;




                         Query                        Result

CREATE TABLE "STAFF_SKILLS"
   (    "STAFF_ID" NUMBER(5,0),
        "SKILL_CODE" NUMBER(5,0),
        "DATE_SKILL_OBTAINED" DATE,
         PRIMARY KEY ("STAFF_ID") ENABLE
   ) ;




                         Query                        Result

CREATE TABLE "EQUIPMENT"
   (    "EQUIPMENT_ID" NUMBER,
             "EQUIPMENT_TYPE_CODE" NUMBER,
            "DATA_EQUIPMENT_ACQUIRED" DATE,
            "DATE_EQUIPMENT_DISPOSED" DATE,

            "EQUIPMENT_CODE" NUMBER(10,0),

              "EQUIPMENT_NAME" CHAR(20),

        "EQUIPMENT_DESCRIPTION" VARCHAR2(50),

            "MANUFACTURER_NAME" CHAR(20),

         CONSTRAINT "EQUIPMENT_PK" PRIMARY KEY
("EQUIPMENT_ID") ENABLE
   )
Query                           Result

CREATE TABLE "SUPPORT_STAFF"
   (    "STAFF_ID" NUMBER(5,0),
        "DATE_JOINED" DATE,
        "DATE_LEFT" DATE,
        "STAFF_NAME" CHAR(40),
        "STAFF_PHONE" NUMBER(10,0),
        "STAFF_EMAIL" CHAR(50),
        "STAFF_LOCATION" CHAR(10),
         PRIMARY KEY ("STAFF_ID") ENABLE
   ) ;



                         Query                           Result

CREATE TABLE "REF_USER_TYPES"
   (    "USER_TYPE_CODE" NUMBER(10,0),
        "USER_TYPE_DESCRIPTION" VARCHAR2(50),
         PRIMARY KEY ("USER_TYPE_CODE") ENABLE
   ) ;



                         Query                           Result

CREATE TABLE "REF_PRIORITY_LEVELS"
   (    "PROBLEM_LEVEL_CODE" NUMBER(3,0),
        "PRIORITY_LEVEL_DESCRIPTION" VARCHAR2(10),
         PRIMARY KEY ("PROBLEM_LEVEL_CODE") ENABLE
   ) ;



                         Query                           Result

CREATE TABLE "REF_PROBLEM_STATUS_CODE"
   (    "PROBLEM_STATUS_CODE" NUMBER(3,0),
        "PROBLEM_STATUS_DESCRIPTION" VARCHAR2(10),
         PRIMARY KEY ("PROBLEM_STATUS_CODE") ENABLE
   ) ;



                         Query                           Result


CREATE TABLE "USERS"
   (    "USER_ID" NUMBER(5,0),
        "USER_TYPE_CODE" NUMBER(10,0),
        "USER_FIRST_NAME" CHAR(20),
        "USER_LAST_NAME" CHAR(20),
        "USER_PHONE" NUMBER(10,0),
        "USER_EMAIL" CHAR(50),
        "ADDRESS" VARCHAR2(100),
         CONSTRAINT "USERS_PK" PRIMARY KEY ("USER_ID")
ENABLE
 );
                         Query                           Result
CREATE TABLE "PROBLEMS"
   (    "PROBLEM_ID" NUMBER(10,0) NOT NULL ENABLE,
        "EQUIPMENT_ID" NUMBER(10,0) NOT NULL ENABLE,
        "USER_ID" NUMBER(5,0) NOT NULL ENABLE,
        "PROBLEM_REPORTED_DATETIME" DATE NOT NULL
ENABLE,
        "PROBLEM_DESCRIPTION" VARCHAR2(500) NOT NULL
ENABLE,
         CONSTRAINT "PROBLEMS_PK" PRIMARY KEY
("PROBLEM_ID") ENABLE
   );



                         Query                          Result

CREATE TABLE "PROBLEM_HISTORY"
   (    "PROBLEM_HISTORY_ID" NUMBER(10,0) NOT NULL
ENABLE,
        "PRIORITY_LEVEL_CODE" NUMBER(3,0) NOT NULL
ENABLE,
        "PROBLEM_ID" NUMBER(10,0) NOT NULL ENABLE,
        "PROBLEM_STATUS_CODE" NUMBER(3,0) NOT NULL
ENABLE,
        "ASSIGNED_STAFF_ID" NUMBER(5,0) NOT NULL
ENABLE,
        "FIX_DATETIME" DATE NOT NULL ENABLE,
        "PROBLEM_HISTORY_DESCRIPTION" VARCHAR2(500)
NOT NULL ENABLE,
         CONSTRAINT "PROBLEM_HISTORY_PK" PRIMARY KEY
("PROBLEM_HISTORY_ID") ENABLE
   );



                         Query                          Result

CREATE TABLE "RESOLUTIONS"
   (    "RESOLUTION_ID" NUMBER(10,0) NOT NULL ENABLE,
        "PROBLEM_HISTORY_ID" NUMBER(10,0),
        "RESOLUTION_DESCRIPTION" VARCHAR2(500),
         CONSTRAINT "RESOLUTIONS_PK" PRIMARY KEY
("RESOLUTION_ID") ENABLE
   ) ;
3. Table’lara kısıt ekleme
                         Query                           Result

ALTER TABLE "STAFF_SKILLS" ADD CONSTRAINT
"STAFF_SKILLS_CON" FOREIGN KEY ("SKILL_CODE")
REFERENCES "REF_SKILL_CODES" ("SKILL_CODE") ENABLE;



                         Query                           Result

ALTER TABLE "EQUIPMENT" ADD CONSTRAINT
"EQUIPMENT_CON" FOREIGN KEY ("EQUIPMENT_TYPE_CODE")
          REFERENCES "REF_EQUIPMENT_TYPES"
("EQUIPMENT_TYPE_CODE") ENABLE;




                         Query                           Result

ALTER TABLE "PROBLEMS" ADD CONSTRAINT "PROBLEMS_CON"
FOREIGN KEY ("USER_ID")
          REFERENCES "USERS" ("USER_ID") ENABLE;ALTER
TABLE "PROBLEMS" ADD CONSTRAINT "PROBLEMS_FK" FOREIGN
KEY ("EQUIPMENT_ID")
          REFERENCES "EQUIPMENT" ("EQUIPMENT_ID")
ENABLE;


                         Query                           Result

ALTER TABLE "PROBLEM_HISTORY" ADD CONSTRAINT
"PROBLEM_HISTORY_FK" FOREIGN KEY
("PRIORITY_LEVEL_CODE")
          REFERENCES "REF_PRIORITY_LEVELS"
("PROBLEM_LEVEL_CODE") ENABLE;ALTER TABLE
"PROBLEM_HISTORY" ADD CONSTRAINT "PROBLEM_HISTORY_FK2"
FOREIGN KEY ("PROBLEM_ID")
          REFERENCES "PROBLEMS" ("PROBLEM_ID")
ENABLE;ALTER TABLE "PROBLEM_HISTORY" ADD CONSTRAINT
"PROBLEM_HISTORY_FK3" FOREIGN KEY
("PROBLEM_STATUS_CODE")
          REFERENCES "REF_PROBLEM_STATUS_CODE"
("PROBLEM_STATUS_CODE") ENABLE;ALTER TABLE
"PROBLEM_HISTORY" ADD CONSTRAINT "PROBLEM_HISTORY_FK4"
FOREIGN KEY ("ASSIGNED_STAFF_ID")
          REFERENCES "SUPPORT_STAFF" ("STAFF_ID")
ENABLE;
Query                          Result

ALTER TABLE "RESOLUTIONS" ADD CONSTRAINT
"RESOLUTIONS_FK" FOREIGN KEY ("PROBLEM_HISTORY_ID")
          REFERENCES "PROBLEM_HISTORY"
("PROBLEM_HISTORY_ID") ENABLE;


                         Query                          Result

ALTER TABLE "USERS" ADD CONSTRAINT "USERS_FK" FOREIGN
KEY ("USER_TYPE_CODE")
          REFERENCES "REF_USER_TYPES"
("USER_TYPE_CODE") ENABLE;
4. Select Sorgular

           a. En Sorunlu ürünler




Query
Select
  REF_EQUIPMENT_TYPES.EQUIPMENT_TYPE_DESCRIPTION,
  EQUIPMENT.EQUIPMENT_TYPE_CODE,
  EQUIPMENT.EQUIPMENT_NAME,
  EQUIPMENT.EQUIPMENT_DESCRIPTION,
  PROBLEMS.EQUIPMENT_ID As EQUIPMENT_ID1,
  Count(PROBLEMS.EQUIPMENT_ID) as "Problem Sayısı"
From
  EQUIPMENT Inner Join
  REF_EQUIPMENT_TYPES On EQUIPMENT.EQUIPMENT_TYPE_CODE =
    REF_EQUIPMENT_TYPES.EQUIPMENT_TYPE_CODE Inner Join
  PROBLEMS On PROBLEMS.EQUIPMENT_ID = EQUIPMENT.EQUIPMENT_ID
Where
  PROBLEMS.EQUIPMENT_ID = EQUIPMENT.EQUIPMENT_ID
Group By
  REF_EQUIPMENT_TYPES.EQUIPMENT_TYPE_DESCRIPTION, EQUIPMENT.EQUIPMENT_TYPE_CODE,
  EQUIPMENT.EQUIPMENT_NAME, EQUIPMENT.EQUIPMENT_DESCRIPTION,
  PROBLEMS.EQUIPMENT_ID
Order By
  Count(PROBLEMS.EQUIPMENT_ID) Desc

Query 2:

select EQUIPMENT_ID, count(EQUIPMENT_ID)
from problems

group by EQUIPMENT_ID
having count(EQUIPMENT_ID)>1
order by count(EQUIPMENT_ID) desc

Result




Result 2
b. En çok sorun çözen IT elemanları

Query
Select
  SUPPORT_STAFF.STAFF_ID,
  SUPPORT_STAFF.STAFF_NAME,
  SUPPORT_STAFF.STAFF_EMAIL,
  REF_SKILL_CODES.SKILL_DESCRIPTION,
  Count(PROBLEM_HISTORY.ASSIGNED_STAFF_ID) as "Sorun Sayısı"
From
  PROBLEM_HISTORY Inner Join
  SUPPORT_STAFF On PROBLEM_HISTORY.ASSIGNED_STAFF_ID = SUPPORT_STAFF.STAFF_ID
  Inner Join
  STAFF_SKILLS On STAFF_SKILLS.STAFF_ID = SUPPORT_STAFF.STAFF_ID Inner Join
  REF_SKILL_CODES On STAFF_SKILLS.SKILL_CODE = REF_SKILL_CODES.SKILL_CODE
Group By
  SUPPORT_STAFF.STAFF_ID, SUPPORT_STAFF.STAFF_NAME, SUPPORT_STAFF.STAFF_EMAIL,
  REF_SKILL_CODES.SKILL_DESCRIPTION
Order By
  Count(PROBLEM_HISTORY.ASSIGNED_STAFF_ID) Desc
Result




         c. En sorunlu Kullanıcılar

Query
Select
  USERS.USER_ID,
  USERS.USER_FIRST_NAME,
  USERS.USER_LAST_NAME,
  USERS.USER_EMAIL,
  REF_USER_TYPES.USER_TYPE_DESCRIPTION,
  Count(PROBLEMS.USER_ID) As Problem_Count
From
  PROBLEMS Inner Join
  USERS On PROBLEMS.USER_ID = USERS.USER_ID Inner Join
  REF_USER_TYPES On USERS.USER_TYPE_CODE = REF_USER_TYPES.USER_TYPE_CODE
Group By
  USERS.USER_ID, USERS.USER_FIRST_NAME, USERS.USER_LAST_NAME, USERS.USER_EMAIL,
  REF_USER_TYPES.USER_TYPE_DESCRIPTION
Order By
  Count(PROBLEMS.USER_ID) Desc

Result
d. Açık Çağrılar Listesi

Query
Select
  PROBLEM_HISTORY.PROBLEM_HISTORY_ID,
  REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION,
  SUPPORT_STAFF.STAFF_NAME,
  PROBLEMS.PROBLEM_DESCRIPTION,
  PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION,
  REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_DESCRIPTION
From
  PROBLEM_HISTORY Inner Join
  REF_PROBLEM_STATUS_CODE On PROBLEM_HISTORY.PROBLEM_STATUS_CODE =
    REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_CODE Inner Join
  SUPPORT_STAFF On PROBLEM_HISTORY.ASSIGNED_STAFF_ID = SUPPORT_STAFF.STAFF_ID
  Inner Join
  REF_PRIORITY_LEVELS On PROBLEM_HISTORY.PRIORITY_LEVEL_CODE =
    REF_PRIORITY_LEVELS.PROBLEM_LEVEL_CODE Inner Join
  PROBLEMS On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID
Where
  PROBLEM_HISTORY.PROBLEM_STATUS_CODE = 803

Result




         e. SLA süresinde çözülmeyen işler
Query
Select
  PROBLEMS.PROBLEM_ID,
  PROBLEMS.PROBLEM_REPORTED_DATETIME,
  PROBLEM_HISTORY.FIX_DATETIME,
  USERS.USER_FIRST_NAME,
  USERS.USER_LAST_NAME,
  PROBLEMS.PROBLEM_DESCRIPTION,
  REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION
From
  PROBLEMS Inner Join
  PROBLEM_HISTORY On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join
  REF_PRIORITY_LEVELS On PROBLEM_HISTORY.PRIORITY_LEVEL_CODE =
    REF_PRIORITY_LEVELS.PROBLEM_LEVEL_CODE Inner Join
  USERS On PROBLEMS.USER_ID = USERS.USER_ID
Where
  PROBLEM_HISTORY.FIX_DATETIME > PROBLEMS.PROBLEM_REPORTED_DATETIME

Result
f. 40000000007 no’lu problemin geçmiş detayı

Query
Select
  PROBLEMS.PROBLEM_ID,
  PROBLEMS.PROBLEM_DESCRIPTION,
  REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION,
  REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_DESCRIPTION,
  PROBLEM_HISTORY.FIX_DATETIME,
  SUPPORT_STAFF.STAFF_NAME,
  PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION
From
  PROBLEMS Inner Join
  PROBLEM_HISTORY On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join
  REF_PROBLEM_STATUS_CODE On PROBLEM_HISTORY.PROBLEM_STATUS_CODE =
    REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_CODE Inner Join
  REF_PRIORITY_LEVELS On PROBLEM_HISTORY.PRIORITY_LEVEL_CODE =
    REF_PRIORITY_LEVELS.PROBLEM_LEVEL_CODE Inner Join
  SUPPORT_STAFF On PROBLEM_HISTORY.ASSIGNED_STAFF_ID = SUPPORT_STAFF.STAFF_ID
Where
  PROBLEMS.PROBLEM_ID = 4000000007

Result



         g. Ahmet Kullanıcısının Çağrılarının detayları

Query
Select
  USERS.USER_FIRST_NAME,
  USERS.USER_LAST_NAME,
  PROBLEMS.PROBLEM_DESCRIPTION,
  PROBLEM_HISTORY.FIX_DATETIME,
  PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION,
  REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION
From
  USERS Inner Join
  PROBLEMS On PROBLEMS.USER_ID = USERS.USER_ID Inner Join
  PROBLEM_HISTORY On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join
  REF_PRIORITY_LEVELS On PROBLEM_HISTORY.PRIORITY_LEVEL_CODE =
    REF_PRIORITY_LEVELS.PROBLEM_LEVEL_CODE
Where
  USERS.USER_FIRST_NAME = 'Ahmet'

Query_2
select
   PROBLEM_ID, PROBLEM_DESCRIPTION
from
    problems p, users u
where
    p.user_id = u.user_id and u.user_first_name like 'Ahme%'

Result



Result2
h. Geçen Seneki çağrıların toplamı

Query
Select
  Count(Distinct PROBLEM_HISTORY.PROBLEM_ID) as "2011 Çağrı Adedi"
From
  PROBLEMS Inner Join
  PROBLEM_HISTORY On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID
Where
  Extract(Year From PROBLEM_HISTORY.FIX_DATETIME) = 2011

Result




         i. Atanmamış çağrılar

Query
Select
  EQUIPMENT.EQUIPMENT_NAME,
  USERS.USER_FIRST_NAME,
  USERS.USER_LAST_NAME,
  PROBLEMS.PROBLEM_REPORTED_DATETIME,
  PROBLEMS.PROBLEM_DESCRIPTION
From
  PROBLEMS Inner Join
  EQUIPMENT On PROBLEMS.EQUIPMENT_ID = EQUIPMENT.EQUIPMENT_ID Inner Join
  USERS On PROBLEMS.USER_ID = USERS.USER_ID
Where
  PROBLEMS.PROBLEM_ID Not In (Select Distinct
    (PROBLEM_HISTORY.PROBLEM_ID)
  From
    PROBLEM_HISTORY)



Result
j. Kapatılan Çağrılar

Query
Select
  PROBLEMS.PROBLEM_ID,
  USERS.USER_FIRST_NAME,
  USERS.USER_LAST_NAME,
  EQUIPMENT.EQUIPMENT_NAME,
  REF_EQUIPMENT_TYPES.EQUIPMENT_TYPE_DESCRIPTION,
  PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION
From
  PROBLEMS Inner Join
  PROBLEM_HISTORY On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join
  USERS On PROBLEMS.USER_ID = USERS.USER_ID Inner Join
  EQUIPMENT On PROBLEMS.EQUIPMENT_ID = EQUIPMENT.EQUIPMENT_ID Inner Join
  REF_EQUIPMENT_TYPES On EQUIPMENT.EQUIPMENT_TYPE_CODE =
    REF_EQUIPMENT_TYPES.EQUIPMENT_TYPE_CODE
Where
  PROBLEM_HISTORY.PROBLEM_STATUS_CODE = 804

Result




         k. Zor seviyesindeki çağrıların detay durumu

Query
Select
  PROBLEMS.PROBLEM_ID,
  USERS.USER_FIRST_NAME,
  USERS.USER_LAST_NAME,
  PROBLEMS.PROBLEM_DESCRIPTION,
  PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION,
  SUPPORT_STAFF.STAFF_NAME
From
  PROBLEM_HISTORY Inner Join
  PROBLEMS On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join
  USERS On PROBLEMS.USER_ID = USERS.USER_ID Inner Join
  SUPPORT_STAFF On PROBLEM_HISTORY.ASSIGNED_STAFF_ID = SUPPORT_STAFF.STAFF_ID
Where
  PROBLEM_HISTORY.PRIORITY_LEVEL_CODE = 703



Result
l. Problem çözümü girilmiş problemlerin listesi

Query
Select Distinct
  PROBLEM_HISTORY.PROBLEM_ID
From
  PROBLEM_HISTORY
Order By
  PROBLEM_HISTORY.PROBLEM_ID

Result
5. Update sorguları
               a. Açık çağrıların kapatılması

Query
update problem_history

set problem_status_code =
  (select problem_status_code
  from ref_problem_status_code
  where problem_status_description='kapandı')
where
  problem_status_code in
  (select p.problem_status_code
  from problem_history p, ref_problem_status_code s
  where problem_status_description='açık' and
s.problem_status_code=p.problem_status_code)

Result
b. Çözüm girilen çağrıların kapatılması

Query
update problem_history
set problem_status_code =
  (select problem_status_code
  from ref_problem_status_code
  where problem_status_description='kapandı')
where
  problem_status_code in
  (select h.problem_status_code
      from problem_history h, resolutions r
      where r.problem_history_id=h.problem_history_id)

Result




               c. Support Elemanına skill ekleme ve tarihi güncelleme

Query
INSERT INTO ref_skill_codes VALUES (3006,'Senior Programmer');

update staff_skills
    set (skill_code, date_skill_obtained) =
    (select skill_code, to_date(sysdate, 'dd/mm/yyyy' )
        from ref_skill_codes
        where skill_description='Senior Programmer'     )
where
  skill_code =
  (select st.skill_code
      from staff_skills st, support_staff su
      where st.staff_id=su.staff_id and su.staff_name='Murat');
Result
d. User’ın type’ı değişmesi(müdür olması)

Query
INSERT INTO ref_user_types VALUES (6000000006,'Muhasebe Müdürü')


update users
    set USER_TYPE_CODE =
    ( select user_type_code from ref_user_types where
      USER_TYPE_DESCRIPTION = 'Muhasebe Müdürü')
where
  USER_TYPE_CODE =
  (select USER_TYPE_CODE
      from users
      where user_id='30003' and user_first_name='Eyüp')

Result
1 row(s) updated. 0.00 seconds

     select u.user_first_name, ru.USER_TYPE_DESCRIPTION
       from users u, ref_user_types ru
       where u.user_id='30003' and u.user_type_code=ru.user_type_code;




                     e. Prblem açıklaması değiştirilmesi

Query
update problems
    set PROBLEM_DESCRIPTION = 'Yazıcıya yazdırırken yazdırılamadı şeklinde
hata veriyor. dün çalışıyordu,sorun yoktu'

where
  problem_id = '4000000001'

Result
1 row(s) updated. 0.02 seconds



select problem_id, PROBLEM_DESCRIPTION from problems where problem_id='4000000001'
f.   equipment_code(seri no) değiştirilmesi

Query
update EQUIPMENT
    set EQUIPMENT_CODE = '2000000006'

where
    EQUIPMENT_CODE = '2000000005' and EQUIPMENT_ID = '1000000005'

Result
1 row(s) updated. 0.03 seconds

select EQUIPMENT_ID, EQUIPMENT_CODE from EQUIPMENT where                  EQUIPMENT_ID =
'1000000005'




                      g. Support elemanlarına yeni sorun atanması

Query
select p.problem_id
     from problems p
     where p.problem_id not in (select problem_id from problem_history)




INSERT INTO problem_history VALUES
    (5000000011,701,
        (select p.problem_id from problems p where p.problem_id not in
(select problem_id from problem_history)),
        802,1002, TO_DATE ('06/06/2011', 'dd/mm/yyyy'),'xc')

Result
1 row(s) inserted. 0.06 seconds

select p.problem_id from problems p where p.problem_id not in (select problem_id
from problem_history)

no data found
h. equipment silinmesi

Query
ALTER TABLE      "PROBLEMS" disable CONSTRAINT "PROBLEMS_FK"

Table altered. 0.03 seconds

delete
    from equipment
    where EQUIPMENT_ID='1000000002'

Result
1 row(s) deleted. 0.01 seconds




                     i.   user silinmesi

Query
ALTER TABLE      "PROBLEMS" disable CONSTRAINT "PROBLEMS_CON"

Table altered. 0.08 seconds

delete
    from users
    where user_first_name='Ayşe' and user_last_name='Cebeci' and
user_id='30005'


Result
1 row(s) deleted. 0.01 seconds




                     j.   Problem History Kaydı silinmesi

Query
delete
    from problem_history
    where PROBLEM_HISTORY_ID= '5000000006'

Result
1 row(s) deleted. 0.01 seconds
k.   Support Stuff silinmesi

Query
delete
    from support_staff
    where staff_id='1001' and staff_name = 'Mustafa'

Result
1 row(s) deleted. 0.01 seconds



                     l.   Sorun İstatistikleri

Query
select
   min(count(p.ASSIGNED_STAFF_ID)) as "En az Sorunla İlgilenen",
   max(count(p.ASSIGNED_STAFF_ID)) as "En Fazla Sorunla İlgilenen",
   round(avg(count(p.ASSIGNED_STAFF_ID)),1) as "Ortama Sorunla İlgilenen"

from problem_history p

group by p.ASSIGNED_STAFF_ID
Result
m. Case kullanmak

Query
select

    problem_history_id, PROBLEM_HISTORY_DESCRIPTION,
    case
    when ASSIGNED_STAFF_ID= '1001' then 'Mustafa ilgileniyor'
    when ASSIGNED_STAFF_ID= '1002' then 'Dinçer ilgileniyor'
    when ASSIGNED_STAFF_ID= '1003' then 'Şükrü ilgileniyor'
    else 'Başkası ilgileniyor'
    end as Kim_ilgileniyor

from problem_history
Result
6. Extra Sorgular

                a. Genel Bakış view oluşturma

Query
CREATE OR REPLACE VIEW genel_bakis
AS

Select
 PROBLEM_HISTORY.PROBLEM_ID,
 PROBLEM_HISTORY.PROBLEM_HISTORY_ID,
 REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION,
 REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_DESCRIPTION,
 SUPPORT_STAFF.STAFF_NAME,
 PROBLEM_HISTORY.FIX_DATETIME,
 PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION,
 EQUIPMENT.EQUIPMENT_NAME,
 USERS.USER_FIRST_NAME || ' ' || USERS.USER_LAST_NAME as Kullanıcı
From
 PROBLEM_HISTORY Inner Join
 REF_PROBLEM_STATUS_CODE On PROBLEM_HISTORY.PROBLEM_STATUS_CODE =
  REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_CODE Inner Join
 REF_PRIORITY_LEVELS On PROBLEM_HISTORY.PRIORITY_LEVEL_CODE =
  REF_PRIORITY_LEVELS.PROBLEM_LEVEL_CODE Inner Join
 SUPPORT_STAFF On PROBLEM_HISTORY.ASSIGNED_STAFF_ID = SUPPORT_STAFF.STAFF_ID
 Inner Join
 PROBLEMS On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join
 EQUIPMENT On PROBLEMS.EQUIPMENT_ID = EQUIPMENT.EQUIPMENT_ID Inner Join
 USERS On PROBLEMS.USER_ID = USERS.USER_ID
Group By
 PROBLEM_HISTORY.PROBLEM_ID, PROBLEM_HISTORY.PROBLEM_HISTORY_ID,
 REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION,
 REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_DESCRIPTION, SUPPORT_STAFF.STAFF_NAME,
 PROBLEM_HISTORY.FIX_DATETIME, PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION,
 EQUIPMENT.EQUIPMENT_NAME, USERS.USER_FIRST_NAME, USERS.USER_LAST_NAME
Order By
 PROBLEM_HISTORY.PROBLEM_ID

Result
b. Index Oluşturma

Query
CREATE INDEX problem__id_index ON problem_history(problem_id);

Result
Index created.




                  c. Sequence Oluşturma

Query
CREATE SEQUENCE EQUIPMENT_ID
INCREMENT BY 1

Result
Sequence created.




                  d. Select ile yedek almak

Query
select * into problems_backup from problems

Result




           7. Sonuçlar
           Görev           Beklenen      Yapılan
table oluşturma            6-7 tablo   13 tablo
Select sorgusu             10          12
Update/delete sorgusu      10          10
İndex oluşturma            0           1
View oluşturma             0           1
Sequence oluşturma         0           1

Más contenido relacionado

La actualidad más candente

BD I - Aula 13 B - Agrupando dados - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando dados  - Parte 04 - Exercicios EnunciadoBD I - Aula 13 B - Agrupando dados  - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando dados - Parte 04 - Exercicios EnunciadoRodrigo Kiyoshi Saito
 
BD I - Aula 13 B - Agrupando Dados - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando Dados  - Parte 04 - Exercicios EnunciadoBD I - Aula 13 B - Agrupando Dados  - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando Dados - Parte 04 - Exercicios EnunciadoRodrigo Kiyoshi Saito
 
Dig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup CairoDig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup CairoMohamed Mosaad
 
Xamarin: Introduction to iOS 8
Xamarin: Introduction to iOS 8Xamarin: Introduction to iOS 8
Xamarin: Introduction to iOS 8Xamarin
 
Ajax nested form and ajax upload in rails
Ajax nested form and ajax upload in railsAjax nested form and ajax upload in rails
Ajax nested form and ajax upload in railsTse-Ching Ho
 
UITableView Pain Points
UITableView Pain PointsUITableView Pain Points
UITableView Pain PointsKen Auer
 
What's Coming Next in Sencha Frameworks
What's Coming Next in Sencha FrameworksWhat's Coming Next in Sencha Frameworks
What's Coming Next in Sencha FrameworksGrgur Grisogono
 
Recent Changes to jQuery's Internals
Recent Changes to jQuery's InternalsRecent Changes to jQuery's Internals
Recent Changes to jQuery's Internalsjeresig
 
Android development for iOS developers
Android development for iOS developersAndroid development for iOS developers
Android development for iOS developersDarryl Bayliss
 

La actualidad más candente (13)

Separation of concerns - DPC12
Separation of concerns - DPC12Separation of concerns - DPC12
Separation of concerns - DPC12
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
BD I - Aula 13 B - Agrupando dados - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando dados  - Parte 04 - Exercicios EnunciadoBD I - Aula 13 B - Agrupando dados  - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando dados - Parte 04 - Exercicios Enunciado
 
BD I - Aula 13 B - Agrupando Dados - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando Dados  - Parte 04 - Exercicios EnunciadoBD I - Aula 13 B - Agrupando Dados  - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando Dados - Parte 04 - Exercicios Enunciado
 
Dig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup CairoDig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup Cairo
 
Practical Object Oriented Models In Sql
Practical Object Oriented Models In SqlPractical Object Oriented Models In Sql
Practical Object Oriented Models In Sql
 
Xamarin: Introduction to iOS 8
Xamarin: Introduction to iOS 8Xamarin: Introduction to iOS 8
Xamarin: Introduction to iOS 8
 
Ajax nested form and ajax upload in rails
Ajax nested form and ajax upload in railsAjax nested form and ajax upload in rails
Ajax nested form and ajax upload in rails
 
UITableView Pain Points
UITableView Pain PointsUITableView Pain Points
UITableView Pain Points
 
What's Coming Next in Sencha Frameworks
What's Coming Next in Sencha FrameworksWhat's Coming Next in Sencha Frameworks
What's Coming Next in Sencha Frameworks
 
I regret nothing
I regret nothingI regret nothing
I regret nothing
 
Recent Changes to jQuery's Internals
Recent Changes to jQuery's InternalsRecent Changes to jQuery's Internals
Recent Changes to jQuery's Internals
 
Android development for iOS developers
Android development for iOS developersAndroid development for iOS developers
Android development for iOS developers
 

Destacado

Kozmetik ürünleri lojistiği, muhafaza ve taşıma özellikleri
Kozmetik ürünleri lojistiği, muhafaza ve taşıma özellikleriKozmetik ürünleri lojistiği, muhafaza ve taşıma özellikleri
Kozmetik ürünleri lojistiği, muhafaza ve taşıma özellikleriMurat Gülci
 
Proyecto Comenius
Proyecto ComeniusProyecto Comenius
Proyecto Comeniuspaco_lopez
 
Gençler Satın Almada Ne Kadar Etkili?
Gençler Satın Almada Ne Kadar Etkili?Gençler Satın Almada Ne Kadar Etkili?
Gençler Satın Almada Ne Kadar Etkili?AKAMPUS
 
Türkiye Değerler Araştırması 2012
Türkiye Değerler Araştırması 2012Türkiye Değerler Araştırması 2012
Türkiye Değerler Araştırması 2012Serhatcan Yurdam
 
Opswat Pazar Payı Raporu / Haziran 2011
Opswat Pazar Payı Raporu / Haziran 2011Opswat Pazar Payı Raporu / Haziran 2011
Opswat Pazar Payı Raporu / Haziran 2011MicrosoftTR
 
Kozmetik ürünlerde ürün güvenlik ve yenilikçi fikirler
Kozmetik ürünlerde ürün güvenlik ve yenilikçi fikirlerKozmetik ürünlerde ürün güvenlik ve yenilikçi fikirler
Kozmetik ürünlerde ürün güvenlik ve yenilikçi fikirlerNSI Cosmetics&Laboratories
 

Destacado (8)

The human body.
The human body.The human body.
The human body.
 
Kozmetik ürünleri lojistiği, muhafaza ve taşıma özellikleri
Kozmetik ürünleri lojistiği, muhafaza ve taşıma özellikleriKozmetik ürünleri lojistiği, muhafaza ve taşıma özellikleri
Kozmetik ürünleri lojistiği, muhafaza ve taşıma özellikleri
 
Proyecto Comenius
Proyecto ComeniusProyecto Comenius
Proyecto Comenius
 
Gençler Satın Almada Ne Kadar Etkili?
Gençler Satın Almada Ne Kadar Etkili?Gençler Satın Almada Ne Kadar Etkili?
Gençler Satın Almada Ne Kadar Etkili?
 
Türkiye Değerler Araştırması 2012
Türkiye Değerler Araştırması 2012Türkiye Değerler Araştırması 2012
Türkiye Değerler Araştırması 2012
 
Maskara üretimi
Maskara üretimiMaskara üretimi
Maskara üretimi
 
Opswat Pazar Payı Raporu / Haziran 2011
Opswat Pazar Payı Raporu / Haziran 2011Opswat Pazar Payı Raporu / Haziran 2011
Opswat Pazar Payı Raporu / Haziran 2011
 
Kozmetik ürünlerde ürün güvenlik ve yenilikçi fikirler
Kozmetik ürünlerde ürün güvenlik ve yenilikçi fikirlerKozmetik ürünlerde ürün güvenlik ve yenilikçi fikirler
Kozmetik ürünlerde ürün güvenlik ve yenilikçi fikirler
 

Similar a Oracle helpdesk database shema

CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403
CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403
CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403Min-hyung Kim
 
Open Source Search: An Analysis
Open Source Search: An AnalysisOpen Source Search: An Analysis
Open Source Search: An AnalysisJustin Finkelstein
 
An ADF Special Report
An ADF Special Report An ADF Special Report
An ADF Special Report Luc Bors
 
Sql server ___________session_18(stored procedures)
Sql server  ___________session_18(stored procedures)Sql server  ___________session_18(stored procedures)
Sql server ___________session_18(stored procedures)Ehtisham Ali
 
How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF Luc Bors
 
Introduction to SQL Antipatterns
Introduction to SQL AntipatternsIntroduction to SQL Antipatterns
Introduction to SQL AntipatternsKrishnakumar S
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11Michelangelo van Dam
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxMichelangelo van Dam
 
PyCon 2010 SQLAlchemy tutorial
PyCon 2010 SQLAlchemy tutorialPyCon 2010 SQLAlchemy tutorial
PyCon 2010 SQLAlchemy tutorialjbellis
 
The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189Mahmoud Samir Fayed
 
Pruebas unitarias con django
Pruebas unitarias con djangoPruebas unitarias con django
Pruebas unitarias con djangoTomás Henríquez
 
Roman iovlev. Test UI with JDI - Selenium camp
Roman iovlev. Test UI with JDI - Selenium campRoman iovlev. Test UI with JDI - Selenium camp
Roman iovlev. Test UI with JDI - Selenium campРоман Иовлев
 
Gail villanueva add muscle to your wordpress site
Gail villanueva   add muscle to your wordpress siteGail villanueva   add muscle to your wordpress site
Gail villanueva add muscle to your wordpress sitereferences
 
Local storage in Web apps
Local storage in Web appsLocal storage in Web apps
Local storage in Web appsIvano Malavolta
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile appsIvano Malavolta
 
How to test complex SaaS applications - The family july 2014
How to test complex SaaS applications - The family july 2014How to test complex SaaS applications - The family july 2014
How to test complex SaaS applications - The family july 2014Guillaume POTIER
 

Similar a Oracle helpdesk database shema (20)

Database
DatabaseDatabase
Database
 
CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403
CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403
CDM SynPuf OMOP CDM library(rodbc) library(ggplot2) library(jsonlite) 180403
 
Open Source Search: An Analysis
Open Source Search: An AnalysisOpen Source Search: An Analysis
Open Source Search: An Analysis
 
Reporting solutions for ADF Applications
Reporting solutions for ADF ApplicationsReporting solutions for ADF Applications
Reporting solutions for ADF Applications
 
Apache Cassandra and Go
Apache Cassandra and GoApache Cassandra and Go
Apache Cassandra and Go
 
An ADF Special Report
An ADF Special Report An ADF Special Report
An ADF Special Report
 
Sql server ___________session_18(stored procedures)
Sql server  ___________session_18(stored procedures)Sql server  ___________session_18(stored procedures)
Sql server ___________session_18(stored procedures)
 
How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF
 
Introduction to SQL Antipatterns
Introduction to SQL AntipatternsIntroduction to SQL Antipatterns
Introduction to SQL Antipatterns
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11
 
How te bring common UI patterns to ADF
How te bring common UI patterns to ADFHow te bring common UI patterns to ADF
How te bring common UI patterns to ADF
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
 
PyCon 2010 SQLAlchemy tutorial
PyCon 2010 SQLAlchemy tutorialPyCon 2010 SQLAlchemy tutorial
PyCon 2010 SQLAlchemy tutorial
 
The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189
 
Pruebas unitarias con django
Pruebas unitarias con djangoPruebas unitarias con django
Pruebas unitarias con django
 
Roman iovlev. Test UI with JDI - Selenium camp
Roman iovlev. Test UI with JDI - Selenium campRoman iovlev. Test UI with JDI - Selenium camp
Roman iovlev. Test UI with JDI - Selenium camp
 
Gail villanueva add muscle to your wordpress site
Gail villanueva   add muscle to your wordpress siteGail villanueva   add muscle to your wordpress site
Gail villanueva add muscle to your wordpress site
 
Local storage in Web apps
Local storage in Web appsLocal storage in Web apps
Local storage in Web apps
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile apps
 
How to test complex SaaS applications - The family july 2014
How to test complex SaaS applications - The family july 2014How to test complex SaaS applications - The family july 2014
How to test complex SaaS applications - The family july 2014
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Último (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Oracle helpdesk database shema

  • 1. Veri Modelleme ve Iliskisel Veritabanlari Dersi Proje Dökümanı Murat Gülci Bu projede bir Helpdesk database’i tasarlandı ve oluşturuldu. Kullanıcıların takibi, problemlerin ve problemin geçmişinin takibi, envanter takibi ve Bilgi işlem çalışanlarının yeteneklerinin takibi yapılabilmesi sağlandı.Hazırlanan bütün sorgular, karşılaşılabilinecek gerçek senaryolar düşünülerek hazırlandı. Bahceşehir Üniversitesi BEŞİKTAŞ ALPER TUNGA Veritabanı ve İlişkisel Veritabanları YZM5507
  • 2. 1. Database E-R şeması
  • 3. 2. Database oluşturma Query Result CREATE TABLE "REF_EQUIPMENT_TYPES" ( "EQUIPMENT_TYPE_CODE" NUMBER(5,0), "EQUIPMENT_TYPE_DESCRIPTION" VARCHAR2(50), PRIMARY KEY ("EQUIPMENT_TYPE_CODE") ENABLE ) ; Query Result CREATE TABLE "REF_SKILL_CODES" ( "SKILL_CODE" NUMBER(5,0), "SKILL_DESCRIPTION" VARCHAR2(50), PRIMARY KEY ("SKILL_CODE") ENABLE ) ; Query Result CREATE TABLE "STAFF_SKILLS" ( "STAFF_ID" NUMBER(5,0), "SKILL_CODE" NUMBER(5,0), "DATE_SKILL_OBTAINED" DATE, PRIMARY KEY ("STAFF_ID") ENABLE ) ; Query Result CREATE TABLE "EQUIPMENT" ( "EQUIPMENT_ID" NUMBER, "EQUIPMENT_TYPE_CODE" NUMBER, "DATA_EQUIPMENT_ACQUIRED" DATE, "DATE_EQUIPMENT_DISPOSED" DATE, "EQUIPMENT_CODE" NUMBER(10,0), "EQUIPMENT_NAME" CHAR(20), "EQUIPMENT_DESCRIPTION" VARCHAR2(50), "MANUFACTURER_NAME" CHAR(20), CONSTRAINT "EQUIPMENT_PK" PRIMARY KEY ("EQUIPMENT_ID") ENABLE )
  • 4. Query Result CREATE TABLE "SUPPORT_STAFF" ( "STAFF_ID" NUMBER(5,0), "DATE_JOINED" DATE, "DATE_LEFT" DATE, "STAFF_NAME" CHAR(40), "STAFF_PHONE" NUMBER(10,0), "STAFF_EMAIL" CHAR(50), "STAFF_LOCATION" CHAR(10), PRIMARY KEY ("STAFF_ID") ENABLE ) ; Query Result CREATE TABLE "REF_USER_TYPES" ( "USER_TYPE_CODE" NUMBER(10,0), "USER_TYPE_DESCRIPTION" VARCHAR2(50), PRIMARY KEY ("USER_TYPE_CODE") ENABLE ) ; Query Result CREATE TABLE "REF_PRIORITY_LEVELS" ( "PROBLEM_LEVEL_CODE" NUMBER(3,0), "PRIORITY_LEVEL_DESCRIPTION" VARCHAR2(10), PRIMARY KEY ("PROBLEM_LEVEL_CODE") ENABLE ) ; Query Result CREATE TABLE "REF_PROBLEM_STATUS_CODE" ( "PROBLEM_STATUS_CODE" NUMBER(3,0), "PROBLEM_STATUS_DESCRIPTION" VARCHAR2(10), PRIMARY KEY ("PROBLEM_STATUS_CODE") ENABLE ) ; Query Result CREATE TABLE "USERS" ( "USER_ID" NUMBER(5,0), "USER_TYPE_CODE" NUMBER(10,0), "USER_FIRST_NAME" CHAR(20), "USER_LAST_NAME" CHAR(20), "USER_PHONE" NUMBER(10,0), "USER_EMAIL" CHAR(50), "ADDRESS" VARCHAR2(100), CONSTRAINT "USERS_PK" PRIMARY KEY ("USER_ID") ENABLE ); Query Result
  • 5. CREATE TABLE "PROBLEMS" ( "PROBLEM_ID" NUMBER(10,0) NOT NULL ENABLE, "EQUIPMENT_ID" NUMBER(10,0) NOT NULL ENABLE, "USER_ID" NUMBER(5,0) NOT NULL ENABLE, "PROBLEM_REPORTED_DATETIME" DATE NOT NULL ENABLE, "PROBLEM_DESCRIPTION" VARCHAR2(500) NOT NULL ENABLE, CONSTRAINT "PROBLEMS_PK" PRIMARY KEY ("PROBLEM_ID") ENABLE ); Query Result CREATE TABLE "PROBLEM_HISTORY" ( "PROBLEM_HISTORY_ID" NUMBER(10,0) NOT NULL ENABLE, "PRIORITY_LEVEL_CODE" NUMBER(3,0) NOT NULL ENABLE, "PROBLEM_ID" NUMBER(10,0) NOT NULL ENABLE, "PROBLEM_STATUS_CODE" NUMBER(3,0) NOT NULL ENABLE, "ASSIGNED_STAFF_ID" NUMBER(5,0) NOT NULL ENABLE, "FIX_DATETIME" DATE NOT NULL ENABLE, "PROBLEM_HISTORY_DESCRIPTION" VARCHAR2(500) NOT NULL ENABLE, CONSTRAINT "PROBLEM_HISTORY_PK" PRIMARY KEY ("PROBLEM_HISTORY_ID") ENABLE ); Query Result CREATE TABLE "RESOLUTIONS" ( "RESOLUTION_ID" NUMBER(10,0) NOT NULL ENABLE, "PROBLEM_HISTORY_ID" NUMBER(10,0), "RESOLUTION_DESCRIPTION" VARCHAR2(500), CONSTRAINT "RESOLUTIONS_PK" PRIMARY KEY ("RESOLUTION_ID") ENABLE ) ;
  • 6. 3. Table’lara kısıt ekleme Query Result ALTER TABLE "STAFF_SKILLS" ADD CONSTRAINT "STAFF_SKILLS_CON" FOREIGN KEY ("SKILL_CODE") REFERENCES "REF_SKILL_CODES" ("SKILL_CODE") ENABLE; Query Result ALTER TABLE "EQUIPMENT" ADD CONSTRAINT "EQUIPMENT_CON" FOREIGN KEY ("EQUIPMENT_TYPE_CODE") REFERENCES "REF_EQUIPMENT_TYPES" ("EQUIPMENT_TYPE_CODE") ENABLE; Query Result ALTER TABLE "PROBLEMS" ADD CONSTRAINT "PROBLEMS_CON" FOREIGN KEY ("USER_ID") REFERENCES "USERS" ("USER_ID") ENABLE;ALTER TABLE "PROBLEMS" ADD CONSTRAINT "PROBLEMS_FK" FOREIGN KEY ("EQUIPMENT_ID") REFERENCES "EQUIPMENT" ("EQUIPMENT_ID") ENABLE; Query Result ALTER TABLE "PROBLEM_HISTORY" ADD CONSTRAINT "PROBLEM_HISTORY_FK" FOREIGN KEY ("PRIORITY_LEVEL_CODE") REFERENCES "REF_PRIORITY_LEVELS" ("PROBLEM_LEVEL_CODE") ENABLE;ALTER TABLE "PROBLEM_HISTORY" ADD CONSTRAINT "PROBLEM_HISTORY_FK2" FOREIGN KEY ("PROBLEM_ID") REFERENCES "PROBLEMS" ("PROBLEM_ID") ENABLE;ALTER TABLE "PROBLEM_HISTORY" ADD CONSTRAINT "PROBLEM_HISTORY_FK3" FOREIGN KEY ("PROBLEM_STATUS_CODE") REFERENCES "REF_PROBLEM_STATUS_CODE" ("PROBLEM_STATUS_CODE") ENABLE;ALTER TABLE "PROBLEM_HISTORY" ADD CONSTRAINT "PROBLEM_HISTORY_FK4" FOREIGN KEY ("ASSIGNED_STAFF_ID") REFERENCES "SUPPORT_STAFF" ("STAFF_ID") ENABLE;
  • 7. Query Result ALTER TABLE "RESOLUTIONS" ADD CONSTRAINT "RESOLUTIONS_FK" FOREIGN KEY ("PROBLEM_HISTORY_ID") REFERENCES "PROBLEM_HISTORY" ("PROBLEM_HISTORY_ID") ENABLE; Query Result ALTER TABLE "USERS" ADD CONSTRAINT "USERS_FK" FOREIGN KEY ("USER_TYPE_CODE") REFERENCES "REF_USER_TYPES" ("USER_TYPE_CODE") ENABLE;
  • 8. 4. Select Sorgular a. En Sorunlu ürünler Query Select REF_EQUIPMENT_TYPES.EQUIPMENT_TYPE_DESCRIPTION, EQUIPMENT.EQUIPMENT_TYPE_CODE, EQUIPMENT.EQUIPMENT_NAME, EQUIPMENT.EQUIPMENT_DESCRIPTION, PROBLEMS.EQUIPMENT_ID As EQUIPMENT_ID1, Count(PROBLEMS.EQUIPMENT_ID) as "Problem Sayısı" From EQUIPMENT Inner Join REF_EQUIPMENT_TYPES On EQUIPMENT.EQUIPMENT_TYPE_CODE = REF_EQUIPMENT_TYPES.EQUIPMENT_TYPE_CODE Inner Join PROBLEMS On PROBLEMS.EQUIPMENT_ID = EQUIPMENT.EQUIPMENT_ID Where PROBLEMS.EQUIPMENT_ID = EQUIPMENT.EQUIPMENT_ID Group By REF_EQUIPMENT_TYPES.EQUIPMENT_TYPE_DESCRIPTION, EQUIPMENT.EQUIPMENT_TYPE_CODE, EQUIPMENT.EQUIPMENT_NAME, EQUIPMENT.EQUIPMENT_DESCRIPTION, PROBLEMS.EQUIPMENT_ID Order By Count(PROBLEMS.EQUIPMENT_ID) Desc Query 2: select EQUIPMENT_ID, count(EQUIPMENT_ID) from problems group by EQUIPMENT_ID having count(EQUIPMENT_ID)>1 order by count(EQUIPMENT_ID) desc Result Result 2
  • 9. b. En çok sorun çözen IT elemanları Query Select SUPPORT_STAFF.STAFF_ID, SUPPORT_STAFF.STAFF_NAME, SUPPORT_STAFF.STAFF_EMAIL, REF_SKILL_CODES.SKILL_DESCRIPTION, Count(PROBLEM_HISTORY.ASSIGNED_STAFF_ID) as "Sorun Sayısı" From PROBLEM_HISTORY Inner Join SUPPORT_STAFF On PROBLEM_HISTORY.ASSIGNED_STAFF_ID = SUPPORT_STAFF.STAFF_ID Inner Join STAFF_SKILLS On STAFF_SKILLS.STAFF_ID = SUPPORT_STAFF.STAFF_ID Inner Join REF_SKILL_CODES On STAFF_SKILLS.SKILL_CODE = REF_SKILL_CODES.SKILL_CODE Group By SUPPORT_STAFF.STAFF_ID, SUPPORT_STAFF.STAFF_NAME, SUPPORT_STAFF.STAFF_EMAIL, REF_SKILL_CODES.SKILL_DESCRIPTION Order By Count(PROBLEM_HISTORY.ASSIGNED_STAFF_ID) Desc Result c. En sorunlu Kullanıcılar Query Select USERS.USER_ID, USERS.USER_FIRST_NAME, USERS.USER_LAST_NAME, USERS.USER_EMAIL, REF_USER_TYPES.USER_TYPE_DESCRIPTION, Count(PROBLEMS.USER_ID) As Problem_Count From PROBLEMS Inner Join USERS On PROBLEMS.USER_ID = USERS.USER_ID Inner Join REF_USER_TYPES On USERS.USER_TYPE_CODE = REF_USER_TYPES.USER_TYPE_CODE Group By USERS.USER_ID, USERS.USER_FIRST_NAME, USERS.USER_LAST_NAME, USERS.USER_EMAIL, REF_USER_TYPES.USER_TYPE_DESCRIPTION Order By Count(PROBLEMS.USER_ID) Desc Result
  • 10. d. Açık Çağrılar Listesi Query Select PROBLEM_HISTORY.PROBLEM_HISTORY_ID, REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION, SUPPORT_STAFF.STAFF_NAME, PROBLEMS.PROBLEM_DESCRIPTION, PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION, REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_DESCRIPTION From PROBLEM_HISTORY Inner Join REF_PROBLEM_STATUS_CODE On PROBLEM_HISTORY.PROBLEM_STATUS_CODE = REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_CODE Inner Join SUPPORT_STAFF On PROBLEM_HISTORY.ASSIGNED_STAFF_ID = SUPPORT_STAFF.STAFF_ID Inner Join REF_PRIORITY_LEVELS On PROBLEM_HISTORY.PRIORITY_LEVEL_CODE = REF_PRIORITY_LEVELS.PROBLEM_LEVEL_CODE Inner Join PROBLEMS On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Where PROBLEM_HISTORY.PROBLEM_STATUS_CODE = 803 Result e. SLA süresinde çözülmeyen işler Query Select PROBLEMS.PROBLEM_ID, PROBLEMS.PROBLEM_REPORTED_DATETIME, PROBLEM_HISTORY.FIX_DATETIME, USERS.USER_FIRST_NAME, USERS.USER_LAST_NAME, PROBLEMS.PROBLEM_DESCRIPTION, REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION From PROBLEMS Inner Join PROBLEM_HISTORY On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join REF_PRIORITY_LEVELS On PROBLEM_HISTORY.PRIORITY_LEVEL_CODE = REF_PRIORITY_LEVELS.PROBLEM_LEVEL_CODE Inner Join USERS On PROBLEMS.USER_ID = USERS.USER_ID Where PROBLEM_HISTORY.FIX_DATETIME > PROBLEMS.PROBLEM_REPORTED_DATETIME Result
  • 11. f. 40000000007 no’lu problemin geçmiş detayı Query Select PROBLEMS.PROBLEM_ID, PROBLEMS.PROBLEM_DESCRIPTION, REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION, REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_DESCRIPTION, PROBLEM_HISTORY.FIX_DATETIME, SUPPORT_STAFF.STAFF_NAME, PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION From PROBLEMS Inner Join PROBLEM_HISTORY On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join REF_PROBLEM_STATUS_CODE On PROBLEM_HISTORY.PROBLEM_STATUS_CODE = REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_CODE Inner Join REF_PRIORITY_LEVELS On PROBLEM_HISTORY.PRIORITY_LEVEL_CODE = REF_PRIORITY_LEVELS.PROBLEM_LEVEL_CODE Inner Join SUPPORT_STAFF On PROBLEM_HISTORY.ASSIGNED_STAFF_ID = SUPPORT_STAFF.STAFF_ID Where PROBLEMS.PROBLEM_ID = 4000000007 Result g. Ahmet Kullanıcısının Çağrılarının detayları Query Select USERS.USER_FIRST_NAME, USERS.USER_LAST_NAME, PROBLEMS.PROBLEM_DESCRIPTION, PROBLEM_HISTORY.FIX_DATETIME, PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION, REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION From USERS Inner Join PROBLEMS On PROBLEMS.USER_ID = USERS.USER_ID Inner Join PROBLEM_HISTORY On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join REF_PRIORITY_LEVELS On PROBLEM_HISTORY.PRIORITY_LEVEL_CODE = REF_PRIORITY_LEVELS.PROBLEM_LEVEL_CODE Where USERS.USER_FIRST_NAME = 'Ahmet' Query_2 select PROBLEM_ID, PROBLEM_DESCRIPTION from problems p, users u where p.user_id = u.user_id and u.user_first_name like 'Ahme%' Result Result2
  • 12. h. Geçen Seneki çağrıların toplamı Query Select Count(Distinct PROBLEM_HISTORY.PROBLEM_ID) as "2011 Çağrı Adedi" From PROBLEMS Inner Join PROBLEM_HISTORY On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Where Extract(Year From PROBLEM_HISTORY.FIX_DATETIME) = 2011 Result i. Atanmamış çağrılar Query Select EQUIPMENT.EQUIPMENT_NAME, USERS.USER_FIRST_NAME, USERS.USER_LAST_NAME, PROBLEMS.PROBLEM_REPORTED_DATETIME, PROBLEMS.PROBLEM_DESCRIPTION From PROBLEMS Inner Join EQUIPMENT On PROBLEMS.EQUIPMENT_ID = EQUIPMENT.EQUIPMENT_ID Inner Join USERS On PROBLEMS.USER_ID = USERS.USER_ID Where PROBLEMS.PROBLEM_ID Not In (Select Distinct (PROBLEM_HISTORY.PROBLEM_ID) From PROBLEM_HISTORY) Result
  • 13. j. Kapatılan Çağrılar Query Select PROBLEMS.PROBLEM_ID, USERS.USER_FIRST_NAME, USERS.USER_LAST_NAME, EQUIPMENT.EQUIPMENT_NAME, REF_EQUIPMENT_TYPES.EQUIPMENT_TYPE_DESCRIPTION, PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION From PROBLEMS Inner Join PROBLEM_HISTORY On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join USERS On PROBLEMS.USER_ID = USERS.USER_ID Inner Join EQUIPMENT On PROBLEMS.EQUIPMENT_ID = EQUIPMENT.EQUIPMENT_ID Inner Join REF_EQUIPMENT_TYPES On EQUIPMENT.EQUIPMENT_TYPE_CODE = REF_EQUIPMENT_TYPES.EQUIPMENT_TYPE_CODE Where PROBLEM_HISTORY.PROBLEM_STATUS_CODE = 804 Result k. Zor seviyesindeki çağrıların detay durumu Query Select PROBLEMS.PROBLEM_ID, USERS.USER_FIRST_NAME, USERS.USER_LAST_NAME, PROBLEMS.PROBLEM_DESCRIPTION, PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION, SUPPORT_STAFF.STAFF_NAME From PROBLEM_HISTORY Inner Join PROBLEMS On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join USERS On PROBLEMS.USER_ID = USERS.USER_ID Inner Join SUPPORT_STAFF On PROBLEM_HISTORY.ASSIGNED_STAFF_ID = SUPPORT_STAFF.STAFF_ID Where PROBLEM_HISTORY.PRIORITY_LEVEL_CODE = 703 Result
  • 14. l. Problem çözümü girilmiş problemlerin listesi Query Select Distinct PROBLEM_HISTORY.PROBLEM_ID From PROBLEM_HISTORY Order By PROBLEM_HISTORY.PROBLEM_ID Result
  • 15. 5. Update sorguları a. Açık çağrıların kapatılması Query update problem_history set problem_status_code = (select problem_status_code from ref_problem_status_code where problem_status_description='kapandı') where problem_status_code in (select p.problem_status_code from problem_history p, ref_problem_status_code s where problem_status_description='açık' and s.problem_status_code=p.problem_status_code) Result
  • 16. b. Çözüm girilen çağrıların kapatılması Query update problem_history set problem_status_code = (select problem_status_code from ref_problem_status_code where problem_status_description='kapandı') where problem_status_code in (select h.problem_status_code from problem_history h, resolutions r where r.problem_history_id=h.problem_history_id) Result c. Support Elemanına skill ekleme ve tarihi güncelleme Query INSERT INTO ref_skill_codes VALUES (3006,'Senior Programmer'); update staff_skills set (skill_code, date_skill_obtained) = (select skill_code, to_date(sysdate, 'dd/mm/yyyy' ) from ref_skill_codes where skill_description='Senior Programmer' ) where skill_code = (select st.skill_code from staff_skills st, support_staff su where st.staff_id=su.staff_id and su.staff_name='Murat'); Result
  • 17. d. User’ın type’ı değişmesi(müdür olması) Query INSERT INTO ref_user_types VALUES (6000000006,'Muhasebe Müdürü') update users set USER_TYPE_CODE = ( select user_type_code from ref_user_types where USER_TYPE_DESCRIPTION = 'Muhasebe Müdürü') where USER_TYPE_CODE = (select USER_TYPE_CODE from users where user_id='30003' and user_first_name='Eyüp') Result 1 row(s) updated. 0.00 seconds select u.user_first_name, ru.USER_TYPE_DESCRIPTION from users u, ref_user_types ru where u.user_id='30003' and u.user_type_code=ru.user_type_code; e. Prblem açıklaması değiştirilmesi Query update problems set PROBLEM_DESCRIPTION = 'Yazıcıya yazdırırken yazdırılamadı şeklinde hata veriyor. dün çalışıyordu,sorun yoktu' where problem_id = '4000000001' Result 1 row(s) updated. 0.02 seconds select problem_id, PROBLEM_DESCRIPTION from problems where problem_id='4000000001'
  • 18. f. equipment_code(seri no) değiştirilmesi Query update EQUIPMENT set EQUIPMENT_CODE = '2000000006' where EQUIPMENT_CODE = '2000000005' and EQUIPMENT_ID = '1000000005' Result 1 row(s) updated. 0.03 seconds select EQUIPMENT_ID, EQUIPMENT_CODE from EQUIPMENT where EQUIPMENT_ID = '1000000005' g. Support elemanlarına yeni sorun atanması Query select p.problem_id from problems p where p.problem_id not in (select problem_id from problem_history) INSERT INTO problem_history VALUES (5000000011,701, (select p.problem_id from problems p where p.problem_id not in (select problem_id from problem_history)), 802,1002, TO_DATE ('06/06/2011', 'dd/mm/yyyy'),'xc') Result 1 row(s) inserted. 0.06 seconds select p.problem_id from problems p where p.problem_id not in (select problem_id from problem_history) no data found
  • 19. h. equipment silinmesi Query ALTER TABLE "PROBLEMS" disable CONSTRAINT "PROBLEMS_FK" Table altered. 0.03 seconds delete from equipment where EQUIPMENT_ID='1000000002' Result 1 row(s) deleted. 0.01 seconds i. user silinmesi Query ALTER TABLE "PROBLEMS" disable CONSTRAINT "PROBLEMS_CON" Table altered. 0.08 seconds delete from users where user_first_name='Ayşe' and user_last_name='Cebeci' and user_id='30005' Result 1 row(s) deleted. 0.01 seconds j. Problem History Kaydı silinmesi Query delete from problem_history where PROBLEM_HISTORY_ID= '5000000006' Result 1 row(s) deleted. 0.01 seconds
  • 20. k. Support Stuff silinmesi Query delete from support_staff where staff_id='1001' and staff_name = 'Mustafa' Result 1 row(s) deleted. 0.01 seconds l. Sorun İstatistikleri Query select min(count(p.ASSIGNED_STAFF_ID)) as "En az Sorunla İlgilenen", max(count(p.ASSIGNED_STAFF_ID)) as "En Fazla Sorunla İlgilenen", round(avg(count(p.ASSIGNED_STAFF_ID)),1) as "Ortama Sorunla İlgilenen" from problem_history p group by p.ASSIGNED_STAFF_ID Result
  • 21. m. Case kullanmak Query select problem_history_id, PROBLEM_HISTORY_DESCRIPTION, case when ASSIGNED_STAFF_ID= '1001' then 'Mustafa ilgileniyor' when ASSIGNED_STAFF_ID= '1002' then 'Dinçer ilgileniyor' when ASSIGNED_STAFF_ID= '1003' then 'Şükrü ilgileniyor' else 'Başkası ilgileniyor' end as Kim_ilgileniyor from problem_history Result
  • 22. 6. Extra Sorgular a. Genel Bakış view oluşturma Query CREATE OR REPLACE VIEW genel_bakis AS Select PROBLEM_HISTORY.PROBLEM_ID, PROBLEM_HISTORY.PROBLEM_HISTORY_ID, REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION, REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_DESCRIPTION, SUPPORT_STAFF.STAFF_NAME, PROBLEM_HISTORY.FIX_DATETIME, PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION, EQUIPMENT.EQUIPMENT_NAME, USERS.USER_FIRST_NAME || ' ' || USERS.USER_LAST_NAME as Kullanıcı From PROBLEM_HISTORY Inner Join REF_PROBLEM_STATUS_CODE On PROBLEM_HISTORY.PROBLEM_STATUS_CODE = REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_CODE Inner Join REF_PRIORITY_LEVELS On PROBLEM_HISTORY.PRIORITY_LEVEL_CODE = REF_PRIORITY_LEVELS.PROBLEM_LEVEL_CODE Inner Join SUPPORT_STAFF On PROBLEM_HISTORY.ASSIGNED_STAFF_ID = SUPPORT_STAFF.STAFF_ID Inner Join PROBLEMS On PROBLEM_HISTORY.PROBLEM_ID = PROBLEMS.PROBLEM_ID Inner Join EQUIPMENT On PROBLEMS.EQUIPMENT_ID = EQUIPMENT.EQUIPMENT_ID Inner Join USERS On PROBLEMS.USER_ID = USERS.USER_ID Group By PROBLEM_HISTORY.PROBLEM_ID, PROBLEM_HISTORY.PROBLEM_HISTORY_ID, REF_PRIORITY_LEVELS.PRIORITY_LEVEL_DESCRIPTION, REF_PROBLEM_STATUS_CODE.PROBLEM_STATUS_DESCRIPTION, SUPPORT_STAFF.STAFF_NAME, PROBLEM_HISTORY.FIX_DATETIME, PROBLEM_HISTORY.PROBLEM_HISTORY_DESCRIPTION, EQUIPMENT.EQUIPMENT_NAME, USERS.USER_FIRST_NAME, USERS.USER_LAST_NAME Order By PROBLEM_HISTORY.PROBLEM_ID Result
  • 23. b. Index Oluşturma Query CREATE INDEX problem__id_index ON problem_history(problem_id); Result Index created. c. Sequence Oluşturma Query CREATE SEQUENCE EQUIPMENT_ID INCREMENT BY 1 Result Sequence created. d. Select ile yedek almak Query select * into problems_backup from problems Result 7. Sonuçlar Görev Beklenen Yapılan table oluşturma 6-7 tablo 13 tablo Select sorgusu 10 12 Update/delete sorgusu 10 10 İndex oluşturma 0 1 View oluşturma 0 1 Sequence oluşturma 0 1