RDBMS
RDBMS
State Finished
Completed on Sunday, 8 September 2024, 9:45 PM
Time taken 6 mins 54 secs
Marks 4.00/5.00
Grade 80.00 out of 100.00
Question 1 0.00/1.00
100%
SQL is a case sensitive language and the data stored inside the table are case in-sensitive. Say true or false?
Select one:
True
False
Question 2 1.00/1.00
Tom has designed a payroll software for XYZ technology.The software will store the salary details into the
database and later he can retrieve the same for future references. Tom falls under which category of user.
Select one:
a. Application Programmer
b. End User
c. DBA
d. Network Administrator
Question 3 1.00/1.00
hierarchical
Data is represented in the form of a tree -
relational
Data is represented in the form of a table -
network
Data is represented in the form of a graph -
The correct answer is: Data is represented in the form of a tree - → hierarchical, Data is represented in the
form of a table - → relational, Data is represented in the form of a graph - → network
Question 4 1.00/1.00
Which of the following is not a valid relational database?
Select one:
100%
a. Unify
b. MySQL
c. Oracle
d. Sybase
Question 5 1.00/1.00
Terms of Relational
cardinality
________ refers to number of rows in the table
Attribute
______ refers to the columns of the table
Degree
_______ refers to number of columns in the table
_______ refers to the range of values that can be stored for an attribute Domain
Tuples
______ refers to the rows of the table
100%
The correct answer is: ________ refers to number of rows in the table → cardinality, ______ refers to the
columns of the table → Attribute, _______ refers to number of columns in the table → Degree, _______
refers to the range of values that can be stored for an attribute → Domain, ______ refers to the rows of the
table → Tuples
Started on Sunday, 8 September 2024, 9:00 PM
State Finished
Completed on Sunday, 8 September 2024, 9:00 PM
Time taken 28 secs
Marks 5/5
Grade 100 out of 100
Question 1 1/1
100%
Database is a shared collection of logically unrelated data, designed to meet the needs of an organization.
State True or False.
Select one:
a. FALSE
b. TRUE
Question 2 1/1
The correct answers are: NOT NULL, Unique, Check
100%
Question 3 1/1
Select one:
a. No of Attributes
b. Domain
c. No of rows
d. Cardinality
Question 4 1/1
100%
Question 5 1/1
Which of the following are data models?
Question 1 1.00/1.00
100%
Select one:
True
False
Question 2 1.00/1.00
The constraint name will be the default name if the constraint name is not mentioned for an attribute. State
true or false.
Select one:
True
False
The correct answer is 'True'.
Question 3 1.00/1.00
Select one:
a. composite key
b. primary key
c. secondary key
d. foreign key
Question 4 1.00/1.00
S l
Select one:
Views
Objects
Polymorphism
DDL
The correct answer is: Polymorphism
100%
Question 5 1.00/1.00
Select one:
a. Deletion
b. Updating
c. Insertion
d. Sorting
c. Relation
100%
d. Attributes
e. Domain
Question 7 1.00/1.00
Select one:
a. Data Information
b. Meta Information
c. Data Dictionary
d. Meta Dictionary
Your answer is correct.
Question 8 0.00/1.00
100%
Which of the following data models supports many-to-many relationships?
Select one or more:
Relational model
Hierarchical model
Network model
Waterfall model
Question 9 1.00/1.00
Select one:
a. Records
b. Tables
c. Keys
d. Fields
Your answer is correct.
100%
Question 10 1.00/1.00
Select one:
Use upper case for all SQL keywords.
All of the given options
Don't use space in identifiers.
Each table must have a primary key.
Question 1 1.00/1.00
100%
Which of the following options is not correct?
Select one:
a. alter table emp modify name varchar(30);
b. alter table emp drop column_name;
c. alter table emp drop column column_name;
d. alter table emp add column_name varchar(25);
Question 2 1.00/1.00
Select one:
a. Any number
b. 4
c. 1
d. 2
The correct answer is: 1
100%
Question 3 1.00/1.00
We need to ensure that the amount withdrawn should be less then the credit card limit amount, to ensure
this integrity what type constraint will be used?
Select one:
a. column level check constraint
How would you add a foreign key constraint on the dept_no column in the EMP table, referring to the id
column in the DEPT table?
Select one:
b. Use the UPDATE TABLE command with the MODIFY clause on the EMP table.
100%
c. Use the ALTER TABLE command with the MODIFY clause on the EMP table.
d. Use the ALTER TABLE command with the ADD clause on the EMP table.
e. Use the ALTER TABLE command with the MODIFY clause on the DEPT table.
Question 5 1.00/1.00
An emp table contains fields employ name, desig and salary. How do you drop column salary?
Select one:
a. delete from emp where column = salary;
b. alter table emp delete column salary;
lt t bl d l l
c. alter table emp drop column salary;
d. alter table emp delete salary;
The correct answer is: alter table emp drop column salary;
Question 6 1.00/1.00
100%
Choose the correct option
not null
cardholdername
not null
validitydate
unique
cardholderphoneno
check
creditcardtype should be silver or platinum only
primary key
creditcardno
Choose the correct options. __________ command is used to delete the records and _________
command is used to delete the db objects?
Select one:
Truncate , Delete
100%
Delete , Truncate
Drop ,Truncate
Truncate , Drop
Question 8 2.00/2.00
Select one:
CREATE
CREATE
DROP
ALTER
RENAME
Your answer is correct.
The correct answer is:
100% ALTER
Started on Tuesday, 10 September 2024, 1:12 PM
State Finished
Completed on Tuesday, 10 September 2024, 1:22 PM
Time taken 9 mins 28 secs
Marks 10.00/10.00
Grade 100.00 out of 100.00
Question 1 1.00/1.00
100%
Cascade constraints are used only in drop statements. State True or False.
Select one:
True
False
Question 2 1.00/1.00
SALARY NUMBER(8,2)
HIRE_DATE DATE
Management wants to add a default value to the SALARY column. You plan to alter the table by
using this SQL statement:
100%
Select one:
a. Column definitions cannot be altered at add DEFAULT values for columns with a NUMBER
data type.
c. A change to the DEFAULT value affects only subsequent insertions to the table.
d. All the rows that have a NULL value for the SALARY column will be updated with the value
5000.
The correct answer is: A change to the DEFAULT value affects only subsequent insertions to the table.
Question 3 1.00/1.00
Select one:
a. CREATE TABLE ord_details
(ord_no NUMBER(2),
item_no NUMBER(3),
item_no NUMBER(3),
ord_date DATE DEFAULT SYSDATE NOT NULL);
item_no NUMBER(3),
ord_date DATE DEFAULT NOT NULL,
CONSTRAINT ord_uq UNIQUE (ord_no),
100%
Question 4 1.00/1.00
When we attempt to create the salary table with this command:
1.CREATE TABLE salary
2.(employee_id NUMBER(9)
3.CONSTRAINT salary_pk PRIMARY KEY,
4.1995_salaryNUMBER(8,2),
5.manager_name VARCHAR2(25)
6.CONSTRAINT mgr_name_nn NOT NULL,
7.$salary_96NUMBER(8,2));
b. 1
c. 4
d. 3
e. 2
f. 7
Question 5 1.00/1.00
Select one:
Check constraint can be used only for column level
Check constraint can be applied only for one column in a table
Check constraint can be applied on characters without the use of scalar functions
Check constraint can be used for both column level and table level
The correct answer is: Check constraint can be used for both column level and table level
Question 6 1.00/1.00
____ key has a unique and holds the value to identify the record and duplicate null values are not allowed.
Select one:
All of the given options
Primary key
Not Null
Foreign Key
100%
The correct answer is: Primary key
Question 7 1.00/1.00
Select one:
True
False
Question 8 1.00/1.00
By using _____ datatype we can store numeric and character values as an input
Select one:
All of the given options
Char
varchar
varchar2
100%
The correct answer is: All of the given options
Question 9 1.00/1.00
Which statement would you use to add a primary key constraint to the patient table using the id_number
column, immediately enabling the constraint?
Select one:
a. This task cannot be accomplished.
Question 10 1.00/1.00
100%
To permanently remove all the data from the STUDENT table, and you need the table structure in the future.
Which single command performs this?
Select one:
a. DELETE * FROM student
KEEP STRUCTURE;
Question 1 1.00/1.00
100%
Select one:
True
False
Question 2 1.00/1.00
On delete restrict is used to restrict the deletion of child records. State True or False.
Select one:
True
False
The correct answer is 'True'.
Question 3 1.00/1.00
Which of the following is not a DML statement?
100%
Question 4 1.00/1.00
The correct answers are: Drop, Truncate
Question 5 1.00/1.00
100%
Consider the below table structure:
EmpId Number(10) PK
Select one:
a. The column order should not be changed.
Your answer is correct.
The correct answer is: Value for phoneno is missing.
Question 6 1.00/1.00
100%
DELETE FROM dept WHERE dept_id = 901;
The above delete statement throws an integrity constraint error because a child record was found. What
could we do to make the statement execute?
Select one:
a. Delete the child records first.
Question 7 1.00/1.00
Examine the structure of the Employee table:
Column Name DataType Constraint
Empname Varchar2(20) Not Null
EmpId Number(10) PK
DeptId Number(10) FK
2 Marketing Kolkata
Which of the update statement produces the following error in the employee table?
ORA-02291: integrity constraint (SYS_C23) violated - parent key not found
Select one:
a. UPDATE Employee SET Empid = 101 WHERE Deptid=3;
The correct answer is: UPDATE Employee SET Deptid=3 WHERE Empid = 101;
Question 8 1.00/1.00
Which query is used to delete employee records whose age is greater than 55?
Select one:
Delete * from employee where age=55;
100%
Delete * from employee where age >55;
Delete from employee where age >=55;
Delete from employee where age >55;
The correct answer is: Delete from employee where age >55;
Question 9 1.00/1.00
Which SQL statement needs both insert and update privilege on the target table and select privilege on the
source table?
Select one:
a. delete
b. merge
c. alter
d. update
The correct answer is: merge
Question 10 1.00/1.00
100%
Column Name DataType Constraint
Stud_id Number(3) PK
Address Varchar2(30)
DOB Date
Select one:
a. INSERT INTO student (stud_id, address, name, dob)
The correct answer is: INSERT INTO student (stud_id, address, name, dob)
VALUES (101,'100 Main Street','Smith','17-JUN-99');
100%
Started on Wednesday, 11 September 2024, 3:13 PM
State Finished
Completed on Wednesday, 11 September 2024, 3:17 PM
Time taken 3 mins 12 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Question 1 1.00/1.00
100%
Match appropriately.
Removes the entire data from the table, while the structure remains intact.
Truncate
Removes the table itself from the database.
Drop
It is possible to update more than one column with a single UPDATE statement. State true or false.
Select one:
True
False
100%
Question 3 1.00/1.00
To have all the rows deleted from the table using delete statement, you must specify the query with WHERE
clause that specifies all the rows. State true or false.
Select one:
True
False
Q estion 4 1 00/1 00
Question 4 1.00/1.00
To change the structure of the table we use
ALTER TABLE
Syntax.
Your answer is correct.
100%
The correct answer is:
To change the structure of the table we use [ALTER TABLE] Syntax.
Question 5 1.00/1.00
Select one:
CREATE
ROLLBACK
SELECT
COMMIT
100%
Started on Wednesday, 11 September 2024, 3:17 PM
State Finished
Completed on Wednesday, 11 September 2024, 3:30 PM
Time taken 12 mins 30 secs
Marks 9.00/10.00
Grade 90.00 out of 100.00
Question 1 1.00/1.00
100%
A DML statement is used to modify the structure of the database. State True or false.
Select one:
True
False
Question 2 1.00/1.00
b. /* */
/ /
c. */ */
d. %%
e. - -
Question 3 1.00/1.00
Which option is used to delete data from both parent and child tables?
Select one:
All the given options
Restrict
Set null
Cascade
Question 4 1.00/1.00
Ques o /
Which statement is true when a DROP TABLE command is executed on a table?
Select one:
a. Any pending transactions on the table are rolled back.
100% d. The structure of the table remains in the database, and the data and indexes are deleted.
e. The table structure and its deleted data cannot be rolled back and restored once the DROP TABLE
command is executed.
Question 5 0.00/1.00
Select one:
And
None of the given options
When
Where
The correct answer is: None of the given options
Question 6 1.00/1.00
The correct answers are: A constraint can be disabled even if the constraint column contains data., A
columns with the UNIQUE constraint can contain NULL values.
Question 7 1.00/1.00
You need to remove all the data from the employee table while leaving the table definition intact.
You want to be able to undo this operation. How would you accomplish this task?
Select one:
a. DELETE FROM employee;
100%
Question 8 1.00/1.00
Select one:
The query will be executed successfully.
The query will generate an ORA-02291: integrity constraint violated-parent key not found error.
None of the given options
The query will generate an ORA-01400: cannot insert NULL value into primary key
The correct answer is: The query will generate an ORA-01400: cannot insert NULL value into primary key
Question 9 1.00/1.00
Which query will change the cust_address to 'Panama' for those who are from ‘Los Angeles’?
Select one:
100% Update customer set cust_address=’ Los Angeles’ where cust_address=’Panama’;
Update customer make cust_address=’Panama’ where cust_address=’Los Angeles’;
Update table customer set cust_address=’Panama’ where cust_address=’Los Angeles’;
Update customer set cust_address=’Panama’ where cust_address=’Los Angeles’;
The correct answer is: Update customer set cust_address=’Panama’ where cust_address=’Los Angeles’;
Question 10 1.00/1.00
Which query will delete all the data in the Employee table that belongs to the employee id 1207?
Select one:
Delete * from Employee where emp_id=1207;
Delete emp_id=1207 from Employee;
Delete from Employee where emp_id=1207;
Delete all from Employee where emp_id=1207;
The correct answer is: Delete from Employee where emp_id=1207;
100%
Started on Wednesday, 11 September 2024, 3:58 PM
State Finished
Completed on Wednesday, 11 September 2024, 4:06 PM
Time taken 8 mins 47 secs
Marks 9.00/10.00
Grade 90.00 out of 100.00
Question 1 1.00/1.00
100%
Select one:
a. The results are sorted by the first column in the SELECT list if the ORDER BY clause is not
provided.
b. You cannot specify a column alias in an ORDER BY clause.
c. Date values are displayed in descending order by default.
d. Null values are displayed last in ascending sequences.
e. You cannot sort query results by a column that is not included the SELECT list.
The correct answer is: Null values are displayed last in ascending sequences.
Question 2 1.00/1.00
Which statement is used to manipulate data without affecting the data in the table?
Select one:
Truncate
Insert
Delete
Select
The correct answer is: Select
100%
Question 3 1.00/1.00
Select the suitable option for retrieving all the employees who have a manager?
Select one:
a. select empname, manager_id from employee where manager_id NULL;
b. select empname, manager_id from employee where manager_id is NULL VALUE;
c. select empname, manager_id from employee where manager_id is NULL;
d. select empname, manager_id from employee where manager_id is NOT NULL;
The correct answer is: select empname, manager_id from employee where manager_id is NOT NULL;
Question 4 1.00/1.00
Select the missing keyword, to complete the select query for the given scenario
100%
select the student details whose firstname starts with 'A' or whose city is 'Chennai' and firstname ends with 'n'
OR
city ='Chennai'
AND
Select the missing keyword, to complete the select query for the given scenario
100%
select the student details whose firstname starts with 'A' or whose city is 'Chennai' and firstname ends with 'n'
select * from CSR_STUDENT where firstname like 'A%' [OR] city ='Chennai' [AND] firstname like '%n';
Question 5 1.00/1.00
How to retrieve department_id column without any duplication from employee relation?
Select one:
a. select distinct department_id from employee;
b. select unique department_id from employee;
c. select department_id from employee;
d. select department_id distinct from employee;
100%
Question 6 1.00/1.00
Select one:
All the given options
Distinct reduces the execution time of the query.
Distinct decreases the performance of the query.
Distinct remove duplicate values in the Select clause.
The correct answer is: Distinct remove duplicate values in the Select clause.
Question 7 1.00/1.00
Select the suitable option for retrieving all the employees whose name ends with "kumar"?
Select one:
a. select * from employee where empname like '%kumar%';
b. select * from employee where empname like 'kumar';
c. select * from employee where empname like '%kumar';
100%
d. select * from employee where empname like 'kumar%';
The correct answer is: select * from employee where empname like '%kumar';
Question 8 1.00/1.00
Select one:
None of the given options.
Control transactional processing in a database.
Control access to data stored in a database.
Manipulate the data stored in a database.
100% Any
In
||
Question 10 1.00/1.00
Select the suitable option for retrieving all the employees whose salary range is between 40000 and 100000?
100%
Started on Wednesday, 11 September 2024, 4:07 PM
State Finished
Completed on Wednesday, 11 September 2024, 4:12 PM
Time taken 5 mins 20 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Question 1 1.00/1.00
100%
The above query produces an error on execution. What is the reason for the error?
Select one:
a. An alias cannot be used in an expression
b. The alias MIDPOINT should be enclosed within double quotation marks for the CUST_CREDIT_LIMIT/2
expression
c.
The MIDPOINT +100 expression gives an error because CUST_CREDIT_LIMIT contains NULL values
d.
The alias NAME should not be enclosed within double quotation marks
Your answer is correct.
100% The correct answer is:
An alias cannot be used in an expression
Question 2 1.00/1.00
The SELECT statement is used to describe the table and the table data from a database. State true or false.
Select one:
True
False
Question 3 1.00/1.00
Which of the following are the correct syntaxes for displaying the StudentName and Department from
Student table?
Select one or more:
a. SELECT STUDENTNAME, DEPARTMENT FROM Student;
Question 4 1.00/1.00
Which of the following command is used to select all the fields available in the table?
Select one:
#
%
%
ALL
*
Your answer is correct.
The correct answer is:
*
100%
Question 5 1.00/1.00
Select one:
Order by
Where
Having
Select
Question 1 1.00/1.00
100%
Which statement is true regarding the default behavior of the ORDER BY clause?
Select one:
a. In a character sort, the values are case-sensitive
b. Numeric values are displayed from the maximum to the minimum value if they have decimal
positions
c. Only those columns that are specified in the SELECT list can be used in the ORDER BY clause
d. NULL values are not considered at all by the sort operation
The correct answer is: In a character sort, the values are case-sensitive
Question 2 1.00/1.00
To update the CUST_CREDIT_LIMIT column to NULL for all the customers, where
CUST_INCOME_LEVEL has NULL in the CUSTOMERS table. Which SQL statement will
accomplish the task?
Select one:
a. UPDATE customers
100%
b. UPDATE customers
SET cust_credit_limit = NULL
WHERE cust_income_level = NULL;
c. UPDATE customers
d. UPDATE customers
SET cust_credit_limit = NULL
WHERE cust_income_level IS NULL;
Question 3 1.00/1.00
To calculate the number of days from 1st Jan 2007 till date:
Dates are stored in the default format of dd-mm-rr.
Which SQL statements would give the required output?
Select one or more:
a. SELECT SYSDATE - '01-JAN-2007' FROM DUAL ;
The correct answers are: SELECT SYSDATE - TO_DATE('01/JANUARY/2007') FROM DUAL;, SELECT SYSDATE -
TO_DATE('01-JANUARY-2007) FROM DUAL;
Question 4 1.00/1.00
CUSTOMER_ADDRESS VARCHAR2(150)
CUSTOMER_PHONE VARCHAR2(20)
You need to produce output that states "Dear Customer customer_name, ".
100%
The customer_name data values come from the CUSTOMER_NAME column in the
CUSTOMERS table.
Select one:
a. SELECT 'Dear Customer ' || customer_name || ',' || FROM customers;
The correct answer is: SELECT 'Dear Customer ' || customer_name || ',' FROM customers;
Question 5 1.00/1.00
Question 6 1.00/1.00
100% Generate a list of all customer last names with their credit limits from the CUSTOMERS table. Customers who
do not have a credit limit should appear last in the list. kindly note that customers who do not have credit
card will have NULL against credit limit.
Select one:
a. SELECT cust_last_name,cust_credit_limit
FROM customers
ORDER BY cust_credit_limit DESC;
b. SELECT cust_last_name,cust_credit_limit
FROM customers
ORDER BY cust_last_name,cust_credit_limit NULLS LAST;
c. SELECT cust_last_name,cust_credit_limit
FROM customers;
d. SELECT cust_last_name,cust_credit_limit
FROM customers
ORDER BY cust_credit_limit;
The correct answer is: SELECT cust_last_name,cust_credit_limit
FROM customers
ORDER BY cust_credit_limit;
Question 7 1.00/1.00
100% ABC company wants to give each employee a $100 salary increment. You need to evaluate the
results from the EMP table prior to the actual modification. If you do not want to store the results in the
database, which statement is valid?
Select one:
a. You need to give the arithmetic expression that involves the salary increment in the SET clause of the
UPDATE statement.
b. You need to give the arithmetic expression that involves the salary increment in the DISPLAY
clause of the SELECT statement.
The correct answer is: You need to give the arithmetic expression that involves the salary increment in the
DISPLAY clause of the SELECT statement.
Question 8 1.00/1.00
To display the names of employees that are not assigned to a department.
Evaluate this SQL statement:
FROM employee
WHERE dept_id = NULL;
100%
Select one:
a. Change the operator in the WHERE condition.
b. Change the column in the WHERE condition.
The correct answer is: Change the operator in the WHERE condition.
Question 9 1.00/1.00
Select the suitable option for fetching the output of the following query.
select substr("Oracle World",1,6) from dual;
Select one:
a. racle W
b. racle
c. racle Wo
d. Oracle
100%
The correct answer is: Oracle
Question 10 1.00/1.00
To generate a report that shows an increase in the credit limit by 15% for all customers. Customers whose
credit limit has not been entered should have the message "Not Available" displayed.
Which SQL statement would produce the required result?
Select one:
a. SELECT NVL(cust_credit_limit,'Not Available')*.15 "NEW CREDIT"
FROM customers;
b. SELECT TO_CHAR(NVL(cust_credit_limit*.15,'Not Available')) "NEW CREDIT"
FROM customers;
c. SELECT NVL(cust_credit_limit*.15,'Not Available')"NEW CREDIT"
FROM customers;
d. SELECT NVL(TO_CHAR(cust_credit_limit*.15),'Not Available') "NEW CREDIT"
FROM customers;
The correct answer is: SELECT NVL(TO_CHAR(cust_credit_limit*.15),'Not Available') "NEW CREDIT"
FROM customers;
100%
Started on Wednesday, 11 September 2024, 5:30 PM
State Finished
Completed on Wednesday, 11 September 2024, 5:38 PM
Time taken 8 mins 14 secs
Marks 9.00/10.00
Grade 90.00 out of 100.00
Question 1 1.00/1.00
100%
GROUP BY lot_no
HAVING COUNT(*) > 10
ORDER BY COUNT(*);
In the above statement which clause restricts which groups are displayed?
Select one:
a. ORDER BY COUNT(*)
b. HAVING COUNT(*) > 10
c. GROUP BY lot_no
d. WHERE model = 'Fire'
e. SELECT lot_no "Lot Number", COUNT(*) "Number of Cars Available"
Question 2 1.00/1.00
Select the suitable option for displaying the average commission percentage of all employees, where the
commission percentage column of certain employees include NULL value.
Select one:
100%
a. select AVG(ommission_pct) from emp;
b. select AVG(NVL(commission_pct)) from emp;
c. select AVG(NVL(0,commission_pct)) from emp;
d. select AVG(NVL(commission_pct,0)) from emp;
Question 3 0.00/1.00
All columns in the SELECT list that are not in group functions must be in the GROUP-BY clause. State True or
False.
Select one:
a. FALSE
b. TRUE
The correct answer is: TRUE
Question 4 1.00/1.00
We need to analyze how long your orders take to be shipped from the date that the order is placed. To do
this, you must create a report that displays the customer number, date ordered, date shipped, and the
number of months in whole numbers from the time the order is placed to the time the order is shipped.
100%
Which statement produces the required results?
Select one:
a. SELECT custid, orderdate, shipdate,
MONTHS_BETWEEN (shipdate, orderdate)"Time Taken"
FROM ord;
b. SELECT custid, orderdate, shipdate,
ROUNDOFF(shipdate - orderdate) "Time Taken"
FROM ord;
c. SELECT custid, orderdate, shipdate,
ROUND(DAYS_BETWEEN (shipdate, orderdate))/ 30) "Time Taken"
FROM ord;
d. SELECT custid, orderdate, shipdate,
ROUND(MONTHS_BETWEEN (shipdate, orderdate))
"Time Taken" FROM ORD;
Question 6 1.00/1.00
Group functions can be used in the where clause. State True or False.
Select one:
a. FALSE
b. TRUE
ID NUMBER(7) PK
COST NUMBER(7,2)
PRODUCT_ID NUMBER(7)
100%
ROUND(MIN(cost),2),ROUND(SUM(cost),2),
ROUND(AVG(cost),2)
FROM part;
ROUND(MIN(cost),2),ROUND(SUM(cost),2),
ROUND(AVG(cost),2)
FROM part
GROUP BY product_id;
Select one:
a One of the statements will generate an error
a. One of the statements will generate an error.
b. Statement 1 will display a result for each part; statement 2 will display a result for each product.
c. The results will be the same, but the display will differ.
d. Statement 1 will only display one row of results; statement 2 could display more than one.
The correct answer is: Statement 1 will only display one row of results; statement 2 could display more than
one.
100%
Question 8 1.00/1.00
Single row functions can be nested to any level. State true or False.
Select one:
a. TRUE
b. FALSE
Question 9 1.00/1.00
We need to create a report to display the order id, ship date and order total of your ORDER table. If the order
has not been shipped, your report must display 'Not Shipped'. If the total is not available, your report must
display 'Not Available'.
p y
In the ORDER table, the SHIPDATE column has a datatype of DATE. The TOTAL column has a datatype of INT.
The correct answer is: SELECT ordid, NVL(to_char(shipdate), 'Not Shipped') SHIPDATE,
NVL(total,'Not Available')TOTAL FROM order;
Question 10 1.00/1.00
LENGTH(CONCAT(first_name, last_name))
FROM employee
2. SELECT INITCAP(first_name) || INITCAP(last_name),
LENGTH(last_name) + LENGTH(first_name)
FROM employee
Select one:
a. The statements will retrieve the same data from the database, but will display it differently.
The correct answer is: The statements will retrieve different data from the database.
Started on Wednesday, 11 September 2024, 5:38 PM
State Finished
Completed on Wednesday, 11 September 2024, 5:42 PM
Time taken 3 mins 22 secs
Marks 4.00/5.00
Grade 80.00 out of 100.00
Question 1 1.00/1.00
100%
Single row function accepts only a single argument. State true or false.
Select one:
True
False
Question 2 1.00/1.00
Using the CUSTOMERS table, you need to generate a report that shown the average credit limit for customers
in WASHINGTON and NEW YORK. Which SQL statement would produce the required result?
Question 3 1.00/1.00
Which of the following clause is the last clause in the select statement?
Select one:
Group By
Where
Having
Order By
100%
Question 4 0.00/1.00
Choose the missing clauses in the order of execution of a query._______ , where, _______ , having ,
_________ , order by.
Select one:
select,group by,from
select,from,group by
from,group by,select
from,select,group by
Your answer is incorrect.
The correct answer is:
from,group by,select
Question 5 1.00/1.00
100%
State True or False. Single row functions work on single row and gives single output per row whereas
aggregate functions work on multiple rows and gives single output as a whole.
Select one:
True
False
Question 1 1.00/1.00
100%
Promotions Table
Promo_id Number PK
Promo_name Varchar
Promo_begin_date Date
Promo_end_date Date
Sales Table
Promo_id Number FK
Cust_id Number FK
Time_id Date
Customer Table
cust_id Number PK
cust_name Varchar
The Below query will generate a report showing the promo name along with the
customer name for all products that were sold during their promo campaign and before 30th October 2007.
100%
SELECT promo_name,cust_name FROM promotions p JOIN sales s
ON(time_id BETWEEN promo_begin_date AND promo_end_date)
Select one:
a. It produces an error because the join order of the tables is incorrect.
d. It produces an error because equijoin and nonequijoin conditions cannot be used in the same
Question 2 1.00/1.00
The COMMISSION column shows the monthly commission earned by the employee.
Emp_Id Dept_Id Commission
100%
1 10 500
2 20 1000
3 10
4 10 600
5 30 800
6 30 200
7 10
8 20 300
Which tasks would require sub queries or joins in order to be performed in a single
step?
100%
Question 3 1.00/1.00
To create a report displaying employee last names, department names, and locations. Which query should
you use to create an equi-join?
Select one:
a. SELECT employees.last_name, departments.department_name,
Your answer is correct.
Question 4 1.00/1.00
b. It returns an error because the BETWEEN operator cannot be used in the HAVING clause.
c. It returns an error because WHERE and HAVING clauses cannot be used to apply conditions on the
same column.
d. It returns an error because WHERE and HAVING clauses cannot be used in the same SELECT
statement.
100%
e. It executes successfully.
Question 5 1.00/1.00
Which statements are true regarding the USING and ON clauses in table joins?
b. Both USING and ON clause can be used for equijoins and nonequijoins
c. The ON clause can be used to join tables on columns that have different names but compatible
data types.
d. Maximum of one pair of columns can be joined between two tables using the ON clause
Question 6 1.00/1.00
The following query is written to retrieve all those product IDs from the SALES table that have more than
55000 sold and have been ordered more than 10 times:
SELECT prod_id FROM sales WHERE quantity_sold > 55000 AND COUNT(*)>10
GROUP BY prod_id HAVING COUNT(*)>10;
Select one:
a. It produces an error because COUNT (*) should be only in the HAVING clause and not in the WHERE
clause.
b. It executes successfully but produces no result because COUNT(prod_id) should be used instead of
COUNT(*) .
c. It executes successfully and generates the required result.
d. It produces an error because COUNT (*) should be specified the SELECT clause also.
The correct answer is: It produces an error because COUNT (*) should be only in the HAVING clause and not
in the WHERE clause.
Question 7 1.00/1.00
100%
Which SQL statement produces an error?
Select one:
a. SELECT department_id, job_id, AVG(salary)
FROM emp_dept_vu
GROUP BY department_id, job_id;
b. SELECT department_id, SUM(salary)
FROM emp_dept_vu
GROUP BY department_id;
c. SELECT job_id, SUM(salary)
FROM emp_dept_vu
WHERE department_id IN (10,20)
GROUP BY job_id
HAVING SUM(salary) > 20000;
d. SELECT *
FROM emp_dept_vu;
e. None of the statements produce an error; all are valid.
Th i N f h d ll lid
The correct answer is: None of the statements produce an error; all are valid.
Question 8 1.00/1.00
Which statement would display the highest credit limit available in each income level in each city in the
Customers table?
Select one:
100%
a. SELECT cust_city, cust_income_level,MAX(cust_credit_limit)
FROM customers
GROUP BY cust_city , , cust_income_level ,MAX(cust_credit_limit);
b. SELECT cust_city, cust_income_level,MAX(cust_credit_limit)
FROM customers
GROUP BY cust_city, cust_income_level,cust_credit_limit;
c. SELECT cust_city, cust_income_level,MAX(cust_credit_limit)
FROM customers
GROUP BY cust_credit_limit , cust_income_level, cust_city ;
d. SELECT cust_city, cust_income_level,MAX(cust_credit_limit)
FROM customers
GROUP BY cust_city, cust_income_level;
To display the names of employees who earns more than the average salary of all
employees.
100%
Which change should you make to achieve the desired results?
Select one:
a. Move the function to the SELECT clause and add a GROUP BY clause and a HAVING clause.
b. Move the function to the SELECT clause and add a GROUP BY clause.
c. Use a subquery in the WHERE clause to compare the average salary value.
The correct answer is: Use a subquery in the WHERE clause to compare the average salary value.
Question 10 1.00/1.00
Question 1 1.00/1.00
100%
b. ALL
c. ANY
d. IN
Question 2 1.00/1.00
The correct answer is: There is more than one employee with the first name Scott.
Question 3 1.00/1.00
Product Table
Column Name DataType Constraint
prod_name Varchar2(20)
prod_id Number(10) PK
Customer Table
Column Name DataType Constraint
cust_last_name Varchar2(20)
100%
cust_id Number(10) PK
cust_city Varchar2(20)
Sales Table
prod_id Number(10) FK
cust_id Number(10) FK
quantity_sold Number(10,2)
Generate a report that gives details of the customer's last name, name of the product and the quantity sold
for all customers in 'Tokyo'.
USING (prod_id)
JOIN customers c
USING (cust_id)
WHERE c.cust_city='Tokyo';
b. SELECT c.cust_last_name,p.prod_name,s.quantity_sold
ON(s.cust_id=c.cust_id)
WHERE c.cust_city='Tokyo';
c. SELECT c.cust_last_name,p.prod_name,s.quantity_sold
JOIN customers c
USING(cust_id)
WHERE c.cust_city='Tokyo';
d. SELECT c.cust_last_name,p.prod_name,s.quantity_sold
ON(s.cust_id=c.cust_id)
WHERE c.cust_city='Tokyo';
Your answer is correct.
The correct answers are: SELECT c.cust_last_name,p.prod_name,s.quantity_sold
FROM sales s JOIN products p
USING (prod_id)
JOIN customers c
USING (cust_id)
WHERE c.cust_city='Tokyo';, SELECT c.cust_last_name,p.prod_name,s.quantity_sold
FROM products p JOIN sales s
100%
ON(p.prod_id=s.prod_id)
JOIN customers c
ON(s.cust_id=c.cust_id)
WHERE c.cust_city='Tokyo';
Question 4 1.00/1.00
Which SELECT statement displays all the employees who do not have any subordinates?
Select one:
a. SELECT e.ename
FROM emp e
WHERE e.empno NOT IN (SELECT m.mgr
FROM emp m);
b. SELECT e.ename
FROM emp e
c. SELECT e.ename
FROM emp e
WHERE e.empno IN (SELECT m.mgr
FROM emp m);
d. SELECT e.ename
FROM emp e
100%
WHERE e.mgr IS NOT NULL;
Question 5 1.00/1.00
In which two cases would you use the USING clause? (Choose two)
b. The tables to be joined have columns with the same name and compatible data types.
c. The tables to be joined have multiple NULL columns.
Your answer is correct.
The correct answers are: The tables to be joined have columns of the same name and different data types.,
The tables to be joined have columns with the same name and compatible data types.
100%
Question 6 1.00/1.00
Employee Table
Name Varchar2(20)
Empno Number(10) PK
salary Number(10,2)
Tax Table
Taxgrade Number
Lowsal Number(10)
highsal Number(10,2)
We want to create a report that displays the employee details along with the tax category of each
employee. The tax category is determined by comparing the salary of the employee from the EMP table to
the lower and upper salary values in the TAX table.
Which SELECT statement produces the required results?
Select one:
a. SELECT e.name, e.salary, t.taxgrade
Question 7 1.00/1.00
SELECT last_name, first_name
FROM employee
WHERE salary IN
100% (SELECT salary
FROM employee
WHERE dept_no = 3 OR dept_no = 5);
Which values are displayed?
Select one:
a. last name and first name of only the employees whose salary falls in the range of salaries from
department 3 or 5
b. last name and first name of all employees except those working in department 3 or 5
c. last name and first name of only the employees in department number 3 or 5
d. last name and first name of all employees with the same salary as employees in department 3 or
5
Which operator is NOT appropriate in the join condition of a non-equi join SELECT statement?
Select one:
a. IN operator
b. BETWEEN x AND y operator
100%
c. LIKE operator
d. equal operator
Question 9 0.00/1.00
Select one:
a. The tables being joined have only matched data.
100%
Question 10 1.00/1.00
To display the names of employees who earns more than the average salary of all
employees.
Select one:
a. Move the function to the SELECT clause and add a GROUP BY clause.
c. Move the function to the SELECT clause and add a GROUP BY clause and a HAVING clause.
d. Use a subquery in the WHERE clause to compare the average salary value.
Your answer is correct.
The correct answer is: Use a subquery in the WHERE clause to compare the average salary value.
100%
Started on Wednesday, 11 September 2024, 7:39 PM
State Finished
Completed on Wednesday, 11 September 2024, 7:41 PM
Time taken 1 min 44 secs
Marks 4.00/5.00
Grade 80.00 out of 100.00
Question 1 1.00/1.00
100%
You issue the following SQL statement on the CUSTOMERS table to display the customers who are in the
same country as customers with the last name 'king' and whose credit limit is less than the maximum credit
limit in countries that have customers with the last name 'king'.
Which statement is true regarding the outcome of the above query?
Select one:
a. It produces an error and the < operator should be replaced by < ALL to get the required output.
100% b. It produces an error and the < operator should be replaced by < ANY to get the required output
c. It produces an error and the IN operator should be replaced by = in the WHERE clause of the main
query to get the required output
The correct answer is: It executes and shows the required result.
Question 2 1.00/1.00
100%
Your answer is correct.
The correct answers are: Field names in the SELECT statement., The FROM clause in the SELECT statement, The
HAVING clause in the SELECT statement, The WHERE clause in the SELECT as well as all DML statements
Question 3 1.00/1.00
The NOT operator can be used with IN, ANY, and ALL operators in multiple-row subqueries. State true or false.
Select one:
True
False
Main query and subquery can get data from different tables.
Select one:
True
False
100%
Question 5 0.00/1.00
Select one:
Select
Insert
Delete
Update
100%
Started on Wednesday, 11 September 2024, 7:41 PM
State Finished
Completed on Wednesday, 11 September 2024, 7:47 PM
Time taken 5 mins 51 secs
Marks 9.00/10.00
Grade 90.00 out of 100.00
Question 1 1.00/1.00
100%
Customer Table
custNo Number PK
custname Varchar
custaddress varchar
Cust_credit_limit Number
Grade Table
Grade Varchar
Startval Number
Endval Number
To display names and grades of customers who have the highest credit limit.
Which SQL statements would accomplish the task?
Select one or more:
a. SELECT custname, grade
FROM customers)
AND cust_credit_limit BETWEEN startval AND endval;
100%
Question 2 1.00/1.00
Select one:
a. Outer Join
b. Self Join
c. Equi Join
The _______ join is based on all columns in the two tables that have the same column name.
Select one:
a. Cross
b. Left Outer
c. Natural
100%
d. Full Outer
Question 4 1.00/1.00
order_id Number PK
Order_date Date
Order_mode varchar
Customer_id Number
Order_total Number(8,2)
There is only one customer with the CUST_LAST_NAME column having value Roberts. Which INSERT
statement should be used to add a row into the ORDERS table for the customer whose CUST_LAST_NAME is
Roberts and CREDIT_LIMIT is 600?
Select one:
a. INSERT INTO orders ( order_id ,order _date,order_mode , (SELECT customer_id FROM customers
FROM customers
WHERE cust_last_name ='Roberts' AND
d. INSERT INTO orders ( order_id ,order _date,order_mode , (SELECT customer_id FROM customers
100%
Question 5 1.00/1.00
Mr. John is the president of a company. Five managers report to him. All other employees report to these
managers.
Select one:
a. None of the employees has a manager.
Question 6 1.00/1.00
Prod_id Number PK
Prod_name Varchar
Prod_list_price varchar
Cust_credit_limit Number
Select one:
a It shows the names of all products in the table
a. It shows the names of all products in the table.
b. It produces an error
c. It shown the names of all products whose list price is less than the maximum list price
d. It shown the names of products whose list price is the second highest in the table
Your answer is correct.
The correct answer is: It shown the names of products whose list price is the second highest in the table
100%
Question 7 1.00/1.00
_____ is used to retrieve records that do not meet the join condition
Select one:
a. Self Join
b. Outer Join
d. Equi Join
To delete rows from the SALES table, where the PROMO_NAME column in the
PROMOTIONS table has either 'blowout sale' or 'everyday low price' as values.
Which DELETE statements are valid? (Choose all that apply.)
Select one or more:
a. DELETE
100%
FROM sales
b. DELETE
FROM sales
WHERE promo_id IN (SELECT promo_id
FROM promotions
WHERE promo_name IN ('blowout sale','everyday low price'));
c. DELETE
FROM sales
WHERE promo_id = (SELECT promo_id
FROM promotions
WHERE promo_name = 'blowout sale')
OR promo_id = (SELECT promo_id
FROM promotions
WHERE promo_name = 'everyday low price');
d. DELETE
FROM sales
WHERE promo_id = (SELECT promo_id
FROM promotions
WHERE promo_name = 'blowout sale')
AND promo_id = (SELECT promo_id
FROM promotions
WHERE promo_name = 'everyday low price');
100%
Select one:
a. Simple Join
b. Outer Join
100%
c. Equal Join
d. Self Join
Question 10 1.00/1.00
Select one:
a. Equi
b. Outer
c. Self
d. Cross
Your answer is correct.
The correct answer is: Cross
100%
Started on Wednesday, 11 September 2024, 7:48 PM
State Finished
Completed on Wednesday, 11 September 2024, 7:56 PM
Time taken 7 mins 45 secs
Marks 9.00/10.00
Grade 90.00 out of 100.00
Question 1 1.00/1.00
100%
Which of the following statements are true with respect to the above index?
Select one:
a. Increase the chance of full table scans.
b. Override the unique index created when the FK relationship was defined.
f. DELETE emp_dept_vu;
Question 3 1.00/1.00
You need to create the patient_id_seq sequence to be used with the patient table's primary key column.
The sequence should begin at 1000, have a maximum value of 999999999, never reuse any numbers, and
increment by 1.
MINVALUE 1000
MAXVALUE 999999999
INCREMENT BY 1
NOCYCLE;
Question 5 1.00/1.00
Create or replace view Employees as Select emp_id,dep_name from employee_master natural join
department_info;
In the above complex view insert,update and delete operations are possible. State true or false.
Select one:
True
False
The correct answer is 'False'.
Question 6 1.00/1.00
100%
Select one:
Question 7 1.00/1.00
The owner has all the privileges on the object. State true or False.
Select one:
True
True
False
Question 8 1.00/1.00
100%
An owner can give specific privileges on the owner's objects to others. State True or False.
Select one:
True
False
Question 9 1.00/1.00
Select one:
a. Unique Index
Your answer is correct.
100%
Question 10 1.00/1.00
Which object privileges can be granted on a view?
Select one:
a. DELETE, INSERT, SELECT, UPDATE
b. none
c. DELETE, INSERT,SELECT