0% found this document useful (0 votes)
7 views

SQL Fundamentals 10G

Uploaded by

nour.salameh03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

SQL Fundamentals 10G

Uploaded by

nour.salameh03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Q1: Consider this statement, which is intended to prompt for an

employee's

name and then find all

employees who have the same job as the first employee:

select last_name,employee_id from employees where job_id =

(select job_id from employees where last_name = '&Name');

What would happen if a value were given for &Name that did not
match

with any row in

EMPLOYEES? (Choose the best answer.)

A. The statement would fail with an error.

B. The statement would return every row in the table.

(C) The statement would return no rows.

D. The statement would return all rows where JOB ID is NULL.

Q2: Which query creates a projection of the DEPARTMENT _


NAME and LOCATION ID columns from the DEPARTMENTS table?

A. SELECT DISTINCT DEPARTMENT_NAME, LOCATION_ID


FROM DEPARTMENTS;

(B) SELECT DEPARTMENT_NAME, LOCATION_ID

FROM DEPARTMENTS;

C. SELECT DEPT NAME, LOC ID

FROM DEPT;

D. SELECT DEPARTMENT_NAME AS "LOCATION_ID"

FROM DEPARTMENTS

Q3: After describing the EMPLOYEES table, you discover that the
SALARY column has a data type of NUMBER(8,2). Which SALARY
values(s) will NOT be permitted in this column?

A. SALARY-12345678

B. SALARY-123456.78

C. SALARY-12345.678

D. SALARY-123456

E. SALARY-12.34

Q4: After describing the JOB HISTORY table, you discover that the
START DATE and END-DATE columns have a data type of DATE.
Consider the expression END_DATE -START_DATE. (Choose two
correct statements.)

A. A value of DATE data type is returned.

B. A value of type NUMBER is returned.

C. A value of type VARCHAR2 is returned.

D. The expression is invalid since arithmetic cannot be performed


on columns with DATE

data types.

E. The expression represents the days between the END DATE


and START DATE less one day.

B and E

Q5: The DEPARTMENTS table contains DEPARTMENT_NAME


column with data type VACHAR2(30). (Choose two true
statements about this column.)

A. can store character data up to a maximum of 30 characters.

B. This column must store character data that is at least 30


characters long.

C. The VARCHAR2 data type is replaced by the CHAR data type.


D. This column can store data in a column with data type
VARCHAR2(50) provided that the contents are at most 30
characters long.

Q6: which statement reports on unique JOB _ ID values from the


EMPLOYEES table?

(Choose all that apply.)

A. SELECT JOB_ID FROM EMPLOYEES;

B. SELECT UNIQUE JOB_ID FROM EMPLOYEES;

C. SELECT DISTINCT JOB_ID, EMPLOYEE_ID FROM EMPLOYEES;

D. SELECT DISTINCT JOB_ID FROM EMPLOYEES;

Q7: Choose the two illegal statements. The two correct


statements produce identical results. The two illegal statements
will cause an error to be raised:

A. SELECT DEPARTMENT_IDII represents the 'Il


DEPARTMENT_NAMEII ' Department' as "Department Info"

FROM DEPARTMENTS;

B. SELECT DEPARTMENT_IDII ' represents the Il


DEPARTMENT_NAMEII ' Department' as "Department Info"
FROM DEPARTMENTS;

C. select department_idll ' represents the 'lldepartment_namell '


Department' "Department Info"

from departments;

D. SELECT DEPARTMENT_ID represents the DEPARTMENT_NAME


Department as "Department Info"

FROM DEPARTMENTS;

Q8: Which expressions do not return NULL values? (Choose all


that apply.)

A. select ((10 + 20) * 50) + null from dual;

B select 'this is a 'lI null lI'test with nulls' from dual;

C. select null/O from dual;

D select null lI 'test' lI null as "Test" from dual;

Q9: Choose the correct syntax to return all columns and rows of
data from the

EMPLOYEES table.

A. select all from employees;


B. select employee_id, first_name, last_name, first_name,
department_id

from employees;

C. select % from employees;

D. select * from employees;

E. select . from employees;

Q1O: The following character literal expression is selected from


the DUAL table:

SELECT 'Coda"s favorite fetch toy is his orange ring' FROM DUAL;

(Choose the result that is returned.)

A. An error would be returned due to the presence of two


adjacent quotes.

B. Coda's favorite fetch toy is his orange ring

C. Coda"s favorite fetch toy is his orange ring

D. 'Coda"s favorite fetch toy is his orange ring'

Q11: Which two clauses of the SELECT statement facilitate


selection and projection?
A. SELECT, FROM

B. ORDER BY, WHERE

C. SELECT, WHERE

D. SELECT, ORDER BY

Q12: Choose the' query that extracts the LAST _ NAME, JOB_ID,
and SALARY

values from the EMPLOYEES table for records having JOB ID


values of

either SA_REP or MK MAN and having SALARY values ih The


range of

$1000 to $4000. The SELECT and FROM clauses are SELECT

LAST_NAME, JOB_ID, SALARY FROM EMPLOYEES:

A. WHERE JOB_ID IN ('SA REP','MK MAN')

AND SALARY > 1000 ANfiALARY 0000;

B. WHERE JOB_ID IN ('SA REP','MK MAN')

AND SALARY BETWEEN AND 4000;

C. WHERE JOB ID LIKE 'SA REP%’ AND

AND SALARY 51000 AND SÄLARY < 4000;

D. WHERE JOB_ID = 'SA REP'


AND SALARY BETWEEN-IOOO AND 4000

OR MAN';

Q13: which of the following WHERE clauses contains an error?


The SELECT

and FROM clauses are

SELECT * FROM EMPLOYEES:

A. WHERE HIRE_DATE IN ('02-JUN-2004');

B. WHERE SALARY IN ('1

C. WHERE JOB_ID IN (SA_REP,MK_MAN)

D. WHERE COMMISSION PCT BETWEEN 0.1 AND 0.5;

Q14: Choose the WHERE clause that extracts the DEPARTMENT


NAME

values containing the

character literal "er" from the DEPARTMENTS table. The SELECT


and

FROM clauses are

SELECT DEPARTMENT_NAME FROM DEPARTMENTS:


A. WHERE DEPARTMENT_NAME IN ('%e%r');

B. WHERE DEPARTMENT NAME LIKE '%er%';

C. WHERE DEPARTMENT_NAME BETWEEN 'e' AND

D. WHERE DEPARTMENT_NAME CONTAINS 'e%r';

Q15: Which two of the following conditions are equivalent to


each other?

A. WHERE COMMISSION_PCT IS NULL

B. WHERE COMMISSION_PCT = NULL

C. WHERE COMMISSION_PCT IN (NULL)

D. WHERE IS NOT (COMMISION_PCT IS NOT NULL)

Q16: Which three of the following conditions are equivalent to


each other?

A. WHERE SALARY AND SALARY

B. WHERE SALARY IN

C. WHERE SALARY BETWEEN 2000 AND 5000

D. WHERE SALARY > 1999 AND SALARY < 5001


E. WHERE SALARY >22000 AND

Q17: Choose one false statement about the ORDER BY clause:

A. When using the ORDER BY clause, it always appears as the


last clause

in a SELECT statement.

B. The ORDER BY clause may appear in a SELECT statement that


does

not contain a WHERE clause.

C. The ORDER BY clause specifies one or more terms by which


the

retrieved rows are sorted.

These terms can only be column names.

D. Positional sorting is accomplished by specifying the numeric


position of

a column as it ap-

pears in the SELECT list, in the ORDER BY clause.

Q18: The following query retrieves the LAST NAME, SALARY,


and

You might also like