Quiz
ORACLE
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (176)
1 What kind of objects Generates numeric values?
- A• Table
- B• Index
- C• Synonym
- D• Sequence
2 What kind of objects Logically represents subsets of data from one or more tables?
- A• Table
- B• Synonym
- C• View
- D• Index
3What the operator UNION returns?
- A• Rows from both queries after eliminating duplications.
- B• Rows from both queries, including all duplications.
- C• Rows that are common to both queries.
- D• All the distinct rows selected by the first query, but not present in the second query result set.
4What the INTERSECT operator returns?
- A• Rows from both queries after eliminating duplications.
- B• Rows from both queries, including all duplications.
- C• Rows that are common to both queries.
- D• All the distinct rows selected by the first query, but not present in the second query result set.
5What the MINUS operator returns?
- A• Rows from both queries after eliminating duplications.
- B• Rows from both queries, including all duplications.
- C• Rows that are common to both queries.
- D• All the distinct rows selected by the first query, but not present in the second query result set.
6How the subquery executes?
- A• The subquery (inner query) executes after the main query (outer query).
- B• The subquery (inner query) executes before the main query (outer query).
- C• The subquery (inner query) executes together with the main query (outer query).
- D• The subquery (inner query) executes by priority to the main query (outer query).
7What type of subquery Oracle DBMS does not exist?
- A• Single-row
- B• Long-row
- C• Multiple-row
- D• All answers is incorrect
8What of the JOIN clauses do not exist at PL/SQL?
- A• Self join
- B• Natural join
- C• Cross join
- D• Middle join
9What kind of join includes into OUTER JOIN?
- A• Cross join
- B• Full join
- C• Inner join
- D• Natural join
10The clause which produces the cross-product or Cartesian product of two tables?
- A• Inner join
- B• Outer join
- C• Cross join
- D• Natural join
11What command included to DML?
- A• Create
- B• Insert
- C• Commit
- D• Grant
12What command of DML could replace the Update or Insert?
- A• Alter
- B• Truncate
- C• Merge
- D• Commit
13What command would be appropriate, if we need to Modify rows of any tables?
- A• Update
- B• Alter
- C• Create
- D• Insert
14Which command uses to erase whole data from table?
- A• Drop
- B• Revoke
- C• Truncate
- D• Rollback
15Which command restores the database to last commited state?
- A• Savepoint
- B• Commit
- C• Rollback
- D• Back up
16What kind of the group function uses to compute total number of rows?
- A• AVG
- B• SUM
- C• COUNT
- D• MAX
17How many rows this command will retrieve? SELECT MIN(hire_date) FROM employees;
- A0
- B1
- C2
- D3
18What clause uses to show group function for several departments? SELECT department_id, COUNT(last_name) FROM employees;
- A• HAVING
- B• ORDER BY
- C• USING
- D• GROUP BY
19When you do not use the HAVING clause?
- A• Rows are grouped
- B• Groups matching the HAVING clause are displayed
- C• Rows are sorted
- D• The group function is applied
20What function uses to convert any type of data to Characters?
- A• TO_DATE
- B• TO_VARCHAR2
- C• TO_NUMBER
- D• TO_CHAR
21How to show Full name of the month of any DATE type rows?
- A• MM
- B• MONTH
- C• MON
- D• MI
22Which one is the Conditional Expression which Provide the use of the IF-THEN-ELSE logic?
- A• CASE
- B• CONCAT
- C• COALESCE
- D• SUBSTRING
23What functions work with any data type and pertain to the use of Null values in the expression list?
- A• CASE, DECODE
- B• TO_CHAR, TO_DATE
- C• NVL, NULLIF, COUNT
- D• COALESCE, NVL, NVL2
24Where we do not use the Single-row functions?
- A• SELECT
- B• GROUP BY
- C• WHERE
- D• ORDER BY
25What function does not exists the Case-conversion functions?
- A• LENGTH
- B• LOWER
- C• UPPER
- D• INITCAP
26What function Character-manipulation functions exists?
- A• LOWER
- B• CONCAT
- C• COUNT
- D• NVL
27What the result of using function? INITCAP('SQL Course')
- A• SQL COURSE
- B• sql course
- C• Sql Course
- D• Sql course
28Which function Finds the Numeric position of a named character?
- A• LENGTH
- B• LPAD
- C• SUBSTR
- D• INSTR
29Column Headings Defaults at SQL*PLUS terminal have to be:
- A• Default heading alignment: Left-aligned
- B• Default heading display: Uppercase
- C• Number column headings are Left-aligned
- D• Character and Date column headings are Right-aligned
30Which syntax of basic select statement is correct:
- A• Select * |{[Distinct] column|expression,...} From table;
- B• Select *|{column|expression} From table;
- C• Select *|{[Distinct] column|expression [alias],…} From table Where condition(s);
- D• Select *|{[Distinct] column|expression [alias],...} From table;
31Which Writing SQL Statements rules is correct?
- A• SQL statements can be entered on one or more lines.
- B• SQL statements should be entered on one lines.
- C• Clauses must placed on separate lines.
- D• SQL statements must be entered on separate lines.
32What kind of Arithmetic Expressions uses with Date type:
- A• / - divide
- B• - minus
- C• % - percent
- D• multiply
33How to denotes one character at LIKE condition (WHERE Clause)?
- A• % - percent
- B• = - equal
- C• & - ampersand
- D• _ - underscore
34How many Logical Operators do the Oracle DBMS have?
- A1
- B2
- C3
- D4
35What Order by clause for “SELECT employee_id, last_name, salary*12 annsal FROM employees” is incorrect?
- A• ORDER BY 3 desc;
- B• ORDER BY annsal;
- C• ORDER BY id desc;
- D• ORDER BY last_name;
36What kind of signs uses to retrieve Substitution Variable Forms?
- A• <>, !=
- B• +, -, *, /
- C• %, _
- D• &&, &
37DEFINE command uses for:
- A• Command to remove a values from table.
- B• Command to remove a variable.
- C• Command to create a value to table.
- D• Command to create and assign a value to a variable
38Indexes must be created manually and serve to speed up access to rows in a table?
- A• True
- B• False
- C• Not sure
- D• Indexes do not serve to speed up access to rows
39You can Not to use constraints to do the following?
- A• Prevent the creation of data in a table.
- B• Prevent the creation of a table.
- C• Enforce rules on the data in a table whenever a row is inserted, updated, or deleted.
40Identify the SELECT statements that execute successfully:
- A• SELECT first_name, last_name, job_id, salary AS yearly sal FROM employees;
- B• SELECT first_name, last_name, job_id, salary*12 AS Yearly_Sal FROM employees;
- C• SELECT first_name+last_name AS name, job_Id, salary*12 yearly sal FROM employees;
- D• SELECT first_name, last_name, job_id, salary AS ‘yearly_sal’ FROM employees;
41From what kind of system table we can retrieve NEXTVAL and CURRVAL
- A• Data
- B• System
- C• Dual (?)
- D• Store
42How called the Nickname for columns?
- A• Synonym
- B• Alias
- C• Macros
- D• Byname
43. By which command we can connect to Oracle DB at Terminals?
- A• Sqlplus / sysdba
- B• PLSQL as system@oracle
- C• Sqlplus hr@oracle
- D• PLSQL hr@oracle
44What kind of constraints included into PRIMARY KEY?
- A• NVL
- B• Nullif
- C• Check
- D• Unique
45Table names and column names choose Incorrect point?
- A• Must be an Oracle server–reserved word
- B• Must be 1–30 characters long
- C• Must begin with a letter
- D• Must contain only A–Z, a–z, 0–9, _, $, and #
46Which one alias is Incorrect?
- A• Select job_id as id from jobs;
- B• Select job_id ‘id’ from jobs;
- C• Select job_id id from jobs;
- D• Select job_id “id” from jobs;
47What object Gives alternative names to objects?
- A• Table
- B• Synonym
- C• View
- D• Index
48What object Improves the performance of some queries?
- A• Table
- B• Synonym
- C• View
- D• Index
49How to erase any Schema objects?
- A• Delete
- B• Drop(?)
- C• Truncate
- D• Destroy
50What object have NEXTVAL and CURRVAL Pseudocolumns?
- A• Table
- B• Synonym
- C• Sequences
- D• Index
51What constraint Defines the column in the child table at the table-constraint level?
- A• FOREIGN KEY
- B• UNIQUE
- C• NOT NULL
- D• PRIMARY KEY
52What data type have Fixed-length character data?
- A• VARCHAR2(size)
- B• CHAR(size)
- C• VARCHAR(size)
- D• RAW and LONG RAW
53What data type have Variable-length character data?
- A• VARCHAR2(size)
- B• CHAR(size)
- C• VARCHAR(size)
- D• RAW and LONG RAW
54What data type have Variable-length numeric data?
- A• INT(p)
- B• BIGINT(p)
- C• NUMBER(p,s)
- D• LONG
55What data type have Date and time values?
- A• TIME
- B• DATE
- C• CLOB
- D• BLOB
56What kind of the group function uses to compute average number in rows?
- A• AVG
- B• SUM
- C• COUNT
- D• MAX
57How many rows this command will retrieve? SELECT MAX(hire_date) FROM employees;
- A0
- B1
- C2
- D3
58What clause uses to show group function for several departments? SELECT department_id, MAX(salary) FROM employees;
- A• HAVING
- B• ORDER BY
- C• USING
- D• GROUP BY
59When you do not use the HAVING clause?
- A• Rows are grouped
- B• Groups matching the HAVING clause are displayed
- C• Rows are sorted
- D• The group function is applied
60Where we do not use the Single-row functions?
- A• SELECT
- B• GROUP BY
- C• WHERE
- D• ORDER BY
61What function does not exists the Case-conversion functions?
- A• INSTR
- B• LOWER
- C• UPPER
- D• INITCAP
62What function Character-manipulation functions exists?
- A• LOWER
- B• SUBSTR
- C• COUNT
- D• NVL
63What Order by clause for “SELECT employee_id, last_name, salary*12 annsal FROM employees” is incorrect?
- A• ORDER BY 3 desc;
- B• ORDER BY annsal;
- C• ORDER BY employee_id desc;
- D• ORDER BY name;
64What kind of signs uses to show non equal values?
- A• <>, !=
- B• +, -, *, /
- C• &&, &
- D• %, _
65What kind of signs uses to compute arithmetic operations?
- A• <>, !=
- B• +, -, *, /
- C• %, _
- D• &&, &
66What kind of constraints included into PRIMARY KEY?
- A• NVL
- B• Nullif
- C• Check
- D• Not null
67Table names and column names choose Incorrect point?
- A• Must not be an Oracle server–reserved word
- B• Must be 1–30 characters long
- C• Must begin with a number
- D• Must contain only A–Z, a–z, 0–9, _, $, and #
68Which one alias is Incorrect?
- A• Select job_id as id from jobs;
- B• Select job_id as ‘id’ from jobs;
- C• Select job_id as ID from jobs;
- D• Select job_id as “id” from jobs;
69Column Headings Defaults at SQL*PLUS terminal have to be:
- A• Default heading alignment: Left-aligned
- B• Default heading display: Lowercase
- C• Number column headings are Right-aligned.
- D• Character and Date column headings are Right-aligned
70 Which syntax of basic select statement is correct:
- A• Select * |{[Distinct] column|expression,...} From table;
- B• Select *|{column|expression} From table;
- C• Select *|{[Distinct] column|expression [alias],...} From table;
- D• Select *|{[Distinct] column|expression [alias],…} From table Where condition(s);
71Which Writing SQL Statements rules is correct?
- A• SQL statements can not to be entered on one or more lines.
- B• SQL statements should be entered on one lines.
- C• Clauses usually placed on separate lines.
- D• SQL statements must be entered on separate lines.
72What kind of Arithmetic Expressions uses with Date type:
- A• / - divide
- B• + - add
- C• % - percent
- D• multiply
73How to denotes one or more character at LIKE condition (WHERE Clause)?
- A• % - percent
- B• = - equal
- C• & - ampersand
- D• _ - underscore
74. How many Arithmetic Operators do the Oracle DBMS have?
- A1
- B2
- C3
- D4
75 What kind of signs uses to skip characters at LIKE function?
- A• <>, !=
- B• +, -, *, /
- C• %, _
- D• &&, &
76What the result of using function? LOWER('SQL Course')
- A• SQL COURSE
- B• sql course
- C• Sql Course
- D• Sql course
77What the result of using function? UPPER('SQL Course')
- A• SQL COURSE
- B• sql course
- C• Sql Course
- D• Sql course
78What the result of using function? CONCAT('Hello', 'World')
- A• Hello World
- B• HelloWorld
- C• elloWorld
- D• Hello
79What the result of using function? SUBSTR('HelloWorld',1,5)
- A• Hello World
- B• HelloWorld
- C• elloWorld
- D• Hello
80What the result of using function? ROUND(45.926, 0)
- A• 45.0
- B• 45.9
- C• 46.0
- D• 0
81What the result of using function? TRUNC(45.926, 0)
- A• 45.0
- B• 45.9
- C• 46.0
- D• 0
82What the result of using function? MOD(1600, 300)
- A• 1600
- B• 300
- C• 100
- D• 500
83From what kind of system table we can retrieve SYSDATE?
- A• Data
- B• System
- C• Dual
- D• Store
84From what kind of system table we can retrieve CURRENT_DATE?
- A• Data
- B• System
- C• Dual
- D• Store
85What the result of using function? LAST_DAY ('01-FEB-95')
- A• '28-FEB-95'
- B• '31-DEC-95'
- C• '28-JUNE-95'
- D• '28-FEB-96'
86What the result of using function? ADD_MONTHS (‘31-JAN-96',1)
- A• '28-MAR-96'
- B• '31-DEC-96'
- C• '28-JUNE-96'
- D• '29-FEB-96'
87Retrieve office id and locations from the table office {id, locations, name}
- ASelect *from office;
- BSelect id, locations from office;
- CSelect locations name from office;
- DSelect id form office;
88Retrieve quantity of offices in the office table - office {id, locations, name}
- Ao Select avg (id) from office;
- Bo Select count (id) from office;
- Co Select sum (id) from office;
- Do Select max (id) from office;
89Retrieve total number scholarship in the students table – students {id, name, scholarship, registereddate, tutorid}
- Ao Select avg (scholarship) from office;
- Bo Select count (scholarship) from office;
- Co Select sum (scholarship) from office;
- Do Select max (scholarship) from office;
90Retrieve quantity of students in the students table – students {id, name, scholarship, registereddate, tutorid}
- ASelect avg (id) from office;
- BSelect count (id) from office;
- CSelect sum (id) from office;
- DSelect max (id) from office;
91Sort students name by descending order - students {id, name, scholarship, registereddate, tutorid}
- Ao Select name from students order by desc;
- Bo Select name from students group by desc;
- Co Select *from students order by desc;
- Do Select name form students order by desc;
92Find max scholarship of students - students {id, name, scholarship, registereddate, tutorid}
- Ao Select avg (scholarship) from students;
- Bo Select count (scholarship) from students;
- Co Select sum (scholarship) from students;
- Do Select max (scholarship) from students;
93 Find min scholarship of students - students {id, name, scholarship, registereddate, tutorid}
- Ao Select avg (scholarship) from students;
- Bo Select count (scholarship) from students;
- Co Select min (scholarship) from students;
- Do Select max (scholarship) from students;
94Retrieve offices’ name and tutors’, who work in CSSE department. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Ao Select o.name, t.name from office o join tutor t on o.id=t.officeid where o.name = ‘CSSE’
- Bo Select o.name, t.name from office o join tutor t on o.id=t.id where o.name = ‘CSSE’
- Co Select o.name, t.name from office o join tutor t on o.id=t.officeid where o.name = ‘csse’
- Do Select o.name, t.name from office o join tutor t on o.id=t.officeid where o.name ‘CSSE’
95Retrieve students’ name, who have more than average scholarship. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Ao select s.name from students s where s.scholarship > (select scholarship from students);
- Bo select s.name from students s where s.scholarship > (select avg (scholarship)from students);
- Co select s.name from students s where s.scholarship > avg (scholarship);
- Do select s.name from students s where s.scholarship < avg (scholarship);
96Retrieve students’ name, who registered in 10th of Jan 2016. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Ao select name from students where registereddate = '2016-10-01';
- Bo select name from students where registereddate = '2016-10-10';
- Co select name from students where registereddate = 2016-10-10;
- Do select name from students where registereddate = '2016-01-01';
97Retrieve tutors’ name, who have more than experience others along with their students name . Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Ao select t.name, s.name, max(experience) from tutor t join students s on t.id=s.tutorid;
- Bo select t.name, s.name from tutor t join students s on t.id=s.id where experience = (select max (experience) from tutor);
- Co select t.name, s.name from tutor t join students s on t.id=s.tutorid where experience = (select max (experience) from tutor);
98Increase tutors experience and students’ scholarship twice. Retrieve experience and scholarship along with their names. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Ao select t.name,t.experience*2, s.name, s.scholarship*2 from tutor t join students s on t.id=s.tutorid;
- Bo select t.name,t.experience*2, s.name, s.scholarship*2 from tutor t join students s on t.id=s.id;
- Co select t.name,t.experience*2, s.name, s.scholarship*2 from tutor t join tutor s on t.id=s.tutorid;
- Do select t.name,t.experience*2, s.name, s.scholarship*2 from tutor t join tutor s on t.id=s.id;
99Retrieve office, tutor and students name, but tutors name should have y value. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Ao select o.name, t.name, st.name from tutor t join office o on o.id=t.officeid join students st on t.id=st.tutorid where t.name like '%y%';
- Bo select o.name, t.name, st.name from tutor t join office o o.id=t.officeid join students st on t.id=st.tutorid where t.name like '%y%';
- Co select o.name, t.name, st.name from tutor t join office o on o.id=t.officeid join students st t.id=st.tutorid where t.name like '%y%';
- Do select o.name, t.name, st.name from tutor t join office o on o.id=t.officeid join students st on t.id=st.id where t.name like '%y%';
100Retrieve information about office and their tutors as well. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Ao select *from office o join tutor t in o.id=t.officeid;
- Bo select *from office o join tutor t on o.id=t.officeid;
- Co select *form office o join tutor t on o.id=t.officeid;
- Do select *from office o join tutor t on o.id=t.id;
101Retrieve office name and tutor name, which have well experienced tutors. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Ao select o.name, t.name from office o join tutor t on o.id=t.officeid where t.experience = (select max (experience) from tutor);
- Bo select o.name, t.name from office o join tutor t on o.id=t.officeid where t.experience = (select min (experience) from tutor);
- Co select o.name, t.name from office o join tutor t on o.id=t.officeid where t.experience = (select high (experience) from tutor);
- Do select o.name, t.name from office o join tutor t on o.id=t.officeid where t.experience = (select low (experience) from tutor);
102Retrieve tutors’ name and the number of students for each of them. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Ao select count (s.name) as numberofstudents, t.name from tutor t join students s on t.id=s.tutorid;
- Bo select count (s.name) as numberofstudents, t.name from tutor t join students s on t.id=s.tutoridgroup by t.name;
- Co select count (s.name) as numberofstudents, t.name from tutor t join students s on t.id=s.idgroup by t.name;
- Do select count (s.name) as numberofstudents, t.name from tutor t join students s on t.id=s.id;
103Retrieve office name and the number of students for each of them. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Ao select count (s.name) as numberofstudents, o.name from tutor t join students s on t.id=s.tutoridjoin office o on o.id=t.officeid group by o.name;
- Bo select count (s.name) as numberofstudents, o.name from students s on join office o on o.id=s.id group by o.name;
- Co select count (s.name) as numberofstudents, o.name from tutor t join students s on t.id=s.tutoridjoin office o o.id=t.officeid group by o.name;
- Do select count (s.name) as numberofstudents, o.name from tutor t join students s on t.id=s.idjoin office o on o.id=t.id group by o.name;
104Retrieve all students’ name and scholarship, tutors name except students who have scholarship for 3000$. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))
- Ao select s.name, t.name from students s join tutor t on s.tutorid=t.id where s.scholarship <> 3000;
- Bo select s.name, t.name from students s join tutor t on s.tutorid=t.id where s.scholarship = 3000;
- Co select s.name, t.name from students s join tutor t on s.tutorid=t.id where s.scholarship < 3000;
- Do select s.name, t.name from students s join tutor t on s.tutorid=t.id where s.scholarship is 3000;
105Define inner join
- Ao returns all rows from the left table (1), with the matching rows in the right table (2)
- Bo selects all rows from both tables as long as there is a match between the columns in both tables
- Co returns all rows from the right table (2), with the matching rows in the right table (1)
- Do returns all rows from the left table (1) and from the right table (2)
106Define left join
- Ao returns all rows from the right table (2), with the matching rows in the right table (1)
- Bo selects all rows from both tables as long as there is a match between the columns in both tables
- Co returns all rows from the left table (1), with the matching rows in the right table (2)
- Do returns all rows from the left table (1) and from the right table (2)
107Define an union
- Ao combines the result set of two or more select statements
- Bo returns all rows from the left table (1) and from the right table (2)
- Co returns all rows from the right table (2), with the matching rows in the right table (1)
- Do returns all rows from the left table (1), with the matching rows in the right table (2)
108INNER JOIN and JOIN are the same
- ATrue
- BFalse
109Retrieve students’, scholarship and teacher's’ name, who have more than average scholarship. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))
- Ao select s.name, s.scholarship, t.name from students s, tutor t where t.id=s.tutorid and s.scholarship> (select avg(scholarship) from students)
- Bo select s.name, s.scholarship, t.name from students s, tutor t where t.id=s.tutorid and s.scholarship> avg(scholarship)
- Co select s.name, s.scholarship, t.name from students s, tutor t where s.scholarship> (select avg(scholarship) from students)
- Do select s.name, avg(s.scholarship), t.name from students s, tutor t
110Retrieve book title and total number of book copies and price, which has id 1. Book {bookid, title, publisher_name, price}. BookCopies {bookid, libraryid,noOfCopies [references Book (bookid)]}
- Ao select b.title, sum (no_of_copies) from book b join book_copies bc on b.bookid=bc.bookid where b.bookid=1 group by b.title;
- Bo select b.title, sum (no_of_copies) from book b join book_copies bc on b.bookid=bc.bookid where b.bookid=1;
- Co select b.title, count (no_of_copies) from book b join book_copies bc on b.bookid=bc.bookid where b.bookid=1 group by b.title;
- Do select b.title, count (no_of_copies) from book b join book_copies bc on b.bookid=bc.bookid where b.bookid=1;
111Retrieve books name and prices. Increase price twice more for books, which have more than 20 copies;Book {bookid, title, publisher_name, price}. BookCopies {bookid, libraryid,noOfCopies [references Book (bookid)]}
- Ao select b.title, b.price, b.price *2 as increasedprice from book b join book_copies bc on bc.bookid=b.bookid;
- Bo select b.title, b.price book b join book_copies bc on bc.bookid=b.bookid where bc.no_of_copies > 20;
- Co impossible to solve
- Do select b.title, b.price, b.price *2 as increasedprice from book b join book_copies bc on bc.bookid=b.bookid where bc.no_of_copies > 20;
112Retrieve library name, book name, number of copies, which have more than 25 copies. Book {bookid, title, publisher_name, price}. BookCopies {bookid, libraryid,noOfCopies [references Book (bookid)]}. Library (libraryid)), cardno (references Borrower (cardno)), dateout, duedate}.
- Ao select l.libraryname, b.title, bc.no_of_copies from book b join book_copies bc on b.bookid=bc.bookid join library l on l.libraryid = bc.libraryid where bc.no_of_copies>25;
- Bo select l.libraryname, b.title, bc.no_of_copies from book b join book_copies bc on b.bookid=bc.bookid where bc.no_of_copies>25;
- Co select l.libraryname, b.title, bc.no_of_copies from book join library l on l.libraryid = bc.libraryid where bc.no_of_copies>25;
- Do select l.libraryname, b.title, bc.no_of_copies from book b join book_copies bc on b.bookid=bc.bookid join library l l.libraryid = bc.libraryid where bc.no_of_copies>25;
113Retrieve the number of departments in the department table. Tables: Department {id, name}. Employee {id, name, salary, dep_id (references Department (id))}
- Ao select count(id) from department
- Bo select sum (id) from department;
- Co select coun(id) from department
- Do select id from department
114Retrieve total salaries payable to employee. Tables: Department {id, name}. Employee {id, name, salary, dep_id (references Department (id))}
- Ao select count(salary) from employee;
- Bo select sum (id) from employee;
- Co select sum (salary) from employee;
- Do select max (salary) from employee;
115Retrieve student's name, which starts from A. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))
- Ao select name from students where name like 'A';
- Bo select name from students where name like 'A_%';
- Co select name from students where name like 'a%';
- Do select name from students where name like '%A%'
116Retrieve all students name with the department name, but excluding department CSSE. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))
- Ao select s.name, o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid where o.name <> 'CSSE';
- Bo select s.name, o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid;
- Co select s.name, o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid where o.name = 'CSSE';
- Do select s.name, o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid group by o.name, s.name;
117Find an average scholarship of students. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))
- Ao select averg (scholarship) from students ;
- Bo select avg (scholarship) from students ;
- Co select av (scholarship) from students ;
- Do select avrg (scholarship) from students ;
118Retrieve average scholarship of students for each department. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))
- Ao select avg (scholarship), o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid group by o.name;
- Bo select avg (scholarship), o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid ;
- Co select avg (scholarship), o.name from students s join tutor t on t.id=s.tutorid group by o.name;
- Do select avg (scholarship), o.name from students s d join office o on o.id=t.officeid group by o.name;
119Retrieve student number in each department. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))
- Ao select sum (s.id), o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid group by o.name;
- Bo select o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid group by o.name;
- Co select count (s.id), o.name from students s join tutor t
- Do select count (s.id), o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid group by o.name;
- Eo on t.id=s.tutorid join office o on o.id=t.officeid;
120Retrieve total amount of scholarship of each department. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))
- Ao select sum (scholarship), o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid group by o.name;
- Bo select count (scholarship), o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid group by o.name;
- Co select sum (scholarship), o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid;
- Do select count (scholarship), o.name from students s join tutor t on t.id=s.tutorid join office o on o.id=t.officeid;
121Consider the EMPLOYEES table. Which of the following statements count the number of employees within each department?
- Ao SELECT department_id, COUNT(last_name) FROM employees GROUP BY department_id
- Bo SELECT department_name, COUNT(last_name) FROM employees GROUP BY department_id
- Co SELECT department_id, department_name, COUNT(last_name) FROM employees GROUP BY department_id
- Do SELECT department_id, COUNT(last_name) FROM departments GROUP_BY last_name
122You can rename a table with the RENAME or the ALTER TABLE command.
- ATrue
- BFalse
123Write SQL statement for display the department numbers with more than employees in each dept.
- Ao Select deptno, count(deptno) from emp group by deptno having count(*)>3;
- Bo Select deptno, count (deptno) from emp group by deptno having count(*)>2;
- Co Select deptno, count (emp) from deptno group by emp having count(*)>2;
- Do Select deptno, count(deptno) from deptno group by emp having count(*)>3;
124You can add and drop columns from a table using the ALTER TABLE command.
- ATrue
- BFalse
125Consider the EMPLOYEES table. Which of the following SQL statements is correct to provide the sentence in the format “King has been working since 01.01.1987” with “Employee Information” alias?
- Ao SELECT last_name ||’has been working since’ || hire_date “Employee Information” FROM employees;
- Bo SELECT last_name || ‘has been working since’ || hire_date Employee Information FROM employees
- Co SELECT last_name || ‘has been working since’ || hire_date ‘Employee Information’ FROM employees;
- Do SELECT last_name || ”has been working since” || hire_date “Employee Information” FROM employees;
126Which keyword is used to provide an alias to a column?
- Ao COLUMN
- Bo AS
- Co ALIAS
- Do IS
127You can place the subquery in a number of SQL clauses, including the following:
I. WHERE clause
II. HAVING clause
III. FROM clause- Ao I and II
- Bo I,II and III
- Co I only
- Do I and III
128Consider the SQL statement. Which of the following clauses does not sort the result rows by salary value in the ascending order?
SELECT last_name “Employee”, salary “Salary”
FROM employees- Ao ORDER BY 2;
- Bo ORDER BY salary;
- Co ORDER BY “Salary” ASC;
- Do ORDER BY Salary DESC;
129Which keyword is used to eliminate duplicate rows in the result?
- Ao DISTINCT
- Bo DESCRIBE
- Co HAVING
- Do GROUP BY
130What will be the result of the following SQL statement? (SYSDATE is a date of your exam)
SELECT TO_CHAR(SYSDATE, ‘Day’) FROM Dual;- Ao 31.05.2017
- Bo Friday
- Co 31
- Do 31-05.2017
131What will be the result of the following SQL statement? (SYSDATE)
SELECT TO_CHAR(SYSDATE, ‘DD.MM.YY’) FROM Dual;- Ao 31.May.2017
- Bo An error will occur
- Co 31.05.2017
- Do 31.05.17
132Select all statements that correctly describe the diagram below
- AThe diagram is notated using Crows Foot notation
- BThe diagram notated using Chen notation
- CThe diagram has a one-to-many relationship.
- DA business rule inferred by this diagram could correctly be, "A customer makes one or many payments."
- EThe diagram has a many-to-many relationship.
133What type of relationship is expressed with the business rules? Each store is managed by one employee; Each employee manages at most one store
- AM:N (many to many)
- B1:5 (one to five)
- C1:1 (one to one)
- D1:M (one to many)
134Select the alternative that correctly identifies the relationship classification described by the two business rules below. Each student takes one or more classes.Each class may be taken by one or more students.
- AM:N (many to many)
- B0:1 (zero to one)
- C1:M (one to many)
- D1:5 (one to five)
- E1:1 (one to one)
135Select all SQL statements that will correctly list all the contents from the PRODUCT table.
- AGET FROM PRODUCT
- BSELECT *FROM PRODUCT
- CSELECT ALL FROM PRODUCT
- DLIST * FROM PRODUCT
136The student is requested to delete all rows in the Plant table that have a plant_species value of "FicusBenjamina".The student uses the following SQL command: DELETE FROM plant WHERE plant_num = 1; Select all statements that correctly describe the student's solution
- AThis SQL command deletes some but not all of the rows in the Plant table which have a plant_species value of "FicusBenjamina"
- BThis SQL command does not delete any rows in the Plant table which have a plant_species value of "FicusBenjamina".
- CIf the WHERE clause in the SQL statement provided by the student were to be replaced with "WHERE plant_species='FicusBenjamina'", then that SQL command would delete all of the rows in the Plant table which have a plant_species value of "FicusBenjamina".
- DThis SQL command deletes all of the rows in the Plant table which have a plant_species value of "FicusBenjamina".
- EThis SQL command deletes row(s) in the Plant table which have a plant_species value of "ChamaedoreaSeifritzii".
137The student is requested to delete all rows in the Plant table that have a plant_species value of "FicusBenjamina".The student uses the following SQL command: DELETE FROM plant WHERE plant_num = 1; Select all statements that correctly describe the student's solution
- AThis diagram could be part of a conceptual model for a relational database
- BThe diagram includes five one-to-many relationships.
- CThe diagram is notated using Crow’s foot notation.
- DThe diagram includes three one-to-many relationships.
138Examine the following entity relationship diagram, then select all statements that correctly describe the diagram
- AA DRUM is associated with at most one DRUMMER.
- BDRUMMER is associated with zero or more DRUMs.
- CThe DRUM entity has a primary keydrummer_id.
- DBoth DRUM and DRUMMER are weak entities.
- EThe identity of every DRUM instance depends on an associated DRUMMER instance.
139You are given the following PLANT table: Note that PLANT_ID is the primary key in this table. Choose the entity relationship diagram in Crow's foot notation which correctly represents this table
- A
- B
- C
- D
- A
140A database designer first models aircraft using this entity relationship diagram: After doing so, the database designer realizes that the HEIGHT attribute is multi-valued. The designer knows that the wing height, body height, and cock pit height should be stored in the database, and that heights of more aircraft sections may be needed in the future. Select the best implementation of the HEIGHT multi-valued attribute from the given possibilities.
None of the given implementations correctly implement the multivalued HEIGHT attribute.- A
- B
- C
- DNone of the given implementations correctly implement the multivalued HEIGHT attribute.
- A
141For the following relational schema, choose the correct business rule
- AEach Customer has more than one Membership.
- BOnly one Customer may have the same Membership.
- CEach Membership has a unique price and title.
- DIt represents many-to-many (M:N) relationship.
142You are given the following diagram notated using Crow's Foot notation: For each row in Table2, how many related rows can be in Table1? Select all answers that correctly answer this question
- AOne or more.
- B1
- C0
- DOnly 0, 1, 2, or 3.
- EThere is not enough information to determine the number of related rows.
143 Read the business rules below which pertain to entities termed DISK and COMPUTER, then follow the subsequent instructions. Neither DISK nor COMPUTER is a weak entity COMPUTER is not optional to DISK, and DISK is not optional to COMPUTER . Select the correct entity relationship diagram which matches the requirements for the DISK and COMPUTER entities. Choose all designs that correctly implement the business rules.
- A
- B
- C
- D
- A
144You are given the following basic Crow's foot entity relationship diagram.
- ANone of the other answers are correct.
- BEach device may be attached to many computers; each computer is attached to one device.
- CEach computer is attached to one device; each device is attached to one or more computers.
- DEach computer may be attached to zero to many devices; each device is attached to one computer.
- EEach computer is attached to one or more devices; each device is attached to one computer.
145 You are given the following basic Crow's foot entity relationship diagram. Select all business rules that can be correctly inferred from the following diagram.
- AEach apartment is lived in by one tenant only
- BEach tenant lives in one to many apartments
- CEach tenant lives in exactly one apartment
- DEach tenant must live in many apartments
146Select all that are required of a table so that it is considered to be normalized to second normal form (2NF). (Check all that are required for a table to be in 2NF.)
- AIf there is a composite primary key, then no columns that are not part of the primary key will depend on only part of a composite primary key
- BThere are no null values
- CThere are no transitive dependencies
- DThere are many repeating groups in the table
147According to the diagram, which of the following are true? (Check all correct assertions regarding the diagram below.)
- A50%The diagram has a one-to-many relationship
- B-50%The diagram is notated using Crow's Foot notation
- C50%The diagram is a modified UML class diagram
- D-50%The diagram has a many-to-many relationship
- E-50%There is no relationship in this diagram
148Select all statements that correctly described first normal form (1NF)
- AA table that conforms to 1NF must have no repeating groups.
- BA table that conforms to 1NF must have no missing or null data.
- CA table that conforms to 1NF must have no transitive dependencies.
- DA table that conforms to 1NF must have no partial dependencies.
- EA table that conforms to 1NF must have data arranged in rows and columns.
149Select all that are true of primary keys. (Check all that are true.)
- APrimary keys must be integers.
- BPrimary keys are often referenced as foreign keys.
- CIt is acceptable that a primary key column contains a null value, as long as there is only one null value, to maintain uniqueness.
- DSurrogate primary keys are especially helpful when there is no natural primary key.
- EOne way composite primary keys occur is when an existence-dependent entity includes the primary key of the parent entity as part of its composite primary key.
150Which of the following are true of database design? (Check all that are true.)
- AAn early step is identifying the entities, attributes, and relationships.
- BThe normalization process might yield additional entities and attributes that need to be added to the ERD.
- CNormalization is applied at all stages of design of a relational database, beginning with conceptual design.
- DThe design process for a new database usually begins with conceptual design, then proceeds to logical design, and then to physical design.
151Select all statements that are best practices for database design
- AThe database tables should only be normalized after performance problems occur.
- BIt is best to design a relational database schema iteratively by first creating the tables using SQL, viewing the design in the database, then suggesting changes to the structure.
- CEntities should be normalized before the table structures are created.
- DRelationships between the entities should be defined before the table structures are created.
152Review the SQL below and check all answers that are correct with respect to the SELECT statement:
- AThe query will never return any rows; no matter what data is in the CUSTOMER table.
- BThe SELECT statement is not syntactically correct.
- CWe cannot determine how many rows the query will return.
- DThe query will return no rows, because a last_name cannot be both 'Smith', 'Jones', and 'Salk'.
- EAll answers above are correct.
153 Relationships can be redundant?
- ATrue
- BFalse
154What uncommon relationship is described by the statements: "Each DNA SAMPLE may be taken from one and only one PERSON and each PERSON may provide one and only one DNA SAMPLE"
- AOne to One Optional
- BMany to Many Mandatory
- COne to Many Mandatory
- DOne to Many Optional
155What relationship is described by the statements: "Each CUSTOMER may place one or more ORDERs, each ORDER must be placed by one and only one CUSTOMER"
- AOne to Many
- BMany to Many
- CMany to More
- DOne to One
- Enone
156A relationship on an ERD can have attributes.
- ATrue
- BFalse
157Which of the following pairs of entities is most likely to be modeled as a 1:1 relationship?
- Atree and branch
- Bteacher and subject area
- Cperson and fingerprint
- Dcar and wheel
158Which of the following attributes is suitable to be a Unique Identifier?
- AAddress
- BFirst name
- CLast name
- DPassport ID
159A/an _________ is a piece of information that in some way describes an entity. It is a property of the entity and it quantifies, qualifies, classifies, or specifies the entity.
- ATable
- BERD
- CProcess
- DAttribute
160All of the following would be instances of the entity PERSON except which?
- ADavid Jones
- BAngelina Rosalie
- CMale
- DGrace Abinajam
161Which of the following pairs of entities is most likely to be modeled as a M:M relationship?
- ATREE and BRANCH
- BTEACHER and SUBJECT AREA
- CCAR and WHEEL
- DPERSON and FINGERPRINT
162One to many relationships are the most uncommon type of relationships in an ERD.
- ATrue
- BFalse
163 What are the three properties that every relationship should have?
- AName, optionality, cardinality
- BA UID bar, a diamond, an arc
- CName, optionality, arcs
- DTransferability, degree, name
164Relationships can be either mandatory or optional. True or False?
- ATrue
- BFalse
165When reading a relationship between 2 entities, the relationship is read both from left to right and right to left. True o rFalse?
- ATrue
- BFalse
166Entities are usually verbs. True or False?
- ATrue
- BFalse
167Unique Identifiers….
- Adistinguish one entity from another
- Bdistinguish one instance of an entity from all other instances of that entity
- Cdistinguish all entities in a database
- Ddistinguishes nothing
168Each row in a database table is called a
- AAttribute
- BColumn
- CRecord
- DField
169Each column in a database table is called a ________
- AField
- BRow
- CEntity
- DTuple
- ERelationship
170 ___________is a field or fields that contain a unique identifier for each record in a primary table.
- AComposite key
- BForeign key
- CPrimary key
- DDuplicate key
- ESurrogate key
171_is a field or field sin a related table that refer to the primary key in a primary table.
- APrimary key
- BComposite key
- CForeign key
- DCandidate key
- ESurrogate key
172 _exists in a relational database when one record in a primary table has many related records in a related table.
- AOne-to-one
- BOne-to-many
- CMany-to-many
- DZero-to-one
- ENo correct answer
173 Which of the following entities most likely contains invalid attributes?
- AEntity: Home. Attributes: Number of Bedrooms, Owner, Address, Date Built
- BEntity: Pet. Attributes: Name, Birthdate, Owner
- CEntity: Car. Attributes: Owner Occupation, Owner Salary, Speed
- DEntity: Mother. Attributes: Name, Birthdate, Occupation, Salary
174What uncommon relationship is described by the statements: “Each LINE must consist of many POINTS and each POINT must be a part of many LINES”
- AOne to Many Optional
- BOne to Many Mandatory
- CMany to Many Optional
- DMany to Many Mandatory
175Which symbol is used to show that a particular attribute is mandatory?
- A#
- B*
- C&
- DO
- E+
176A table is in 3NF if it has met all database requirements for both 1NF and 2NF and transitive dependencies are eliminated.
- ATrue
- BFalse
Information
- Description
- Quiz on ORACLE, created by Ayaulym Burakhanova on 13/12/2017.
- Author
- Ayaulym Burakhanova
- Language
- English
- Views
- 0
- Tags
- Rating
- No ratings yet Rate this quiz