Database Iitu Quiz

150 Questions | Attempts: 609
Share

SettingsSettingsSettings
Database Iitu Quiz - Quiz

.


Questions and Answers
  • 1. 

    You can not order the results of a set operation

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 2. 

    Which symbol is used to create a substitution variable

    • A.

      &

    • B.

      -

    • C.

      %

    • D.

      *

    Correct Answer
    A. &
  • 3. 

    Which of the following SQL statements will generate an error?

    • A.

      SELECT last_name Name FROM employees WHERE Name like ‘K%’

    • B.

      SELECT department_id Dep, COUNT(last_name) FROM employees GROUP BY dep

    • C.

      SELECT department_id Dep, COUNT(last_name) Num FROM employees GROUP BY department_id HAVING Num>5

    • D.

      SELECT last_name Name FROM employees ORDER BY Name

    Correct Answer
    D. SELECT last_name Name FROM employees ORDER BY Name
  • 4. 

    A table can be created with or without data.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 5. 

    Delete the zip codes 02199 and 43011 from the ZIPCODE table. Make the change permanent.

    • A.

      DELETE FROM zipcode WHERE zip ANY (‘02199’,’43011’) COMMIT

    • B.

      DELETE FROM zipcode WHERE zip ALL (‘02199’,’43011’) COMMIT

    • C.

      DELETE FROM zipcode WHERE zip IN (‘02199’,’43011’) COMMIT

    • D.

      DELETE FROM zipcode WHERE zip ANY (‘02199’,’43011’)

    Correct Answer
    C. DELETE FROM zipcode WHERE zip IN (‘02199’,’43011’) COMMIT
  • 6. 

    Write SQL statement for display the names of the employees who are working in the company for the past 5 years:

    • A.

      Select ename from emp where hiredate < add_month(sysdate,-60);

    • B.

      Select ename from emp where hiredate < add_month(sysdate,+5);

    • C.

      Select ename from emp where hiredate < add_month(sysdate,+60);

    • D.

      Select ename from emp where hiredate < add_month(sysdate,-5);

    Correct Answer
    A. Select ename from emp where hiredate < add_month(sysdate,-60);
  • 7. 

    Transaction control determines when data manipulation becomes permanent in a database. 

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 8. 

    Consider the following SQL statement. What will be the result? SELECT e.last_name, e.salary, d.department_name FROM employees e, departments d WHERE e.department_id = d.department_id

    • A.

      An error will occur since none of the JOIN operations is used

    • B.

      The Cartesian product of the two tables based on the department_id column will be displayed

    • C.

      The last names of the employees and their salaries will be displayed along with the departments names where the employees work

    • D.

      An error will occur since in the SELECT clause a column thet is used to join the tables is missing

    Correct Answer
    C. The last names of the employees and their salaries will be displayed along with the departments names where the employees work
  • 9. 

    Which of the following statements about aliases is NOT true?

    • A.

      The keyboard AS between an alias and a column name is optional

    • B.

      Aliases always require double quotation marks

    • C.

      Aliases immediately follows the column name

    • D.

      Aliases rename column heading

    Correct Answer
    A. The keyboard AS between an alias and a column name is optional
  • 10. 

    Consider the EMPLOYEES table. Which condition in the WHERE clause limit the employees to those whose salary is greater than 5000 but less than 18000?

    • A.

      WHERE salary > 5000 OR salary < 18000

    • B.

      WHERE salary < 5000 AND salary > 18000

    • C.

      WHERE salary > 5000 AND salary < 18000

    • D.

      WHERE salary >5000 AND salary > 18000

    Correct Answer
    C. WHERE salary > 5000 AND salary < 18000
  • 11. 

    Consider the SQL statement. Which of the following clauses does not sort the result rows by the salary values in the ascending order? SELECT last_name “Employee”, salary “Salary” FROM employees

    • A.

      ORDER BY salary;

    • B.

      ORDER BY 2

    • C.

      ORDER BY “Salary” ASC;

    • D.

      ORDER BY “Salary” DESC;

    Correct Answer
    A. ORDER BY salary;
  • 12. 

    Which of the following clauses is used to limit the rows that are retrieved by the query?

    • A.

      WHERE

    • B.

      ORDER BY

    • C.

      FROM

    • D.

      GROUP BY

    Correct Answer
    A. WHERE
  • 13. 

    Which of the following functions is not single-row function?

    • A.

      CONCAT

    • B.

      SUM

    • C.

      UPPER

    • D.

      ROUND

    Correct Answer
    B. SUM
  • 14. 

    Consider the EMPLOYEES table. Which of the following statements count the number of employees within each department? 

    • A.

      SELECT department_id, COUNT(last_name) FROM employees GROUP BY department_id

    • B.

      SELECT department_name, COUNT(last_name) FROM employees GROUP BY department_id

    • C.

      SELECT department_id, department_name, COUNT(last_name) FROM employees GROUP BY department_id

    • D.

      SELECT department_id, COUNT(last_name) FROM departments GROUP_BY last_name

    Correct Answer
    A. SELECT department_id, COUNT(last_name) FROM employees GROUP BY department_id
  • 15. 

    You can rename a table with the RENAME or the ALTER TABLE command.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 16. 

    Consider the EMPLOYEES table. Which of the following conditions in the WHERE clause will generate an error?

    • A.

      SELECT * FROM employees WHERE last_name=’&Name’

    • B.

      SELECT job_id, SUM(salary) FROM employees GROUP BY ‘&Column’

    • C.

      SELECT * FROM &Table

    • D.

      SELECT &Column FROM employees

    Correct Answer
    B. SELECT job_id, SUM(salary) FROM employees GROUP BY ‘&Column’
  • 17. 

    Write SQL statement for display the department numbers with more than employees in each dept. 

    • A.

      Select deptno, count(deptno) from emp group by deptno having count(*)>3;

    • B.

      Select deptno, count (deptno) from emp group by deptno having count(*)>2;

    • C.

      Select deptno, count (emp) from deptno group by emp having count(*)>2;

    • D.

      Select deptno, count(deptno) from deptno group by emp having count(*)>3;

    Correct Answer
    A. Select deptno, count(deptno) from emp group by deptno having count(*)>3;
  • 18. 

    Queries containing set operators are called ______ . 

    • A.

      Compound queries

    • B.

      Subqueries

    • C.

      Inner queries

    • D.

      Outer queries

    Correct Answer
    A. Compound queries
  • 19. 

    You cannot drop a user if objects exist in the user’s schema.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 20. 

    Queries that return more than one row from the inner SELECT statement are called

    • A.

      Multiple-row subqueries

    • B.

      Multiple-column subqueries

    • C.

      Sing-column subqueries

    • D.

      Single-row subqueries

    Correct Answer
    A. Multiple-row subqueries
  • 21. 

    Use the _______ operator to return all rows from multiple tables and eliminate any duplicate rows.

    • A.

      UNION ALL

    • B.

      MINUS

    • C.

      INTERSECT

    • D.

      UNION

    Correct Answer
    D. UNION
  • 22. 

    ______ clause can be used and is required in the subquery to perform Top-N analysis.

    • A.

      HAVING

    • B.

      ORDER BY

    • C.

      GROUP BY

    • D.

      WHERE

    Correct Answer
    B. ORDER BY
  • 23. 

    You can add to and drop columns from a table using the ALTER TABLE command.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 24. 

    Which statement discards all pending data changes

    • A.

      SAVEPOINT

    • B.

      ROLLBACK

    • C.

      COMMIT

    • D.

      DISCARD

    Correct Answer
    A. SAVEPOINT
  • 25. 

    To obtain a last names thet student and instructors share, you use the mINUS set operator.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 26. 

    If there are schemas named USERA and USERB, and both have an EMPLOYEES table, then if USERA wants to access the EMPLOYEES table that belongs to USERB, USERA must write select statement as follows:

    • A.

      SELECT * FROM userb.employees;

    • B.

      SELECT * FROM employees;

    • C.

      SELECT * FROM usera.employees;

    • D.

      SELECT * FROM employees.userb;

    Correct Answer
    A. SELECT * FROM userb.employees;
  • 27. 

    A SELECT statement that is embedded in a clause of another SELECT statement  is called 

    • A.

      Main query

    • B.

      Subquery

    • C.

      Inner query

    • D.

      Outer query

    Correct Answer
    B. Subquery
  • 28. 

    Privileges, roles, and synonyms are all used to implement security in an Oracle Database.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 29. 

    The ____ operator returns all rows that are selected by either query

    • A.

      UNION ALL

    • B.

      INTERSECT

    • C.

      UNION

    • D.

      MINUS

    Correct Answer
    A. UNION ALL
  • 30. 

    A table can be created with or without data

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 31. 

    What will be the result of the following SQL statement?SELECT SUBSTR (‘Hello,World!!!’,13) FROM DUAL

    • A.

      An error will occur, since SUBSTR function need to take 3 parameters

    • B.

      Hello,World!!!13

    • C.

      !!!

    • D.

      Hello, World!

    Correct Answer
    C. !!!
  • 32. 

    Consider the EMPLOYEES table. When condition in the WHERE clause limit the employees to IT Programmers with salary greater than 5000?

    • A.

      WHERE salary>5000 AND job_id = ‘IT_PROG’

    • B.

      WHERE salary>5000 AND job_id = “IT_PROG”

    • C.

      WHERE salary>5000 AND job_id = IT_PROG

    • D.

      WHERE salary>5000 OR job_id = ‘IT_PROG’

    Correct Answer
    A. WHERE salary>5000 AND job_id = ‘IT_PROG’
  • 33. 

    The NUMBER data types is usually the best choice for a primary key.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 34. 

    When using LIKE condition which symbol is used to denote one character?

    • A.

      -

    • B.

      +

    • C.

      %

    • D.

      *

    Correct Answer
    A. -
  • 35. 

    Consider the EMPLOYEES table. Which condition in the WHERE clause limit the employees to those whose last name and first name starts with the letter ‘K’?

    • A.

      WHERE last_name = ‘K%’ and first_name = ‘K%’

    • B.

      WHERE last_name LIKE ‘K_’ and first_name LIKE ‘K_’

    • C.

      WHERE last_name LIKE ‘K%’ and first_name LIKE ‘K%’

    • D.

      WHERE last_name and first_name = ‘K%’

    Correct Answer
    C. WHERE last_name LIKE ‘K%’ and first_name LIKE ‘K%’
  • 36. 

    Which is right of the following clauses?

    • A.

      SELECT… WHERE … ORDER BY … GROUP BY

    • B.

      SELECT … FROM … GROUP BY … ORDER BY … WHERE

    • C.

      SELECT…FROM…WHERE…GROUP BY…ORDER BY

    • D.

      SELECT … FROM … WHERE … ORDER BY … GROUP BY

    Correct Answer
    C. SELECT…FROM…WHERE…GROUP BY…ORDER BY
  • 37. 

    Write SQL statement for increase salary of all managers by 10%

    • A.

      Update emp set sal=sal*1.1 where empno in (select mgr from emo);

    • B.

      Update emp set sal=sal*1.1 where empno in (select emp from emo);

    • C.

      Update emp set sal=sal*0.1 where empno in (select emp from emo);

    • D.

      Update emp set sal=sal*0.1 where empno in (select mgr from emo);

    Correct Answer
    A. Update emp set sal=sal*1.1 where empno in (select mgr from emo);
  • 38. 

    Both object and system privileges can be granted through a single role to a user.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 39. 

    What will be the result of the following query?SELECT ROUND (63.548, -1) FROM DUAL;

    • A.

      64

    • B.

      60

    • C.

      63

    • D.

      70

    Correct Answer
    B. 60
  • 40. 

    DML statement such as INSERT, UPDATE, DELETE, and MERGE obtain a lock on the row(s), so other users cannot manipulate it.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 41. 

    The UNION and UNION ALL set operator have the opposite effect other. 

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 42. 

    A DISTINCT must always be user in the top-most SELECT statement of a set operation

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 43. 

    A subquery must be enclosed in _________ .

    • A.

      Double quotes

    • B.

      Single quotes

    • C.

      Parantheses

    • D.

      Braces

    Correct Answer
    C. Parantheses
  • 44. 

    Which of the following is a concatenation operator?

    • A.

      &

    • B.

      &

    • C.

      ||

    • D.

      *

    Correct Answer
    C. ||
  • 45. 

    The subquery generally executes ______ , and its output is used to complete the query condition for the main (or ____ ) query.

    • A.

      First, outer

    • B.

      Last, outer

    • C.

      Last, inner

    • D.

      First, inner

    Correct Answer
    A. First, outer
  • 46. 

    The TRANCATE command and the TRUNC function can be used interchangeably.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 47. 

    Transaction control determines when data manipulates becomes permanent in a database.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 48. 

    Any user can grant or revoke any type of system privilege to or from another user

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 49. 

    You can add and drop columns from a table using the ALTER TABLE command.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 50. 

    The data dictionary view USER_TAB_PRIVS_MADE lists details of table privilege grants performed by the current user.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Dec 14, 2017
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 14, 2017
    Quiz Created by
    Daniyar

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.