Anda di halaman 1dari 31

SISTEM BASIS DATA

Terjemahan ORACLE FINAL EXAM

YULFIQI PUTRI PRANATA


G41140025 / A

Politeknik Negeri Jember


Jalan Mastrip PO BOX 164 jember 68101 Telp. (0331) 333532
Website: www.polije.ac.id Email: politeknik@polije.ac.id
Tahun 2015-2016
Bab 11
(Menjawab semua pertanyaan dalam bagian ini)

1. Dalam sebuah model konseptual, banyak-ke-banyak hubungan


yang diselesaikan melalui struktur yang disebut/sebuah:
________________

Tandai untuk
Meninjau
(1) Poin

Supertype
Tabel Persimpangan
Entiti persimpangan (*)
Subtipe

Benar
2. Untuk mengatasi banyak untuk hubungan banyak dalam model
fisik anda membuat/sebuah ___________________?

Tandai untuk
Meninjau
(1) Poin

Batasan kunci unik


Entiti Persimpangan
Tabel persimpangan (*)
Dua meja dengan batasan kunci asing antara mereka

Benar
3. Transformasi dari sebuah diagram ER ke desain fisik melibatkan
terminologi berubah. Pengenal unik sekunder menjadi

Tandai untuk
Meninjau
(1) Poin

Kolom
Tabel
Keterbatasan unik (*)
Batasan kunci primer

Benar
4. Dalam tabel menjadi sifat database. Benar atau Salah?
Tandai untuk
Meninjau
(1) Poin
Benar
Salah (*)

Benar
5. Dalam sebuah Oracle Database, mengapa 1_tabel tidak bekerja
sebagai nama tabel?

Tandai untuk
Meninjau
(1) Poin

Database tidak memahami semua huruf besar.


Tidak ada masalah di sini. Anda dapat membuat tabel yang
disebut 1_tabel.
Nama-nama objek tidak harus mulai dengan sebuah nomor.
Mereka harus diawali dengan sebuah huruf. (*)
Tabel adalah perkataan yang dicadangkan.

Benar
6. Sebuah "Arc Pelaksanaan" dapat dilakukan seperti hubungan lain
- anda hanya perlu menambahkan kunci asing yang diperlukan.
Benar atau Salah?

Tandai untuk
Meninjau
(1) Poin

Benar
Salah (*)

Benar
7. Penjelasan di bawah ini adalah peraturan integritas Buatan
Pengguna dan harus, oleh karena itu, akan diberi kode secara
manual, Database tidak dapat menegakkan peraturan ini secara
otomatis. Benar atau Salah?
Kunci primer harus unik, dan tidak ada bagian kunci primer dapat
null.

Tandai untuk
Meninjau
(1) Poin

Benar
Salah (*)

Salah. Lihat Bab 11 Pelajaran 1.


8. Tabel yang harus mempunyai sedikitnya satu pasangan kunci,
seperti halnya dengan kunci primer. Benar atau Salah?

Tandai untuk
Meninjau
(1) Poin

Benar
Salah (*)

Benar
9. Jika sebuah kunci primer adalah satu set kolom, kemudian satu
kolom harus null. Benar atau Salah?

Tandai untuk

Meninjau
(1) Poin
Benar
Salah (*)

Benar
10. Integritas entitas merujuk ke:
Tandai untuk
Meninjau
(1) Poin
Tabel selalu berisi data teks
Tabel selalu berisi data angka
Kolom yang mempunyai kunci primer, Kunci Asing, kunci
unik, dan keterbatasan Cek didefinisikan dalam database.
Tabel mempunyai kunci primer, Kunci Asing, kunci unik, dan
keterbatasan Cek didefinisikan dalam database. (*)
Benar
Ection 11
(Menjawab semua pertanyaan dalam bagian ini)
11. Teks di bawah ini adalah contoh jenis kendala apa?
Jika jumlah buku-buku yang dipinjamkan untuk sebuah negara
peminjam di perpustakaan melebihi 5, maka kita harus mengirim
dia surat meminta kembali dari buku-buku; hal ini akan
memerlukan pemrograman ekstra untuk menegakkan.

Tandai untuk
Meninjau
(1) Poin

Integritas entitas
Integritas yang ditentukan oleh pengguna (*)
Integritas Kolom
Integritas Referensial

Salah. Lihat Bab 11 Pelajaran 1.

Seksi 12
(Menjawab semua pertanyaan dalam bagian ini)
12. Dokumentasi Sistem ini dikembangkan ke kanan pada akhir sekali
sistem telah hidup dan pengguna telah menggunakannya untuk
sedikit sementara. Anda akan lebih untuk mendapatkan ia betul
bahawa jalan. Benar atau Salah?
Benar

Tandai untuk
Meninjau
(1) Poin

Salah (*)

Benar.
13. Dalam tahapan analisis, tabel-tabel ini dibuat dan diisi dengan
data tes. Benar atau Salah?

Tandai untuk
Meninjau
(1) Poin

Benar
Salah (*)

Benar.
14. Setelah anda telah membuat meja, tidak mungkin untuk
mengubah definisi ini. Jika anda perlu menambahkan kolom baru
anda harus menghapus definisi tabel dan membuat yang baru,
tabel yang benar. Benar atau Salah?

Tandai untuk
Meninjau
(1) Poin

Benar
Salah (*)

Benar.
15. Pernyataan SQL mengubah karyawan tabel menghapus gaji kolom
adalah pernyataan yang sah. Benar atau Salah?

Tandai untuk
Meninjau
(1) Poin

Benar
Salah (*)

Benar.
16. Perintah apa yang dapat digunakan untuk membuat sebuah baris
baru di dalam tabel dalam database?

Membuat
NEW
Tambah
Masukkan (*)

Benar.

Tandai untuk
Meninjau
(1) Poin

17. _______ FROM clause dapat ditambahkan ke sebuah pernyataan


pilih untuk kembali subset data.

Tandai untuk
Meninjau
(1) Poin

Di MANA SAJA
Yang
Di MANA (*)
Setiap

Benar.
18. Perintah yang menerangkan kembali semua baris dari meja.
Benar atau Salah?

Tandai untuk
Meninjau
(1) Poin

Benar
Salah (*)

Benar.

Seksi 15
(Menjawab semua pertanyaan dalam bagian ini)
19. Di mana FROM clause dari sebuah pilih pernyataan ini Anda
menetapkan nama tabel atau tabel-tabel yang mempersoalkan?

Tandai untuk
Meninjau
(1) Poin

Dari FROM clause (*)


Klausa SELECT
Di mana FROM clause
Salah satu opsi-opsi tersebut di atas, Anda dapat
menyebutkan tabel di mana saja dalam sebuah pernyataan
pilih.
Benar.
20. Mengevaluasi SELECT ini:
Pilih (gaji * meningkatkan_%) meningkatkan
Dari karyawan;
Jika meningkatkan_% hanya berisi kolom nilai-nilai null, apa yang
akan pernyataan kembali?

Tandai untuk
Meninjau
(1) Poin

Hanya angka nol


Hanya nilai-nilai null (*)
Nilai null atau nol tergantung pada nilai kolom gaji
Nilai null atau sebuah nilai numerik tergantung pada nilai
kolom gaji
Salah. Lihat bagian 15 Pelajaran 1.

Seksi 15
(Menjawab semua pertanyaan dalam bagian ini)
21. Dalam sebuah pernyataan SQL, yang menetapkan satu atau lebih
klausa kolom yang akan dikembalikan oleh query?

Tandai untuk
Meninjau
(1) Poin

Pilih (*)
Dari
Di MANA
Salah satu opsi-opsi tersebut di atas, anda dapat kolom
daftar di mana pun anda ingin dalam sebuah pernyataan
pilih.
Salah. Lihat bagian 15 Pelajaran 1.
22. Dalam sebuah pilih FROM clause, apa yang merupakan hasil dari
2 + 3 * 2?

Tandai untuk
Meninjau
(1) Poin

6
8 (*)
10
13

Benar.
23. Anda query database dengan pernyataan SQL ini:
Pilih * dari mahasiswa;
Mengapa anda menggunakan pernyataan ini?

Untuk memasukkan data


Untuk melihat data (*)
Untuk menampilkan struktur tabel

Tandai untuk
Meninjau
(1) Poin

Untuk menghapus data

Benar.
24. Statemen SELECT mengambil informasi dari database. Dalam
sebuah pernyataan pilih, Anda dapat melakukan semua yang
berikut ini selain:

Tandai untuk
Meninjau
(1) Poin

Tonjolan
Manipulasi (*)
Bergabung
Pilihan

Benar.

16 Bagian
(Menjawab semua pertanyaan dalam bagian ini)
25. Tabel karyawan yang berisi kolom ini:
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
VARCHAR EMAIL2(50)

Tandai untuk
Meninjau
(1) Poin

Anda menulis, pilih untuk mengambil nama-pernyataan karyawan


yang memiliki sebuah alamat email.
Pilih nama_terakhir||', '||first_name "Nama Karyawan"
Dari karyawan;
Yang di mana yang harus anda gunakan klausa untuk
menyelesaikan pernyataan ini?
WHERE email = NULL;
WHERE email != NULL;
WHERE email IS NULL;
WHERE email IS NOT NULL; (*)
Salah. Lihat bagian 16 Latihan 3.
26. Jika Anda menulis pertanyaan menggunakan BETWEEN operator
tidak kira apa urutan yang Anda masukkan nilai-nilai, iaitu
BETWEEN nilai rendah dan AND tinggi akan memberikan hasil
yang sama seperti BETWEEN nilai tinggi AND nilai yang rendah.
Benar atau Salah?
Benar

Tandai untuk
Meninjau
(1) Poin

Salah (*)

Benar.
27. Anda perlu menggabungkan FIRST_NAME dan LAST_NAME kolom
dalam tabel EMPLOYESS dan menampilkan kolom sebagai
karakter gabungan string. Operator yang harus anda gunakan?

Tandai untuk
Meninjau
(1) Poin

+
|
|| (*)
Dan

Benar.
28. Ketika menggunakan LIKE kondisi untuk mencari _ simbol-simbol,
karakter yang dapat anda gunakan sebagai opsi ESCAPE default?

Tandai untuk
Meninjau
(1) Poin

%
^
&
\ (*)

Benar.
29. Apa kata kunci DISTINCT bila digunakan dalam sebuah SELECT
clause?

Tandai untuk
Meninjau
(1) Poin

Menyembunyikan nilai-nilai NULL


Menghapus semua nilai-nilai unik dan membandingkan nilainilai
Menghapus baris duplikat dalam hasil (*)
Menghilangkan hanya baris dalam hasil unik

Benar.
30. Ketika menggunakan LIKE kondisi, simbol yang mewakili urutan
apa pun dari karakter panjang apa pun--nol, salah satu, atau
beberapa karakter?

Tandai untuk
Meninjau
(1) Poin

_
% (*)
#
&

Benar.
16 Bagian
(Menjawab semua pertanyaan dalam bagian ini)
31. Anda perlu menampilkan semua baris dalam tabel
EMPLOYESSyang berisi nilai null dalam kolom DEPARTMENT_ID.
Perbandingan yang harus anda menggunakan operator?

Tandai untuk
Meninjau
(1) Poin

"= NULL"
NULL!
ISNULL
IS NULL (*)

Benar.
32. Anda perlu menampilkan hanya kombinasi unik dari LAST_NAME
dan MANAGER_ID kolom dalam tabel EMPLOYEES Kata kunci yang
harus anda termasuk dalam SELECt clause?

Tandai untuk
Meninjau
(1) Poin

Hanya
UNIQUEONE
DISTINCT (*)
DISTINCTROW

Benar.
33. Anda perlu menulis SELECT pernyataan bahwa sebaiknya hanya
kembali baris yang berisi 34, 46, atau 48 untuk kolom
DEPARTMENT_ID. Operator yang harus anda gunakan WHERE
clause untuk membandingkan DEPARTMENT_ID untuk daftar
tertentu dari nilai-nilai ini?
=
!=
Dalam (*)
Antara..DAN..

Tandai untuk
Meninjau
(1) Poin

Benar.
34. Anda ingin menentukan perintah-perintah yang telah ditempatkan
oleh pelanggan yang berada di kota Chicago. Anda menulis
sebagian ini statemen SELECT:

Tandai untuk
Meninjau
(1) Poin

Pilih orderid, orderdate, total


Dari perintah;
Apa yang harus anda termasuk dalam pernyataan pilih untuk
anda mencapai hasil yang diinginkan?
Dan kota = Chicago;
Dan kota = 'Chicago';
Di mana kota = 'Chicago'; (*)
Di mana kota = Chicago;

Benar.
35. Anda ingin mengambil daftar pelanggan yang memiliki nama
belakang mulai dengan huruf-huruf 'Fr' . yang harus anda
termasuk simbol dalam klausa di mana yang anda pilih
pernyataan untuk mencapai hasil yang diinginkan?

Tandai untuk
Meninjau
(1) Poin

% (*)
~
#
*

Benar.
36. Anda perlu menampilkan semua karyawan yang nama belakang
(dari panjang apa pun) mulai dengan huruf-huruf 'm' . Yang di
mana FROM clause harus anda gunakan?

Di mana nama_terakhir seperti 'Sm%' (*)


Di mana nama_terakhir seperti '%Sm'
Di mana nama_terakhir seperti '_Sm'
Di mana nama_terakhir seperti 'Sm_'

Benar.

Tandai untuk
Meninjau
(1) Poin

17 Bagian
(Menjawab semua pertanyaan dalam bagian ini)
37. Mengevaluasi pernyataan SQL ini:
Pilih product_id produk,_name, harga
Produk-produk dari
Dengan product_name, harga;

Tandai untuk
Meninjau
(1) Poin

Apa yang terjadi ketika pernyataan dijalankan?


Hasil diurutkan secara numerikal saja.
Hasil diurutkan hanya menurut abjad.
Hasil diurutkan secara numerikal dan kemudian menurut
abjad.
Hasil diurutkan berdasar abjad dan kemudian secara
numerikal. (*)
Benar.
38. Mengevaluasi SELECT ini:
SELECT last_name, first_name, department_id, manager_id
FROM employees;

Tandai untuk
Meninjau
(1) Poin

Anda perlu mengurutkan data dengan manager nilai-nilai id dan


kemudian berdasar abjad nama belakang karyawan dan nilai-nilai
nama pertama. ORDER BY clause dapat anda gunakan?
Memesan oleh departemen_id, nama_Terakhir
Oleh manager_id, nama_terakhir, nama_pertama (*)
Dengan nama_terakhir, first_name, manager_id
Oleh manager_id, nama_pertama, nama_Terakhir

Benar.
39. Anda berusaha query database dengan pernyataan SQL ini:
SELECT product_id "Product Number", category_id "Category",
price "Price"
FROM products
WHERE "Category" = 5570
ORDER BY "Product Number";
Pernyataan ini gagal ketika dijalankan. Klausa yang berisi
kesalahan sintaks?
Pilih product_id "Nomor Produk", kategori_id kategori "",
"harga harga"
Dengan "Nomor Produk";
Produk-produk dari

Tandai untuk
Meninjau
(1) Poin

Di mana "kategori" = 5570 (*)

Salah! Lihat bagian 17 Pelajaran 2.


40. Anda perlu membuat laporan untuk menampilkan semua
karyawan yang dipekerjakan pada atau sebelum tanggal 1
Januari, 1996. Data harus ditampilkan dalam format ini:

Karyawan
14837 - Smith

Tanggal Mulai Gaji dan


10-MUNGKIN-1992 / 5000

Tandai untuk
Meninjau
(1) Poin

Yang dapat anda gunakan pernyataan pilih?


SELECT employee_id || - || last_name "Employee",
hire_date || / || salary "Start Date and Salary
FROM employees
WHERE hire_date <= '01-JAN-1996';
SELECT employee_id ||' '|| last_name "Employee",
hire_date ||' '|| salary "Start Date and Salary"
FROM employees
WHERE hire_date <= 01-JAN-1996';
SELECT employee_id ||'"- "|| last_name "Employee",
hire_date ||" / "|| salary Start Date and Salary"
FROM employees
WHERE hire_date <= '01-JAN-1996';
SELECT employee_id ||' - '|| last_name 'Employee',
hire_date ||' / '|| salary 'Start Date and Salary"
FROM employees
WHERE hire_date <= '01-JAN-1996';
SELECT employee_id ||' - '|| last_name "Employee",
hire_date ||' / '|| salary "Start Date and Salary"
FROM employees
WHERE hire_date <= '01-JAN-1996';
(*)
Salah! Lihat bagian 17 Pelajaran 2.
17 Bagian
(Menjawab semua pertanyaan dalam bagian ini)
41. Mengevaluasi SELECT ini:
FROM employees
ORDER BY last_name;

Tandai untuk
Meninjau
(1) Poin

Pernyataan mana yang benar?


Baris tidak akan diurutkan.
Baris akan diurutkan berdasar abjad oleh nilai-nilai
nama_terakhir. (*)
Baris akan diurutkan sesuai dengan urutan abjad terbalik
oleh nilai-nilai nama_terakhir.
Baris akan diurutkan berdasar abjad nama_pertama dan
kemudian LAST_NAME nilai-nilai
Benar.
42. Tabel PLAYERS berisi kolom ini:
Tabel PLAYERS:
Nama_TERAKHIR VARCHAR2 (20)
FIRST_NAME VARCHAR2 (20)

Tandai untuk
Meninjau
(1) Poin

Nomor GAJI(8,2)
Nomor ID_TIM(4)
MANAGER NOMOR ID_(9)
Nomor ID_POSISI(4)
Anda ingin menampilkan semua pemain' posisi dengan nama
6900 atau yang lebih besar.
Anda ingin nama pemain yang akan ditampilkan berdasar abjad
nama terakhir dan kemudian oleh nama pertama.
Pernyataan mana yang harus anda gunakan untuk mencapai hasil
yang diperlukan?
SELECT last_name, first_name
FROM players
WHERE position_id >= 6900
ORDER BY last_name, first_name;
(*)
SELECT last_name, first_name
FROM players
WHERE position_id > 6900
ORDER BY last_name, first_name;
SELECT last_name, first_name
FROM players
WHERE position_id <= 6900
ORDER BY last_name, first_name;
SELECT last_name, first_name
FROM players
WHERE position_id >= 6900
ORDER BY last_name DESC, first_name;
Benar.
43. Tabel PLAYERS berisi kolom ini:
Tabel PLAYERS:
Nama_TERAKHIR VARCHAR2 (20)
FIRST_NAME VARCHAR2 (20)
Nomor GAJI(8,2)
Nomor ID_TIM(4)
MANAGER NOMOR ID_(9)
Nomor ID_POSISI(4)
Anda harus menampilkan nama pemain, id tim, dan gaji untuk
gaji para pemain yang berkisar dari 25,000 eks melalui id 100000
dan tim yang berkisar dari 1200 melalui 1500. Hasil harus disortir
oleh tim id dari terendah hingga tertinggi dan kemudian gaji
disortir dengan lebih lanjut dari level terendah tertinggi.
Pernyataan mana yang harus anda gunakan untuk menampilkan
hasil yang diinginkan?
SELECT last_name, first_name, team_id, salary
FROM players
WHERE (salary > 25000 OR salary < 100000)
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id, salary;
SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary BETWEEN 25000 AND 100000
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id, salary DESC;
(*)

Tandai untuk
Meninjau
(1) Poin

SELECT last_name, first_name, team_id, salary


FROM players
WHERE salary > 24999.99 AND salary < 100000
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id ASC, salary DESC;
SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary BETWEEN 24999.99 AND 100000.01
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id DESC, salary DESC;
Salah! Lihat bagian 17 Latihan 3.
44. Mengevaluasi pernyataan SQL ini:
Pilih e.id_karyawan, e.nama_terakhir, e.first_name, m.manager_id
Dari karyawan e, karyawan m
ORDER melalui e.nama_terakhir, e.nama_pertama
Di mana e.id_karyawan = m.manager_id;

Tandai untuk
Meninjau
(1) Poin

Pernyataan ini gagal ketika dijalankan. Yang mengubah akan


memperbaiki masalah tersebut?
Menyusun ulang klausa dalam query. (*)
Lepaskan tabel alias dalam di mana FROM clause.
Lepaskan tabel alias di urutan BY clause.
Termasuk memiliki FROM clause.

Benar.
45. Pernyataan mana yang tentang operator logis adalah benar?
Tandai untuk
Meninjau
(1) Poin
Urutan operator didahulukan adalah Dan, atau, dan tidak.
Urutan operator adalah Dan, tidak lebih dulu, dan atau.
Urutan-urutan tidak, operator atau, dan Dan.
Urutan-urutan tidak, operator dan, dan atau. (*)

Benar.
46. Kondisi perbandingan yang berarti "kurang dari atau sama
dengan"?

"=)"
"+<"
">="

Tandai untuk
Meninjau
(1) Poin

"<=" (*)

Benar.
47. Pernyataan mana yang tentang urutan mengurutkan default
benar?

Tandai untuk
Meninjau
(1) Poin

Nilai-nilai angka terendah ditampilkan terakhir.


Tarikh terawal adalah nilai ditampilkan pertama. (*)
Nilai-nilai null pertama akan ditampilkan.
Nilai-nilai karakter ditampilkan dalam urutan abjad terbalik.

Benar.
48. Klausa yang akan Anda sertakan dalam sebuah pernyataan pilih
untuk menyortir baris kembali oleh kolom nama_terakhir?

Tandai untuk
Meninjau
(1) Poin

ORDER MELALUI (*)


Di MANA
Dari
Setelah

Benar.
49. Dari kiri ke kanan, apa yang dimaksud dengan urutan yang benar
keutamaan?

Tandai untuk
Meninjau
(1) Poin

Aritmetika, Concatenation, Perbandingan, ATAU (*)


Tidak, Dan, atau, Aritmetik
Aritmetika, tidak dan logis perbandingan,
Aritmetika, Tidak, Concatenation dan logis

Benar.
50. Mana dari yang berikut ini yang paling baik menerangkan maksud
dari operator seperti?

Tandai untuk
Meninjau
(1) Poin

Tampilkan baris berdasarkan berbagai nilai-nilai.


Untuk menguji nilai-nilai dalam daftar.
Sama dengan pola karakter. (*)
Untuk menemukan nilai-nilai NULL.

Benar.

Section 11
(Answer all questions in this section)
1. In a conceptual model, many-to-many relationships are resolved via a
structure called a/an: ________________

Mark for
Review
(1) Points

Supertype
Intersection Table
Intersection Entity (*)
Subtype
Correct
2. To resolve a many to many relationship in a physical model you create
a/an ___________________?

Mark for
Review
(1) Points

Unique key constraints


Intersection entity
Intersection table (*)
Two tables with Foreign key constraints between them
Correct

3. The transformation from an ER diagram to a physical design involves


changing terminology. Secondary Unique Identifiers become

Mark for
Review
(1) Points

Columns
Tables
Unique Constraints (*)
Primary Key Constraints
Correct
4. Attributes become tables in a database. True or False?

Mark for
Review
(1) Points

True
False (*)
Correct
5. In an Oracle database, why would 1_TABLE not work as a table name?

Mark for
Review
(1) Points

The database does not understand all capital letters.


There is no problem here. You can create a table called 1_TABLE.
Object names must not start with a number. They must begin with
a letter. (*)
TABLE is a reserved word.
Correct
6. An "Arc Implementation" can be done just like any other Relationship you simply add the required Foreign Keys. True or False?

Mark for
Review
(1) Points

True
False (*)
Correct
7. The explanation below is a User Defined integrity rule and must,
therefore, be manually coded; the Database cannot enforce this rule
automatically. True or False?
A primary key must be unique, and no part of the primary key can be
null.

Mark for
Review
(1) Points

True
False (*)
Incorrect. Refer to Section 11 Lesson 1.
8. A table must have at least one candidate key, as well as its primary key.
True or False?

Mark for
Review
(1) Points

True
False (*)
Correct
9. If a primary key is a set of columns, then one column must be null. True
or False?

Mark for
Review
(1) Points

True
False (*)
Correct
10. Entity integrity refers to:

Mark for
Review
(1) Points

Tables always containing text data


Tables always containing numeric data
Columns having Primary Keys, Foreign Keys, Unique Keys, and
Check constraints defined in the database.
Tables having Primary Keys, Foreign Keys, Unique Keys, and Check
constraints defined in the database. (*)
Correct
ection 11
(Answer all questions in this section)
11. The text below is an example of what constraint type?
If the number of BOOKS lent to a BORROWER in the LIBRARY exceeds 5,
then we must send him a letter requesting the return of the BOOKS; this
will require extra programming to enforce.
Entity integrity
User-defined integrity (*)
Column integrity
Referential integrity

Mark for
Review
(1) Points

Incorrect. Refer to Section 11 Lesson 1.

Section 12
(Answer all questions in this section)
12. System Documentation is developed right at the end once the system
has gone live and users have been using it for a little while. You are
more likely to get it correct that way. True or False?

Mark for
Review
(1) Points

True
False (*)
Correct.
13. In the Analysis phase, the tables are created and populated with test
data. True or False?

Mark for
Review
(1) Points

True
False (*)
Correct.
14. Once you have created a table, it is not possible to alter the definition of
it. If you need to add a new column you must delete the table definition
and create a new, correct table. True or False?

Mark for
Review
(1) Points

True
False (*)
Correct.
15. The SQL statement ALTER TABLE EMPLOYEES DELETE COLUMN SALARY
is a valid statement. True or False?

Mark for
Review
(1) Points

True
False (*)
Correct.
16. What command can be used to create a new row in a table in the
database?

Mark for
Review

(1) Points
CREATE
NEW
ADD
INSERT (*)
Correct.
17. The _______ clause can be added to a SELECT statement to return a
subset of the data.

Mark for
Review
(1) Points

ANYWHERE
WHICH
WHERE (*)
EVERY
Correct.
18. The DESCRIBE command returns all rows from a table. True or False?

Mark for
Review
(1) Points

True
False (*)
Correct.

Section 15
(Answer all questions in this section)
19. In which clause of a SELECT statement would you specify the name of
the table or tables being queried?

Mark for
Review
(1) Points

The FROM clause (*)


The SELECT clause
The WHERE clause
Any of the above options; you can list tables wherever you want in
a SELECT statement.
Correct.

20. Evaluate this SELECT statement:


SELECT (salary * raise_percent) raise
FROM employees;

Mark for
Review
(1) Points

If the RAISE_PERCENT column only contains null values, what will the
statement return?
Only zeroes
Only null values (*)
A null value or a zero depending on the value of the SALARY
column
A null value or a numeric value depending on the value of the
SALARY column
Incorrect. See Section 15 Lesson 1.

Section 15
(Answer all questions in this section)
21. In a SQL statement, which clause specifies one or more columns to be
returned by the query?

Mark for
Review
(1) Points

SELECT (*)
FROM
WHERE
Any of the above options; you can list columns wherever you want
to in a SELECT statement.
Incorrect. See Section 15 Lesson 1.
22. In a SELECT clause, what is the result of 2 + 3 * 2?

Mark for
Review
(1) Points

6
8 (*)
10
13
Correct.
23. You query the database with this SQL statement:
SELECT * FROM students;
Why would you use this statement?

To insert data

Mark for
Review
(1) Points

To view data (*)


To display the table structure
To delete data
Correct.
24. The SELECT statement retrieves information from the database. In a
SELECT statement, you can do all of the following EXCEPT:

Mark for
Review
(1) Points

Projection
Manipulation (*)
Joining
Selection
Correct.

Section 16
(Answer all questions in this section)
25. The EMPLOYEES table contains these columns:
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
EMAIL VARCHAR2(50)

Mark for
Review
(1) Points

You are writing a SELECT statement to retrieve the names of employees


that have an email address.
SELECT last_name||', '||first_name "Employee Name"
FROM employees;
Which WHERE clause should you use to complete this statement?
WHERE email = NULL;
WHERE email != NULL;
WHERE email IS NULL;
WHERE email IS NOT NULL; (*)
Incorrect. See Section 16 Lesson 3.
26. If you write queries using the BETWEEN operator, it does not matter in
what order you enter the values, i.e. BETWEEN low value AND high
value will give the same result as BETWEEN high value and low value.
True or False?
True

Mark for
Review
(1) Points

False (*)
Correct.
27. You need to combine the FIRST_NAME and LAST_NAME columns in the
EMPLOYEES table and display the columns as a combined character
string. Which operator should you use?

Mark for
Review
(1) Points

+
|
|| (*)
AND
Correct.
28. When using the LIKE condition to search for _ symbols, which character
can you use as the default ESCAPE option?

Mark for
Review
(1) Points

%
^
&
\ (*)
Correct.
29. What does the DISTINCT keyword do when it is used in a SELECT
clause?

Mark for
Review
(1) Points

Hides NULL values


Eliminates all unique values and compares values
Eliminates duplicate rows in the result (*)
Eliminates only unique rows in the result
Correct.
30. When using the LIKE condition, which symbol represents any sequence
of characters of any length--zero, one, or more characters?

Mark for
Review
(1) Points

_
% (*)
#

&
Correct.
Section 16
(Answer all questions in this section)
31. You need to display all the rows in the EMPLOYEES table that contain a
null value in the DEPARTMENT_ID column. Which comparison operator
should you use?

Mark for
Review
(1) Points

"= NULL"
NULL!
ISNULL
IS NULL (*)
Correct.
32. You need to display only unique combinations of the LAST_NAME and
MANAGER_ID columns in the EMPLOYEES table. Which keyword should
you include in the SELECT clause?

Mark for
Review
(1) Points

ONLY
UNIQUEONE
DISTINCT (*)
DISTINCTROW
Correct.
33. You need write a SELECT statement that should only return rows that
contain 34, 46, or 48 for the DEPARTMENT_ID column. Which operator
should you use in the WHERE clause to compare the DEPARTMENT_ID
column to this specific list of values?

Mark for
Review
(1) Points

=
!=
IN (*)
BETWEEN..AND..
Correct.
34. You want to determine the orders that have been placed by customers
who reside in the city of Chicago. You write this partial SELECT
statement:
SELECT orderid, orderdate, total
FROM orders;

Mark for
Review
(1) Points

What should you include in your SELECT statement to achieve the


desired results?
AND city = Chicago;
AND city = 'Chicago';
WHERE city = 'Chicago'; (*)
WHERE city = Chicago;
Correct.
35. You want to retrieve a list of customers whose last names begin with the
letters 'Fr' . Which symbol should you include in the WHERE clause of
your SELECT statement to achieve the desired result?

Mark for
Review
(1) Points

% (*)
~
#
*
Correct.
36. You need to display all the employees whose last names (of any length)
start with the letters 'Sm' . Which WHERE clause should you use?

Mark for
Review
(1) Points

WHERE last_name LIKE 'Sm%' (*)


WHERE last_name LIKE '%Sm'
WHERE last_name LIKE '_Sm'
WHERE last_name LIKE 'Sm_'
Correct.

Section 17
(Answer all questions in this section)
37. Evaluate this SQL statement:
SELECT product_id, product_name, price
FROM products
ORDER BY product_name, price;
What occurs when the statement is executed?
The results are sorted numerically only.
The results are sorted alphabetically only.

Mark for
Review
(1) Points

The results are sorted numerically and then alphabetically.


The results are sorted alphabetically and then numerically. (*)
Correct.
38. Evaluate this SELECT statement:
SELECT last_name, first_name, department_id, manager_id
FROM employees;

Mark for
Review
(1) Points

You need to sort data by manager id values and then alphabetically by


employee last name and first name values. Which ORDER BY clause
could you use?
ORDER BY department_id, last_name
ORDER BY manager_id, last_name, first_name (*)
ORDER BY last_name, first_name, manager_id
ORDER BY manager_id, first_name, last_name
Correct.
39. You attempt to query the database with this SQL statement:
SELECT product_id "Product Number", category_id "Category", price
"Price"
FROM products
WHERE "Category" = 5570
ORDER BY "Product Number";

Mark for
Review
(1) Points

This statement fails when executed. Which clause contains a syntax


error?
SELECT product_id "Product Number", category_id "Category", price
"price"
ORDER BY "Product Number";
FROM products
WHERE "Category" = 5570 (*)
Incorrect! See Section 17 Lesson 2.
40. You need to create a report to display all employees that were hired on
or before January 1, 1996. The data should display in this format:

Employee
14837 - Smith

Start Date and


Salary
10-MAY-1992 /
5000

Which SELECT statement could you use?


SELECT employee_id || - || last_name "Employee",
hire_date || / || salary "Start Date and Salary
FROM employees
WHERE hire_date <= '01-JAN-1996';
SELECT employee_id ||' '|| last_name "Employee",

Mark for
Review
(1) Points

hire_date ||' '|| salary "Start Date and Salary"


FROM employees
WHERE hire_date <= 01-JAN-1996';
SELECT employee_id ||'"- "|| last_name "Employee",
hire_date ||" / "|| salary Start Date and Salary"
FROM employees
WHERE hire_date <= '01-JAN-1996';
SELECT employee_id ||' - '|| last_name 'Employee',
hire_date ||' / '|| salary 'Start Date and Salary"
FROM employees
WHERE hire_date <= '01-JAN-1996';
SELECT employee_id ||' - '|| last_name "Employee",
hire_date ||' / '|| salary "Start Date and Salary"
FROM employees
WHERE hire_date <= '01-JAN-1996';
(*)
Incorrect! See Section 17 Lesson 2.
Section 17
(Answer all questions in this section)
41. Evaluate this SELECT statement:
SELECT first_name, last_name, email
FROM employees
ORDER BY last_name;

Mark for
Review
(1) Points

Which statement is true?


The rows will not be sorted.
The rows will be sorted alphabetically by the LAST_NAME values. (*)
The rows will be sorted in reverse alphabetical order by the
LAST_NAME values.
The rows will be sorted alphabetically by the FIRST_NAME and then
the LAST_NAME values
Correct.
42. The PLAYERS table contains these columns:
PLAYERS TABLE:
LAST_NAME VARCHAR2 (20)
FIRST_NAME VARCHAR2 (20)
SALARY NUMBER(8,2)
TEAM_ID NUMBER(4)
MANAGER_ID NUMBER(9)
POSITION_ID NUMBER(4)
You want to display all players' names with position 6900 or greater.
You want the players names to be displayed alphabetically by last name
and then by first name.
Which statement should you use to achieve the required results?
SELECT last_name, first_name
FROM players
WHERE position_id >= 6900
ORDER BY last_name, first_name;
(*)
SELECT last_name, first_name

Mark for
Review
(1) Points

FROM players
WHERE position_id > 6900
ORDER BY last_name, first_name;
SELECT last_name, first_name
FROM players
WHERE position_id <= 6900
ORDER BY last_name, first_name;
SELECT last_name, first_name
FROM players
WHERE position_id >= 6900
ORDER BY last_name DESC, first_name;
Correct.
43. The PLAYERS table contains these columns:
PLAYERS TABLE:
LAST_NAME VARCHAR2 (20)
FIRST_NAME VARCHAR2 (20)
SALARY NUMBER(8,2)
TEAM_ID NUMBER(4)
MANAGER_ID NUMBER(9)
POSITION_ID NUMBER(4)

Mark for
Review
(1) Points

You must display the player name, team id, and salary for players
whose salary is in the range from 25000 through 100000 and whose
team id is in the range of 1200 through 1500. The results must be
sorted by team id from lowest to highest and then further sorted by
salary from highest to lowest. Which statement should you use to
display the desired result?
SELECT last_name, first_name, team_id, salary
FROM players
WHERE (salary > 25000 OR salary < 100000)
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id, salary;
SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary BETWEEN 25000 AND 100000
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id, salary DESC;
(*)
SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary > 24999.99 AND salary < 100000
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id ASC, salary DESC;
SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary BETWEEN 24999.99 AND 100000.01
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id DESC, salary DESC;
Incorrect! See Section 17 Lesson 3.
44. Evaluate this SQL statement:
SELECT e.employee_id, e.last_name, e.first_name, m.manager_id
FROM employees e, employees m
ORDER BY e.last_name, e.first_name
WHERE e.employee_id = m.manager_id;

Mark for
Review
(1) Points

This statement fails when executed. Which change will correct the
problem?
Reorder the clauses in the query. (*)
Remove the table aliases in the WHERE clause.
Remove the table aliases in the ORDER BY clause.
Include a HAVING clause.
Correct.
45. Which statement about the logical operators is true?

Mark for
Review
(1) Points

The order of operator precedence is AND, OR, and NOT.


The order of operator precedence is AND, NOT, and OR.
The order of operator precedence is NOT, OR, and AND.
The order of operator precedence is NOT, AND, and OR. (*)
Correct.
46. Which comparison condition means "Less Than or Equal To"?

Mark for
Review
(1) Points

"=)"
"+<"
">="
"<=" (*)
Correct.
47. Which statement about the default sort order is true?

Mark for
Review
(1) Points

The lowest numeric values are displayed last.


The earliest date values are displayed first. (*)
Null values are displayed first.
Character values are displayed in reverse alphabetical order.
Correct.
48. Which clause would you include in a SELECT statement to sort the rows
returned by the LAST_NAME column?

Mark for

Review
(1) Points
ORDER BY (*)
WHERE
FROM
HAVING
Correct.
49. From left to right, what is the correct order of Precedence?

Mark for
Review
(1) Points

Arithmetic, Concatenation, Comparison, OR (*)


NOT, AND, OR, Arithmetic
Arithmetic, NOT, Logical, Comparison
Arithmetic, NOT, Concatenation, Logical
Correct.
50. Which of the following best describes the meaning of the LIKE operator?

Mark for
Review
(1) Points

Display rows based on a range of values.


To test for values in a list.
Match a character pattern. (*)
To find Null values.
Correct.

Anda mungkin juga menyukai