MySQL Quizzes
MySQL Quizzes
Quiz review
Started on Saturday, 13 January 2024, 3:40 PM
State Finished
Completed on Saturday, 13 January 2024, 3:41 PM
Time taken 41 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
Which of the following are considered as constraints?
Question 2
Correct
45257
Mark 1.00 out of 1.00
Select one:
Domain
No of rows
No of Attributes
Cardinality
45257
The correct answer is: No of Attributes
Question 3
Correct
Question 4
Correct
45257
Which of the following are DML statements?
45257
The correct answers are: SELECT, INSERT
Question 5
Correct
Database is a shared collection of logically unrelated data, designed to meet the needs of an organization. State True or False.
Select one:
TRUE
FALSE
Jump to...
RDBMS Introduction ►
Dashboard / My courses / MySQL Database / RDBMS Concepts / Post-Quiz
Quiz review
Started on Saturday, 13 January 2024, 4:04 PM
State Finished
Completed on Saturday, 13 January 2024, 4:06 PM
Time taken 1 min 48 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
Tom has designed a payroll software for XYZ technology.The sofware will store the salary details into the database and later he can
retreive the same for future references. Tom falls under which category of user.
Select one:
End User
Application Programmer
DBA
Network Administrator
Select one:
Oracle 45257
Sybase
MySQL
Unify
Question 3
Correct
45257
Question 4
Correct
Terms of Relational
_______ refers to the range of values that can be stored for an attribute
Domain
Tuples
The correct answer is: ______ refers to the columns of the table → Attribute, _______ refers to the range of values that can be stored for an attribute →
Domain, _______ refers to number of columns in the table → Degree, ________ refers to number of rows in the table → cardinality, ______ refers to the rows of
the table → Tuples
Question 5
Correct
Select one:
True
False
◄ RDBMS Concepts
Jump to...
45257
45257
45257
Dashboard / My courses / MySQL Database / Data Definition Language / Pre-Quiz
Quiz review
Started on Saturday, 13 January 2024, 4:21 PM
State Finished
Completed on Saturday, 13 January 2024, 4:24 PM
Time taken 3 mins 13 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
A relational database consists of a collection of
Select one:
Fields
Tables
Keys
Records
Select one:
composite key
primary key
foreign key
45257
secondary key
Question 3
Correct
___________ removes data from the table, but structure remains the same.
Select one:
Truncate
Drop
Trunc
Question 4
Correct
45257
Mark 1.00 out of 1.00
Select one:
Deletion
Sorting
Updating
Insertion 45257
Your answer is correct.
The correct answer is: Sorting
Question 5
Correct
Attributes
Table
Tuples
Relation
◄ ER Model & Normalization - Presentation Deck
Jump to...
45257
45257
45257
Dashboard / My courses / MySQL Database / Data Definition Language / Post-Quiz
Quiz review
Started on Saturday, 13 January 2024, 5:10 PM
State Finished
Completed on Saturday, 13 January 2024, 5:16 PM
Time taken 6 mins 14 secs
Marks 4.00/5.00
Grade 80.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
An emp table contains fields employ name, desig and salary. How do you drop column salary?
Select one:
delete from emp where column = salary;
alter table emp delete column salary;
alter table emp delete salary;
alter table emp drop column salary;
The correct answer is: alter table emp drop column salary;
Question 2
Incorrect
Select one:
table level check constraint
Question 3
Correct
cardholderphoneno unique
The correct answer is: cardholdername → not null, creditcardtype should be sliver or platinum only → check, validitydate → not null, creditcardno → primary
45257
key, cardholderphoneno → unique
Question 4
Correct
Select one:
alter table emp add column_name varchar(25);
alter table emp drop column column_name;
alter emp drop column_name;
alter table emp modify name varchar(30);
45257
The correct answer is: alter emp drop column_name;
Question 5
Correct
Select one:
45257
2
1
4
Any number
◄ Drop 1
Jump to...
Pre-Quiz ►
45257
45257
45257
Dashboard / My courses / MySQL Database / Data Manipulation Language / Pre-Quiz
Quiz review
Started on Saturday, 13 January 2024, 6:29 PM
State Finished
Completed on Saturday, 13 January 2024, 6:35 PM
Time taken 5 mins 55 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
Which of the below is a reference option for deleting rows from a table?
Select one:
Restrict
Set Null
Cascade
Select one:
All the options
Delete
Drop
45257
Truncate
Question 3
Correct
Select one:
MM-YYYY-DD
YYYY-MM-DD
NONE
DD-MON-YYYY
45257
Your answer is correct.
The correct answer is: YYYY-MM-DD
Question 4
Correct
Natural number
Rational number
Whole number
45257
Your answer is correct.
Question 5
Correct
Truncate table table_name;
Drop table table_name;
◄ Post-Quiz
Jump to...
45257
45257
Dashboard / My courses / MySQL Database / Data Manipulation Language / Post-Quiz
Quiz review
Started on Wednesday, 17 January 2024, 2:30 PM
State Finished
Completed on Wednesday, 17 January 2024, 2:31 PM
Time taken 34 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
Which among the following tags belong to DML?
DELETE
CREATE
UPDATE
45257
The correct answers are: UPDATE, DELETE
Question 2
Correct
Select one:
FALSE
TRUE 45257
Your answer is correct.
The correct answer is: TRUE
Question 3
Correct
EmpId int(10) PK
When we issue the above insert command and if the statement fails,
what would be the reason.
45257
Select one:
The column order should not be changed.
Question 4
Correct
45257
Mark 1.00 out of 1.00
Merge is not supported by MySQL. The other possible way of doing the work of merge statement, is by using ON DUPLICATE KEY UPDATE in the insert
statement. State TRUE or FALSE.
Select one:
FALSE
TRUE
Stud_id int(3) PK
Address Varchar(30)
DOB Date
Select one:
45257
INSERT INTO student (stud_id, address, dob)
45257
The correct answer is: INSERT INTO student (stud_id, address, name, dob)
VALUES (101,'100 Main Street','Smith','1994-02-01');
◄ Delete 2
Jump to...
Pre-Quiz ►
45257
Dashboard / My courses / MySQL Database / SQL Select Statement / Pre-Quiz
Quiz review
Started on Friday, 19 January 2024, 10:40 PM
State Finished
Completed on Friday, 19 January 2024, 10:48 PM
Time taken 7 mins 34 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
Which statements are true regarding constraints?
45257
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 2
Correct
Isnull 45257
checks whether a value is null or not.
Question 3
Correct
Which statements describe the consequence of issuing the ROLLBACK TO SAVE POINT a command in the session?
45257
Select one:
Only the DELETE statements are rolled back.
Both the DELETE statements and the UPDATE statement are rolled back.
Question 4
45257
Correct
Select one:
The DROP TABLE command can be executed on a table on which there are pending
transactions.
The table structure and its deleted data cannot be rolled back and restored once the DROP TABLE command is executed.
45257
Any pending transactions on the table are rolled back.
Question 5
Correct
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:
This task cannot be accomplished.
45257
◄ Post-Quiz
Jump to...
45257
45257
Dashboard / My courses / MySQL Database / SQL Select Statement / Post-Quiz
Quiz review
Started on Friday, 19 January 2024, 10:39 PM
State Finished
Completed on Friday, 19 January 2024, 10:40 PM
Time taken 41 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
Select the suitable option for retrieving all the employees whose last name is "kumar"?
Select one:
select * from employee where empname like 'kumar';
select * from employee where empname like '%kumar%';
select * from employee where empname like '%kumar';
select * from employee where empname like 'kumar%';
The correct answer is: select * from employee where empname like '%kumar';
Question 2
Correct
45257
Mark 1.00 out of 1.00
Select one:
Date values are displayed in descending order by default.
Null values are displayed first in ascending sequences.
You cannot specify a column alias in an ORDER BY clause.
You cannot sort query results by a column that is not included the SELECT list.
45257
The results are sorted by the first column in the SELECT list if the ORDER BY clause is not
provided.
The correct answer is: Null values are displayed first in ascending sequences.
Question 3
Correct
Select the suitable option for retrieving all the employees who have a manager?
Select one:
select empname, manager_id from employee where manager_id NULL;
select empname, manager_id from employee where manager_id is NULL VALUE;
select empname, manager_id from employee where manager_id is NOT NULL;
select empname, manager_id from employee where manager_id is NULL;
The correct answer is: select empname, manager_id from employee where manager_id is NOT NULL;
Question 4
Correct
45257
How to retrieve department_id column without any duplication from employee relation?
Select one:
select department_id from employee;
select all department_id from employee;
select department_id distinct from employee;
select distinct department_id from employee;
45257
The correct answer is: select distinct department_id from employee;
Question 5
Correct
Select the suitable option for retrieving all the employees whose salary range is between 40000 and 100000?
45257
select name,salary from employee where salary between 40000 100000;
select name,salary from employee where salary lies between 40000 and 100000;
select name,salary from employee where salary>=40000 and salary<=100000;
The correct answers are: select name,salary from employee where salary between 40000 and 100000;, select name,salary from employee where
salary>=40000 and salary<=100000;
Jump to...
Pre-Quiz ►
45257
45257
45257
Dashboard / My courses / MySQL Database / Function-Scalar & Aggregate / Pre-Quiz
Quiz review
Started on Friday, 19 January 2024, 10:58 PM
State Finished
Completed on Friday, 19 January 2024, 10:58 PM
Time taken 23 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
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.
Select one:
SELECT IFNULL(cust_credit_limit * 0.15,'Not Available') "NEW CREDIT"
FROM customers;
SELECT NULLIF(cust_credit_limit*.15,'Not Available')"NEW CREDIT"
FROM customers;
SELECT TO_CHAR(NVL(cust_credit_limit*.15,'Not Available')) "NEW CREDIT"
FROM customers;
45257
All the options
The correct answer is: SELECT IFNULL(cust_credit_limit * 0.15,'Not Available') "NEW CREDIT"
FROM customers;
Question 2
Correct
Which statement is true regarding the default behavior of the ORDER BY clause?
Select one:
45257
Only those columns that are specified in the SELECT list can be used in the ORDER BY clause
In a character sort, the values are case-sensitive
NULL values are not considered at all by the sort operation
Numeric values are displayed from the maximum to the minimum value if they have decimal positions
The correct answer is: In a character sort, the values are case-sensitive
Question 3
Correct
FROM employee
Select one:
Create an outer join.
45257
Add a second condition to the WHERE condition.
The correct answer is: Change the operator in the WHERE condition.
Question 4
Correct
45257
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:
You need to give the arithmetic expression that involves the salary increment in the SET clause
of the UPDATE statement.
You need to give the arithmetic expression that involves the salary increment in the DISPLAY
45257
You need to add a column to the EMP table.
You need to give the arithmetic expression that involves the salary increment in the UPDATE
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 5
Correct
Select the suitable option for fetching the output of the following query. select substr("Oracle World",1,6) from dual;
Select one:
racle Wo
racle W
racle
Oracle
◄ Post-Quiz
45257
45257
Dashboard / My courses / MySQL Database / Function-Scalar & Aggregate / Post-Quiz
Quiz review
Started on Wednesday, 24 January 2024, 12:51 AM
State Finished
Completed on Wednesday, 24 January 2024, 12:51 AM
Time taken 42 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
Single row functions can be nested to any level. State true or False.
Select one:
FALSE
TRUE
Question 2
45257
Correct
Group functions can be used in the where clause. State True or False.
Select one:
FALSE
TRUE
45257
Question 3
Correct
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'.
In the ORDER table, the SHIPDATE column has a datatype of DATE. The TOTAL column has a
datatype of INT.
Select one:
SELECT ordid,TO_CHAR(shipdate, 'Not Shipped'),
TO_CHAR(total,'Not Available')
45257
FROM order;
SELECT ordid, IFNULL(shipdate, 'Not Shipped') SHIPDATE,
IFNULL(total,'Not Available')TOTAL FROM order;
FROM order;
SELECT ordid, IFNULL(shipdate, 'Not Shipped') as SHIPDATE,Total FROM order;
SELECT ordid, shipdate "Not Shipped",
total "Not Available"
FROM order;
The correct answer is: SELECT ordid, IFNULL(shipdate, 'Not Shipped') SHIPDATE,
IFNULL(total,'Not Available')TOTAL FROM order;
FROM order;
Question 4
45257
Correct
Select one:
6
5.0
45257
None of the options
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:
FALSE
TRUE
Jump to...
45257 Pre-Quiz ►
45257
45257
Dashboard / My courses / MySQL Database / Joins & SubQuery / Pre-Quiz
Quiz review
Started on Saturday, 27 January 2024, 1:38 PM
State Finished
Completed on Saturday, 27 January 2024, 1:48 PM
Time taken 10 mins 38 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
Which SQL statement produces an error?
Select one:
None of the statements produce an error; all are valid.
SELECT *
FROM emp_dept_vu;
SELECT job_id, SUM(salary)
FROM emp_dept_vu
WHERE department_id IN (10,20)
GROUP BY job_id
45257
HAVING SUM(salary) > 20000;
SELECT department_id, job_id, AVG(salary)
FROM emp_dept_vu
GROUP BY department_id, job_id;
SELECT department_id, SUM(salary)
FROM emp_dept_vu
GROUP BY department_id;
The correct answer is: None of the statements produce an error; all are valid.
45257
Question 2
Correct
The COMMISSION column shows the monthly commission earned by the employee.
1 10 500
2 20 1000
3 10
4 10 600
5 30 800
6 30 200
7 10
8 20 300
45257
Which tasks would require sub queries or joins in order to be performed in a single
step?
Listing the employees who earn the same amount of commission as employee 3
Finding the number of employees who earn a commission that is higher than the average commission of the company
45257
Listing the employees who do not earn commission and who are working for department 20 in descending order of the employee
ID
45257
The correct answers are: Listing the employees who earn the same amount of commission as employee 3, Finding the number of employees who earn a
commission that is higher than the average commission of the company
Question 3
Correct
What statement would display the age of Customers with the alias name as AGE?
Select one:
select round((birth_date)-Birth_date)/365) from customer;
Question 4
45257
Correct
Which statement would display the highest credit limit available in each income level in each city in
Select one:
SELECT cust_city, cust_income_level,MAX(cust_credit_limit)
FROM customers
GROUP BY cust_city , cust_income_level ,MAX(cust_credit_limit);
SELECT cust_city, cust_income_level,MAX(cust_credit_limit)
FROM customers
45257
GROUP BY cust_credit_limit , cust_income_level, cust_city ;
SELECT cust_city, cust_income_level,MAX(cust_credit_limit)
FROM customers
GROUP BY cust_city, cust_income_level;
SELECT cust_city, cust_income_level,MAX(cust_credit_limit)
FROM customers
GROUP BY cust_city, cust_income_level,cust_credit_limit;
45257
Question 5
Correct
To create a report displaying employee last names, department names, and locations. Which query should you use to create an equi-
join?
Select one:
SELECT e.last_name, d.department_name, d.location_id
FROM employees e, departments d
45257
FROM employees , departments ;
45257
◄ Post-Quiz
Jump to...
45257
Dashboard / My courses / MySQL Database / Joins & SubQuery / Post-Quiz
Quiz review
Started on Saturday, 27 January 2024, 1:55 PM
State Finished
Completed on Saturday, 27 January 2024, 1:56 PM
Time taken 33 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
In which cases would you use an outer join?
Select one:
The tables being joined have both matched and unmatched data.
Question 2
Correct
Which operator is NOT appropriate in the join condition of a non-equi join SELECT statement?
45257
Select one:
greater than or equal to operator
equal operator
IN operator
LIKE operator
In which two cases would you use the USING clause? (Choose two)
The tables to be joined have columns with the same name and compatible data types.
The tables to be joined have columns of the same name and different data types.
Question 4
45257
Correct
ANY
ALL
IN
45257
Your answer is correct.
45257
Question 5
Correct
To display the names of employees who earns more than the average salary of all
employees.
Select one:
Use a subquery in the WHERE clause to compare the average salary value.
Move the function to the SELECT clause and add a GROUP BY clause.
45257
Move the function to the SELECT clause and add a GROUP BY clause and a HAVING clause.
Jump to...
45257 Pre-Quiz ►
45257
Dashboard / My courses / MySQL Database / DCL & Database Objects / Pre-Quiz
Quiz review
Started on Saturday, 27 January 2024, 2:49 PM
State Finished
Completed on Saturday, 27 January 2024, 2:50 PM
Time taken 28 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
_____ is used to retrieve records that do not meet the join condition
Select one:
Equi Join
Outer Join
Self Join
Select one:
Self Join
Outer Join
Equal Join
45257
Simple Join
Select one:
Self Join
Equi Join
Outer Join
Question 4
Correct
45257
Mark 1.00 out of 1.00
The _______ join is based on all columns in the two tables that have the same data type.
Select one:
Full Outer
Left Outer
Natural
Cross 45257
Your answer is correct.
The correct answer is: Natural
Question 5
Correct
45257
The _______ join produces the cross product of two tables.
Select one:
Equi
Cross
Self
Outer
Jump to...
45257
45257
45257
Dashboard / My courses / MySQL Database / DCL & Database Objects / Post-Quiz
Quiz review
Started on Saturday, 27 January 2024, 2:51 PM
State Finished
Completed on Saturday, 27 January 2024, 2:53 PM
Time taken 2 mins 55 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!!! You have passed by securing more than 80%
Question 1
Correct
45257
Which SQL statement would you use to remove a view called EMP_DEPT_VU from your schema?
Select one:
DELETE emp_dept_vu;
DROP emp_dept_vu;
REMOVE emp_dept_vu;
45257
Your answer is correct.
The correct answer is: DROP VIEW emp_dept_vu;
Question 2
Correct
Select one:
grant select on department to ALL;
45257
grant select on department to PUBLIC;
An owner can give specific privileges on the owner's objects to others. State True or False.
Select one:
True
False
Question 4
Correct
Select one:
Override the unique index created when the FK relationship was defined.
45257
May reduce the amount of disk I/O for SELECT statements.
The correct answer is: May reduce the amount of disk I/O for SELECT statements.
Question 5
Correct
45257
The owner has all the privileges on the object. State true or False.
Select one:
True
False
◄ Create Index
Jump to...
45257
45257
45257