Which two statements are true about the DUAL table? (Choose two.)
Which two statements are true about the DUAL table? (Choose two.)
The DUAL table in Oracle is a small table used primarily for selecting a constant or evaluating expressions that do not require data from any table. It consists of a single row and a single column named DUMMY that is of VARCHAR2 data type. Any user who has the SELECT privilege in any schema can access the DUAL table. It is designed to be accessible to all users, not just the SYS user, which allows performing various computations easily without requiring access to actual data tables.
B and F are correct answers. F is correct : SQL> SELECT level, sysdate 2 FROM dual 3 CONNECT BY 4 level <= 4; LEVEL SYSDATE ---------- --------- 1 06-AUG-20 2 06-AUG-20 3 06-AUG-20 4 06-AUG-20 It can return multple rows and columns. D is wrong, you just create a brand new user and do not grant any privilege but still it can select dual table.
Thank you, I got to F by exclusion but I was having some trouble finding a good example of a case in which it returned multiple rows.
F is incorrect because Dual has only one column. Here in your example what you are doing is a projection of multiple column through select statement which can be done in any table even though the table has limited number of columns.
B,E seems to be more correct options.
B E https://docs.oracle.com/cd/B19306_01/server.102/b14200/queries009.htm
E seems wrong, i would choose A and D
sorry i mean, B & D
D is incorrect "Alternatively, you can select a constant, pseudocolumn, or ***expression*** from any table"
well, then B, F seems fine
BD are the correct answers. https://stackoverflow.com/questions/50212079/is-it-possible-to-have-multiple-rows-with-select-from-dual
SQL> create user c##test identified by test ; User created. SQL> grant connect to c##test ; Grant succeeded. SQL> conn c##test/test Connected. SQL> SELECT level, sysdate FROM dual CONNECT BY level <= 4; LEVEL SYSDATE ---------- --------- 1 24-MAR-24 2 24-MAR-24 3 24-MAR-24 4 24-MAR-24 BF
B,E IS CORRECT
I THINK EF
B , F are correct.
B,F is correct
B is correct as you guys explained here. And the other one should be E. E. It can be accessed by any user who has the select privilege in any schema. Any schema owner can select data from its own tables. so that argument is valid here.
A - false; DUAL is a table automatically created by Oracle Database along with the data dictionary. DUAL is in the schema of the user SYS but is accessible by the name DUAL to all users. Source: Oracle documentation - Oracle Database, Release 19, SQL Language Reference, 9 SQL Queries and Subqueries, Selecting from the DUAL Table B - true; single column DUMMY with datatype VARCHAR2(1) and value 'X' C - false; query SELECT sysdate, sysdate FROM dual; D - false; Alternatively, you can select a constant, pseudocolumn, or expression from any table, but the value will be returned as many times as there are rows in the table. Source: same as mentioned in answer A E - false; GRANT SELECT any table is not necessary to query DUAL table. Newly created user is not granted with any SELECT privilege, however he/she can query any own object and table DUAL. F - true; example SELECT with multiple row and column output is SELECT sysdate,sysdate+1 FROM dual CONNECT BY LEVEL <= 5;
If I run desc dual; Name Null Type ----- ---- ----------- DUMMY VARCHAR2(1)
So answer is B E
The correct answer is A,B. the dual table has only one row, it is accessed with the user sys and the column is of type varchar2 .
BE for me
DUAL is a table automatically created by Oracle Database along with the data dictionary. DUAL is in the schema of the user SYS but is accessible by the name DUAL to all users. It has one column, DUMMY, defined to be VARCHAR2(1), and contains one row with a value X. Selecting from the DUAL table is useful for computing a constant expression with the SELECT statement. Because DUAL has only one row, the constant is returned only once. Alternatively, you can select a constant, pseudocolumn, or expression from any table, but the value will be returned as many times as there are rows in the table.
A. It can be accessed only by the SYS user --> False, anybody can select from dual. B. It consists of a single row and single column of VARCHAR2 data type. --> True C. It can display multiple rows but only a single column. --> False, only 1 single row and column (by default: select * from dual) D. It can be used to display only constants or pseudo columns. --> False, Expression too. E. It can be accessed by any user who has the SELECT privilege in any schema. --> True F. It can display multiple rows and columns. False, 1 row/column only.
Answers should be BE
I correct myself B and F are correct because when you give the create session to any user, he is capable to select the dual table without give that exactly permission.
B and E are 100% correct. "DUAL is a table automatically created by Oracle Database along with the data dictionary. DUAL is in the schema of the user SYS but is accessible by the name DUAL to all users. It has one column, DUMMY, defined to be VARCHAR2(1), and contains one row with a value X." https://docs.oracle.com/database/121/SQLRF/queries009.htm#SQLRF20036
B and E are 100% correct. "DUAL is a table automatically created by Oracle Database along with the data dictionary. DUAL is in the schema of the user SYS but is accessible by the name DUAL to all users. It has one column, DUMMY, defined to be VARCHAR2(1), and contains one row with a value X." https://docs.oracle.com/database/121/SQLRF/queries009.htm#SQLRF20036