SQL*Plus and Oracle Database: Test Questions and Answers

Classified in Computers

Written at on English with a size of 7.44 KB.

SQL*Plus is the version of SQL used to access Oracle databases

1.True

2.False

SQL*Plus del command can delete all lines from the buffer at once

1.True

2.False

There is no difference between the CHAR and VARCHAR2 data types. They are just spelled differently

1.True

2.False

Which command(s) set the title of SQL*Plus report

  1. Set Headsep
  2. Column
  3. Set PageSize
  4. Set Line Size
  5. Edit
  6. Define_Editor
  7. Start
  8. Remark
  9. /* */
  10. Host
  11. Ttitle
  12. Btitile
  13. @
  14. Break On
  15. Compute Sum
  16. Set NewPage
  17. Set Pause
  18. Save
  19. Host
  20. Command is not in the list
  21. Command does not exist

Table in Oracle cannot be created if the primary key is not specified

1.True

2.False

Alternate key may contain NULL values

1.True

2.False

Table can have several alternate keys, but only one primary key and one foreign key

1.True

2.False

Which command(s) is/are used to set a SQL*Plus report’s maximum number of liner per page

  1. Set Headsep
  2. Column
  3. Set PageSize
  4. Set Line Size
  5. Edit
  6. Define_Editor
  7. Start
  8. Remark
  9. /* */
  10. Host
  11. Ttitle
  12. Btitile
  13. @
  14. Break On
  15. Compute Sum
  16. Set NewPage
  17. Set Pause
  18. Save
  19. Host
  20. Command is not in the list
  21. Command does not exist

Child table always contains a foreign key

1.True

2.False

Which command(s) is/are used to execute a SQL*Plus script file

  1. Set Headsep
  2. Column
  3. Set PageSize
  4. Set Line Size
  5. Edit
  6. Define_Editor
  7. Start
  8. Remark
  9. /* */
  10. Host
  11. Ttitle
  12. Btitile
  13. @
  14. Break On
  15. Compute Sum
  16. Set NewPage
  17. Set Pause
  18. Save
  19. Host
  20. Command is not in the list
  21. Command does not exist

SQL*Plus’s default column wrapping option is

  1. Truncated
  2. Word_Wrapped
  3. Wrapped
  4. None

If the value 90.687 is selected from a column with the format 999,999.90, SQL*Plus will produce the following output

  1. 91
  2. 90.68
  3. 90.60
  4. 91.00
  5. 90.70
  6. 90.69

SQL*Plus measures the size of a report in

  1. Inches
  2. Centimeters
  3. Characters
  4. Rows
  5. Lines

Which SQL function removes trailing spaces?

  1. ||
  2. CONCAT
  3. INITCAP
  4. INSTR
  5. LENGTH
  6. LOWER
  7. LPAD
  8. RPAD
  9. LTRIM
  10. RTRIM
  11. SOUNDEX
  12. SUBSTR
  13. UPPER
  14. None of the above

Which class of function is addition (+)?

1.Single Value

2.Group of Values

3.List of Values

Do the following SQL statements produce the same output?

  1. Select 50.98 * 2 “AMOUNT” from dual;
  2. Select 2 * 50.98 amount from dual;
  3. Select 50.98 + 50.98 as “AMOUNT” from dual;
  4. 1.Yes
  5. No

Which class of function is LEAST?

1.Single Value

2.Group of Values

3.List of Values

Which of the expressions evaluate to 4?

  1. MOD (16, 2)
  2. SQRT (16)
  3. ROUND (4.79, 0)
  4. TRUNC (4.79, 0)
  5. POWER (16, .5)
  6. None

Which of the following SQL statements is/are valid?

  1. select kmc_movie_name as Mname from kmc_movie group by kmc_movie_name
  2. select kmc_movie_name Mname from kmc_movie order by kmc_movie_name
  3. select kmc_movie_name as Mname from kmc_movie order by 1
  4. None of the above is valid

Which SQL statement(s) return ’30-SEP-01’?

  1. select ROUND (TO_DATE (’30-SEP-01’)) from dual;
  2. select TRUNC (TO_DATE (’30-SEP-01’)) from dual;
  3. select TO_DATE (’30-SEP-01’, ‘DD-MON-YY’) from dual;
  4. select ROUND (TO_DATE (’30-SEP-2001 13:24’, ‘DD-MON-YYYY HH24:MI’)) from dual;
  5. select ROUND (TO_DATE (’30-SEP-2001 10:24’, ‘DD-MON-YYYY HH24:MI’)) from dual;
  6. None

Which SQL statement(s) return ’03:15 P.M.’?

  1. select TO_CHAR (TO_DATE (’01-OCT-01 15:15’, ‘DD-MON-YY HH24:MI’), ‘HH12:MM A.M.) from dual;
  2. select TO_CHAR (TO_DATE (’01-OCT-01 15:15’, ‘DD-MON-YY HH24:MI’), ‘HH:MI P.M.) from dual;
  3. select TO_CHAR (TO_DATE (’01-OCT-01 15:15’, ‘DD-MON-YY HH24:MI’), ‘HH12:MI pm) from dual;
  4. None

What is MOD (3, 5)?

1.5

2.2

3.3

4.0

5.Error

6.No right answer

What is SQRT ((4 + MOD (3, 6)) * 7)?

1.6

2.7

3.3

4.0

5.Error

6.No right answer

What is TRUNC (19.94, 1)?

1.19.9

2.19

3.20

4.20.0

5.Error

6.No right answer

What is the result of the following SQL query:

select DECODE (SUBSTR (‘ABC’, 3), ‘B’, ‘A’, ‘C’, NULL, ‘ABC’) from dual where ‘ABC’ like ‘AB’;

1.ABC

2.A

3.B

4.C

5.BC

6.no rows selected

7.NULL

8.Error

9.None of the above

What is SIGN (ROUND (ABS (-5.5), 3))?

1.–6

2.–1

3.5

4.0

5.Error

6.No right answer

What is LAST_DAY (ROUND (TO_DATE (’30-SEP-2001 12:00’, ‘DD-MON-YYYY HH:MI’)))?

1.30-SEP-01

2.30-AUG-01

3.30-OCT-01

4.01-OCT-01

5.Error

6.No right answer

Which of the SQL statements return a Cartesian product?

1.select kmc_movie_name from kmc_movie, kmc_movie_screening;

2.select kmc_movie_name from kmc_movie a, kmc_movie_screening b where a.kmc_movie_id = b.kmc_movie_id;

3.select kmc_movie_name from kmc_movie where kmc_movie_id in (select kmc_movie_id from kmc_movie_screening where kmc_screening_price > 5);

4.select kmc_movie_name, kmc_screening_price from kmc_movie, kmc_movie_screening;

5.None of the above

Write SQL query to create a table in your account, which contains a listing of all movies in the database with names of theater where they were shown. If the movie was not screened, its name still should appear in the table, and the theater name for that movie should contain NULL value.

create table movie_theaters as

select

kmc_movie_name,

kmc_theater_name

from

kmc_theater a,

kmc_movie_screening b,

kmc_movie c

where

a.kmc_theater_name(+) = b.kmc_theater_name

and b.kmc_movie_name(+) = c.kmc_movie_name

order by

kmc_theater_name;

Entradas relacionadas: