kisi-kisi

  • Upload
    ronzp

  • View
    52

  • Download
    0

Embed Size (px)

Citation preview

1. Which select statement display the number of items whose LIST_PRICE is greater than $400,00 ? a. SELECT SUM(*) c. SELECT COUNT(*) FROM product FROM product WHERE list_price > 400 WHERE list_price > 400 b. SELECT SUM(*) d. SELECT SUM(*) FROM product FROM product ORDER BY list_price GROUP BY list_price > 400 2. For which situation would you use a group function ? a. To display the order date of orders in DD MON YYYY format b. To convert the character string January 28, 2002 to date format c. To eliminate duplicate values of the ORDER_ID column of the LINE_ITEM table d. To produce a total of all the values in the COST column of the PRODUCT table e. To display all the values in the CATEGORY column of the PRODUCT table in uppercase 3. Which statement concerning SQL functions is true ? a. All date functions return DATE data type values b. Character functions can return character or number values c. Single-row functions can only be used in SELECT and WHERE clauses d. Convertion functions convert a column definition from one data type to another data type 4. Which aritmetic operation will return a numeric value ? a. 14-FEB-2005 + 25 b. 03-JAN-2005 30 c. 17-JUN-1999 * (480/24) d. TO_DATE(01-JAN-2001) - TO_DATE(01-DEC-2000) 5. a. b. c. d. e. Which two statements about the evaluation of clauses in a SELECT statement are true ? The Oracle Server will evaluate a HAVING clause before a WHERE clause The Oracle Server will evaluate a WHERE clause before a GROUP BY clause The Oracle Server will evaluate a GROUP BY clause before a HAVING clause The Oracle Server will evaluate an ORDER BY clause before a WHERE clause The Oracle Server will evaluate a ORDER BY clause before a HAVING clause

6. Perhatikan pernyataan di bawah ini : SELECT empno, salary FROM employee WHERE location LIKE %N\%Y\%C% ESCAPE \; Pola karakter mana yang paling menggambarkan pola yang dicari ? a. NYC b. N\Y\C c. N%Y%C d. N\%Y\%C 7. Perhatikan query di bawah ini : SELECT salary FROM employees WHERE salary BETWEEN 1000 AND 5000 OR salary IN (2600,7100,960) AND salary BETWEEN 2600 and 7600; Pilih salah satu hasil di bawah ini yang memungkinkan ketika pernyataan di atas dijalankan ? a. 3100 b. 5100 c. 7600 d. 960 8. Berapa nilai yang akan ditampilkan dari pernyataan di bawah ini : SELECT empno FROM hr WHERE salary > 20000 and Location = Cairo Empno 1234 5048 7136 9984 a. b. c. d. e. 5048 9984 7136 1234 Jawaban a,b,c,d salah Location Cairo Jakarta Sydney Cairo Salary 10000 10000 100000 100000

9. Kamu meng-query database dengan pernyataan SQL di bawah ini :SELECT * FROM transaction;

Untuk tujuan apa pernyataan di atas dibuat ? a. Untuk memasukkan data ke tabel transaction b. Untuk melihat data di tabel transaction c. Untuk melihat struktur tabel transaction d. Untuk menghapus data yang dipilih dari tabel transaction 10. Pernyataan SELECT mana yang seharusnya kamu gunakan jika kamu ingin menampilkan kombinasi yang unik nilai POSITION dan MANAGER dari tabel EMPLOYEE ? a. SELECT position, manager DISTINCT FROM employee b. SELECT position, manager FROM employee c. SELECT DISTINCT position, manager FROM employee d. SELECT position, DISTINCT manager FROM employee 11. Tanggal dan karakter literal harus diapit dengan a. Ampersand (&) b. Double Ampersand (&&) c. Concat (|| ||) d. Single quotation marks ( ) e. Double quotation marks ( )

12. Pernyataan SELECT mana yang seharusnya kamu gunakan jika kamu ingin menampilkan last_namedan job_id untuk semua pegawai yang tidak memiliki manager id dari tabel EMPLOYEE ? a. SELECT last_name, job_id FROM employee WHERE manager_id is null; b. SELECT last_name, job_id FROM employee WHERE manager_id is not null; c. SELECT last_name, job_id FROM employee WHERE manager_id = 0; d. SELECT last_name, job_id, manager_id = 0 FROM employee; 13. Pernyataan SELECT mana yang seharusnya kamu gunakan jika kamu ingin menampilkan last_name dan new_salary yang telah 15%, dengan ketentuan new salary tersebut diantara $10000 dan $15000 dari tabel EMPLOYEE ? a. SELECT last_name, new_salary FROM employee WHERE (salary + salary * 0.15) between 10000 and 15000; b. SELECT last_name, salary as New_Salary FROM employee WHERE (salary + salary * 0.15) between 10000 and 15000; c. SELECT last_name, (salary + salary * 0.15) as New_Salary FROM employee WHERE (salary + salary * 0.15) between 10000 and 15000; d. SELECT last_name, salary FROM employee WHERE salary = (salary + salary * 0.15) between 10000 and 15000; 14. Pernyataan SELECT mana yang seharusnya kamu gunakan jika kamu ingin menampilkan last_name, hire_date dan salary untuk employee yang job_id-nya IT_PROG dan AD_VP dari tabel EMPLOYEE ? a. SELECT last_name, hire_date, salary FROM employee WHERE job_id between IT_PROG and AD_VP; b. SELECT last_name, hire_date, salary FROM employee WHERE job_id like IT_PROG and job_id like AD_VP; c. SELECT last_name, hire_date, salary FROM employee WHERE job_id = IT_PROG and job_id = AD_VP; d. SELECT last_name, hire_date, salary FROM employee WHERE job_id in (IT_PROG,AD_VP); 15. Pernyataan SELECT mana yang seharusnya kamu gunakan jika kamu ingin menampilkan last_name dan salary untuk salary lebih dari $12000 dan selain job_id-nya AD_VP dari tabel EMPLOYEE ? a. SELECT last_name, salary FROM employee WHERE salary > 12000 and job_id is not AD_VP; b. SELECT last_name, salary FROM employee WHERE salary > 12000 and job_id AD_VP; c. SELECT last_name, salary > 12000 FROM employee WHERE job_id is not AD_VP; d. SELECT last_name, salary > 12000 FROM employee WHERE job_id not like AD_VP; 16. Evaluate the following query : SELECT Pr.id, I.id FROM Product Pr, Item I WHERE Pr.id = I.Prod_id ORDER BY Product.id Which line causes an error ? a. 1 c. 3 b. 2 d. 4 17. Which SELECT statement could you use to display the number of times each technician performed a service between January 1, 2001 and june 30, 2001 ? a. SELECT COUNT(*) FROM service WHERE service_date BETWEEN 01-JAN-2001 and 30-JUN-2001 GROUP BY service_date; b. SELECT COUNT(service_date) FROM service WHERE service_date BETWEEN 01-JAN-2001 and 30-JUN-2001 GROUP BY service_date; c. SELECT technician_id,service_date,COUNT(*)

FROM service WHERE service_date BETWEEN 01-JAN-2001 and 30-JUN-2001 ORDER BY technician_id,service_date; d. SELECT technician_id,COUNT(technician_id) FROM service WHERE service_date BETWEEN 01-JAN-2001 and 30-JUN-2001 GROUP BY technician_id; 18. Which statement about joining tables with a non-equijoin is true ? a. The column being joined must have compatible data types b. No more than three tables can be joined using a non-equijoin c. The tables being joined must have primary and foreign keys defined d. The tables being joined must NOT have any columns with the same name e. The number of join conditions required is always one less than the number of tables being joined 19. Which three statements about column are true? a. You CANNOT decrease the width of a CHAR column b. You CANNOT increase the width of a VARCHAR2 data type c. You CANNOT convert a CHAR data type column to the VARCHAR2 data type d. You CANNOT specify the columns position when adding a new column to a table e. You CANNOT modify the data type of column if the column contains non-null data 20. Which four statements about oracle constraints are true ? a. A CHECK constraint specifies a condition that must be true b. A PRIMARY KEY constraint uniquely identifies each row of a table c. A NOT NULL constraint ensures that null values are NOT allowed in a column d. A UNIQUE constraint prohibits the input of nulls because nulls do NOT satisfy the constraint conditions e. A PRIMARY KEY constraint allows null values in a column when the column is part of a set of columns that uniquely identifies each row ESSAY 1. Departement HR menginginkan sebuah query untuk menampilkan Last_name Job_code Hire_date Dan Employee number Untuk masing-masing pegawai dengan menampilkan employee number sebagai urutan pertama. Berikan nama alias StartDate pada kolom Hire_Date!

2. Department HR membutuhkan sebuah query untuk menampilkan Job_id secara unik dari table employee! 3. Tampilkan last_name, job_id dan salary yang digabungkan dalam satu kolom dengan nama Employee, Titleand salary! (pisahkan dengan comma dan spasi)

4. Department HR membutuhkan sebuah laporan yang memiliki last_name, dan salary lebih dari $12,000 danselain yang job_id nya AD_VP!

5. Tampilkan employee number, last name, salary, dan new salary yang ditambahkan 15 % untuk employeeyang department_id nya sama dengan 20!

1. SELECT Last_name, Job_id, Hire_date as "Start Date", Employee_id FROM employees ORDER BY employee_id; 2. SELECT DISTINCT job_id FROM employees;

3. SELECT last_name||' , '||job_id||' , '|| salary as "Employee, Title and salary" FROM employees;4. SELECT last_name, salary FROM employees WHERE salary > 12000 and job_id 'AD_VP'; 5. SELECT employee_id, last_name, salary, (salary + salary * 0.15) as "New Salary" FROM employees WHERE department_id = 20;

1. Buatlah sebuah laporan yang menampilkan last_name, hire_date dan salary untuk pegawai yang job_id nyaIT_PROG dan AD_VP, urutkan berdasarkan salary secara ascending!

2. Buatlah sebuah laporan yang menampilkan last_name dan new salary yang telah ditambah 15%, denganketentuan New Salary tersebut diantara $10000 dan $15000!

3. Buatlah sebuah laporan yang menampilkan Hire_Date, last_name, job_id dan department_id untukemployee yang mulai bekerja pada tahun 1996 hingga tahun 1998, urutkan berdasarkan Hire_Date secara Ascending!

4. Tampilkan last_name dan job_id untuk semua pegawai yang tidak memiliki manager! 5. Tampilkan last_name dari tabel pegawai untuk last_name yang huruf ketiganya adalah e!

1. SELECT last_name, hire_date, salary FROM employees WHERE job_id IN ('IT_POG','AD_VP') ORDER BY salary ASC; 2. SELECT last_name, (salary + salary * 0.15) as "New Salary" FROM employees WHERE (salary + salary * 0.15) BETWEEN 10000 AND 15000; 3. SELECT hire_date, last_name, job_id, department_id, FROM employees WHERE to_char(hire_date,'yyyy') BETWEEN 1996 AND 1998 ORDER BY hire_date ASC; 4. SELECT last_name, job_id FROM employees WHERE manager_id is null; 5. 6. SELECT last_name FROM employees WHERE last_name like '__e%'; select * from employees