Mylaisa McMullen
Quiz von , erstellt am more than 1 year ago

List the capabilities of SQL SELECT statements Execute a basic SELECT statement

239
0
0
Mylaisa McMullen
Erstellt von Mylaisa McMullen vor fast 7 Jahre
Schließen

Retrieving Data Using the SQL SELECT Statement

Frage 1 von 25

1

Identify the capabilities of SELECT statement.

Wähle eine oder mehr der folgenden:

  • Projection

  • Selection

  • Data Control

  • Transaction

Erklärung

Frage 2 von 25

1

Determine the capability of the SELECT statement demonstrated in the given query.

SELECT e.ename, d.dname
FROM emp e, dept d
WHERE e.deptno = d.deptno
AND e.sal > 1000;

Wähle eine oder mehr der folgenden:

  • Selection

  • Filtering

  • Joining

  • Projection

Erklärung

Frage 3 von 25

1

Which of the following clause is used to suppress duplicates in a SELECT statement?

Wähle eine oder mehr der folgenden:

  • INTERSECT

  • DUPLICATE

  • DISTINCT

  • UNIQUE

Erklärung

Frage 4 von 25

1

Chose the statements which correctly specify a rule to write a SQL statement

Wähle eine der folgenden:

  • SQL statements are case sensitive

  • Keywords can be abbreviated to build a standard

  • SQL statements are case in-sensitive

  • clauses must be placed together

Erklärung

Frage 5 von 25

1

Determine the output of the below query

SELECT '5+7'
FROM dual;

Wähle eine der folgenden:

  • 12

  • 5+7

  • 5

  • 7

Erklärung

Frage 6 von 25

1

Write a query to display employee details (Name, Department, Salary and Job) from EMP table

Wähle eine der folgenden:

  • SELECT ename, deptno, sal, job FROM emp;

  • SELECT * FROM emp;

  • SELECT DISTINCT ename, deptno, sal, job FROM emp;

  • SELECT ename, deptno, sal FROM emp;

Erklärung

Frage 7 von 25

1

Which of the below queries displays employees' name and new salary after the increment of 1000?

Wähle eine der folgenden:

  • SELECT ename, sal FROM emp;

  • SELECT ename, sal=sal+1000 FROM emp;

  • SELECT ename, sal+1000 FROM emp;

  • SELECT ename, 1000 FROM emp;

Erklärung

Frage 8 von 25

1

Determine the output of the below query

SELECT 36/2-5*10 FROM dual;

Wähle eine der folgenden:

  • 130

  • -32

  • -120

  • 175

Erklärung

Frage 9 von 25

1

Determine the output of the below query

SELECT (100-25)/15*(20-3) FROM dual;

Wähle eine der folgenden:

  • 0.294

  • -85

  • 63.67

  • 85

Erklärung

Frage 10 von 25

1

Chose the statements which correctly define a NULL value.

Wähle eine oder mehr der folgenden:

  • NULL is a special value with zero bytes

  • NULL is no value or unknown value

  • NULL is represented by a blank space

  • NULL is not same as zero

Erklärung

Frage 11 von 25

1

Determine the output of the below query

SELECT sal + NULL
FROM emp
WHERE empno = 7369;

Wähle eine der folgenden:

  • sal + NULL

  • NULL

  • 0

  • 1250

Erklärung

Frage 12 von 25

1

Which of the below statements define column alias correctly?

Wähle eine oder mehr der folgenden:

  • A column alias renames a column heading

  • A column alias is an alternate column in a table

  • A column alias can be specified during table definition

  • A column alias immediately follows the column or expression in the SELECT statement

Erklärung

Frage 13 von 25

1

Specify the column alias NEWSAL for the expression containing salary in the below SQL query

SELECT ename, job, sal + 100 FROM emp;

Wähle eine oder mehr der folgenden:

  • (sal + 100) AS NEWSAL

  • (sal + 100) NEWSAL

  • (sal + 100) IS NEWSAL

  • sal + 100 IS NEWSAL

Erklärung

Frage 14 von 25

1

Specify the column alias "New Salary" for the expression containing salary in the below SQL query

SELECT ename, job, sal + 100 FROM emp;

Wähle eine oder mehr der folgenden:

  • (sal + 100) AS New Salary

  • (sal + 100) "New Salary"

  • (sal + 100) IS New Salary
    .

  • sal + 100 as "New Salary"

Erklärung

Frage 15 von 25

1

Which command is used to display the structure of a table?

Wähle eine der folgenden:

  • LIST

  • SHOW

  • DESCRIBE

  • STRUCTURE

Erklärung

Frage 16 von 25

1

Predict the output when below statement is executed in SQL* Plus?

DESC emp

Wähle eine der folgenden:

  • Raises error "SP2-0042: unknown command "desc emp" - rest of line ignored."

  • Lists the columns of EMP table

  • Lists the EMP table columns, their data type and nullity

  • Lists the columns of EMP table along with their data types

Erklärung

Frage 17 von 25

1

Which of the below statements are true about the DESCRIBE command?

Wähle eine der folgenden:

  • It can be used in SQL*Plus only

  • It can be used in both SQL*Plus as well as SQL Developer

  • It doesn't works for object tables

  • It doesn't works for SYS owned tables

Erklärung

Frage 18 von 25

1

Which of the below alphanumeric characters are used to signify concatenation operator in SQL?

Wähle eine der folgenden:

  • +

  • ||

  • -

  • ::

Erklärung

Frage 19 von 25

1

Which of the below statements are correct about the usage of concatenation operator in SQL?

Wähle eine oder mehr der folgenden:

  • It creates a virtual column in the table

  • It generates a character expression as the result of concatenation of one or more strings

  • It creates a link between two character columns

  • It can be used to concatenate date expressions with other column

Erklärung

Frage 20 von 25

1

Predict the output of the below query

SELECT ename || NULL
FROM emp
WHERE empno = 7369

Wähle eine der folgenden:

  • SMITH

  • SMITH NULL

  • SMITHNULL

  • ORA-00904: "NULL": invalid identifier

Erklärung

Frage 21 von 25

1

Predict the output of the below query

SELECT 50 || 0001
FROM dual

Wähle eine der folgenden:

  • 500001

  • 51

  • 501

  • 5001

Erklärung

Frage 22 von 25

1

You execute the below query

SELECT e.ename||' departments's name is:'|| d.dname
FROM emp e, dept d
where e.deptno=d.deptno;

And get the exception - ORA-01756: quoted string not properly terminated. Which of the following solutions can permanently resolve the problem?

Wähle eine der folgenden:

  • Use double quote marks for the literal character string

  • Use [q] operator to enquote the literal character string and selecting the delimiter of choice

  • Remove the single quote mark (apostrophe) from the literal character string

  • Use another delimiter to bypass the single quote apostrophe in the literal string

Erklärung

Frage 23 von 25

1

Which of the below SELECT statement shows the correct usage of [q] operator?

Wähle eine der folgenden:

  • SELECT e.ename || q'[department's name is]'|| d.dname
    FROM emp e, dept d
    WHERE e.deptno = d.deptno;

  • SELECT e.ename || q['department's name is']|| d.dname
    FROM emp e, dept d
    WHERE e.deptno = d.deptno;

  • SELECT e.ename || q[department's name is]|| d.dname
    FROM emp e, dept d
    WHERE e.deptno = d.deptno;

  • SELECT e.ename || q'(department's name is)'|| d.dname
    FROM emp e, dept d
    WHERE e.deptno = d.deptno;

Erklärung

Frage 24 von 25

1

Which of the below SELECT statement is used to select all columns of EMP table?

Wähle eine der folgenden:

  • SELECT ALL FROM emp

  • SELECT # FROM emp

  • SELECT * FROM emp

  • ELECT empno,ename,deptno,sal,job,mgr,hiredate FROM emp

Erklärung

Frage 25 von 25

1

Which of the below SQL query will display employee names, department, and annual salary?

Wähle eine der folgenden:

  • SELECT ename, deptno, sal FROM emp;

  • SELECT ename, deptno, sal + comm FROM emp;

  • SELECT ename, deptno, (sal * 12) Annual_Sal FROM emp;

  • Annual salary cannot be queried since the column doesn't exists in the table

Erklärung