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
- Set Headsep
- Column
- Set PageSize
- Set Line Size
- Edit
- Define_Editor
- Start
- Remark
- /* */
- Host
- Ttitle
- Btitile
- @
- Break On
- Compute Sum
- Set NewPage
- Set Pause
- Save
- Host
- Command is not in the list
- 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
- Set Headsep
- Column
- Set PageSize
- Set Line Size
- Edit
- Define_Editor
- Start
- Remark
- /* */
- Host
- Ttitle
- Btitile
- @
- Break On
- Compute Sum
- Set NewPage
- Set Pause
- Save
- Host
- Command is not in the list
- 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
- Set Headsep
- Column
- Set PageSize
- Set Line Size
- Edit
- Define_Editor
- Start
- Remark
- /* */
- Host
- Ttitle
- Btitile
- @
- Break On
- Compute Sum
- Set NewPage
- Set Pause
- Save
- Host
- Command is not in the list
- Command does not exist
SQL*Plus’s default column wrapping option is
- Truncated
- Word_Wrapped
- Wrapped
- None
If the value 90.687 is selected from a column with the format 999,999.90, SQL*Plus will produce the following output
- 91
- 90.68
- 90.60
- 91.00
- 90.70
- 90.69
SQL*Plus measures the size of a report in
- Inches
- Centimeters
- Characters
- Rows
- Lines
Which SQL function removes trailing spaces?
- ||
- CONCAT
- INITCAP
- INSTR
- LENGTH
- LOWER
- LPAD
- RPAD
- LTRIM
- RTRIM
- SOUNDEX
- SUBSTR
- UPPER
- 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?
- Select 50.98 * 2 “AMOUNT” from dual;
- Select 2 * 50.98 amount from dual;
- Select 50.98 + 50.98 as “AMOUNT” from dual;
- 1.Yes
- 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?
- MOD (16, 2)
- SQRT (16)
- ROUND (4.79, 0)
- TRUNC (4.79, 0)
- POWER (16, .5)
- None
Which of the following SQL statements is/are valid?
- select kmc_movie_name as Mname from kmc_movie group by kmc_movie_name
- select kmc_movie_name Mname from kmc_movie order by kmc_movie_name
- select kmc_movie_name as Mname from kmc_movie order by 1
- None of the above is valid
Which SQL statement(s) return ’30-SEP-01’?
- select ROUND (TO_DATE (’30-SEP-01’)) from dual;
- select TRUNC (TO_DATE (’30-SEP-01’)) from dual;
- select TO_DATE (’30-SEP-01’, ‘DD-MON-YY’) from dual;
- select ROUND (TO_DATE (’30-SEP-2001 13:24’, ‘DD-MON-YYYY HH24:MI’)) from dual;
- select ROUND (TO_DATE (’30-SEP-2001 10:24’, ‘DD-MON-YYYY HH24:MI’)) from dual;
- None
Which SQL statement(s) return ’03:15 P.M.’?
- select TO_CHAR (TO_DATE (’01-OCT-01 15:15’, ‘DD-MON-YY HH24:MI’), ‘HH12:MM A.M.) from dual;
- select TO_CHAR (TO_DATE (’01-OCT-01 15:15’, ‘DD-MON-YY HH24:MI’), ‘HH:MI P.M.) from dual;
- select TO_CHAR (TO_DATE (’01-OCT-01 15:15’, ‘DD-MON-YY HH24:MI’), ‘HH12:MI pm) from dual;
- 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;