0% found this document useful (0 votes)
692 views42 pages

MySQL Quizzes

Uploaded by

jeyovi4094
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
692 views42 pages

MySQL Quizzes

Uploaded by

jeyovi4094
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

 Dashboard / My courses / MySQL Database / RDBMS Concepts / Pre-Quiz

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

Mark 1.00 out of 1.00

45257
Which of the following are considered as constraints?

Select one or more:


NOT NULL
NULL
Check
Unique

The correct answers are: NOT NULL, Unique, Check

Question 2
Correct
45257
Mark 1.00 out of 1.00

Which of the following represents the degree of the relation?

Select one:
Domain
No of rows
No of Attributes
Cardinality

45257
The correct answer is: No of Attributes
Question 3
Correct

Mark 1.00 out of 1.00

Which of the following are data models?

Select one or more:


Conceptual
Network
Relational
Hierarchical

The correct answers are: Hierarchical, Network, Relational

Question 4
Correct

Mark 1.00 out of 1.00

45257
Which of the following are DML statements?

Select one or more:


INSERT
TRUNCATE
CREATE
SELECT

45257
The correct answers are: SELECT, INSERT

Question 5
Correct

Mark 1.00 out of 1.00

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

The correct answer is: FALSE


45257

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

Mark 1.00 out of 1.00

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

Your answer is correct.


The correct answer is: Application Programmer
45257
Question 2
Correct

Mark 1.00 out of 1.00

Which of the following is not a valid relational database?

Select one:
Oracle 45257
Sybase

MySQL

Unify

Your answer is correct.


The correct answer is: Unify


Question 3
Correct

Mark 1.00 out of 1.00

Choose Correct Option

Data is represented in the form of a graph - network 

Data is represented in the form of a tree - hierarchical 

Data is represented in the form of a table - relational 

Your answer is correct.


The correct answer is: Data is represented in the form of a graph - → network, Data is represented in the form of a tree - → hierarchical, Data is represented
in the form of a table - → relational

45257
Question 4
Correct

Mark 1.00 out of 1.00

Terms of Relational

______ 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

______ refers to the rows of the table


45257 cardinality

Tuples

Your answer is correct.

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

Mark 1.00 out of 1.00 45257


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 

The correct answer is 'False'.

◄ RDBMS Concepts

Jump to...

ER Model & Normalization Intro Video ►

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

Mark 1.00 out of 1.00

45257
A relational database consists of a collection of

Select one:
Fields

Tables

Keys

Records

Your answer is correct.

The correct answer is: Tables


45257
Question 2
Correct

Mark 1.00 out of 1.00

In a relational database a referential integrity constraint can be done using

Select one:
composite key

primary key

foreign key
45257
secondary key

Your answer is correct.


The correct answer is: foreign key


Question 3
Correct

Mark 1.00 out of 1.00

___________ removes data from the table, but structure remains the same.

Select one:
Truncate

None of the options

Drop

Trunc

Your answer is correct.


The correct answer is: Truncate

Question 4
Correct
45257
Mark 1.00 out of 1.00

Which of the following is not modification of the database

Select one:
Deletion

Sorting

Updating

Insertion 45257
Your answer is correct.
The correct answer is: Sorting

Question 5
Correct

Mark 1.00 out of 1.00

Column header is referred as 45257


Select one:
Domain

Attributes

Table

Tuples

Relation

Your answer is correct.


The correct answer is: Attributes


◄ ER Model & Normalization - Presentation Deck

Jump to...

Data Definition Language - Introduction ►

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

Mark 1.00 out of 1.00

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

Mark 0.00 out of 1.00


45257
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:
table level check constraint

column level foreign key constraint

table level foreign key constraint


45257
column level check constraint 

Your answer is incorrect.


The correct answer is: table level check constraint


Question 3
Correct

Mark 1.00 out of 1.00

Choose the correct option

cardholdername not null 

creditcardtype should be sliver or platinum only check 

validitydate not null 

creditcardno primary key 

cardholderphoneno unique 

Your answer is correct.

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

Mark 1.00 out of 1.00

Which of the following options is not 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

Mark 1.00 out of 1.00

A table consists of ______ primary keys.

Select one:
45257
2
1
4
Any number

The correct answer is: 1

◄ 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

Mark 1.00 out of 1.00

45257
Which of the below is a reference option for deleting rows from a table?

Select one:
Restrict

All the options

Set Null

Cascade

Your answer is correct.


The correct answer is: Cascade
45257
Question 2
Correct

Mark 1.00 out of 1.00

To remove a relation from SQL database, we use ___________ command.

Select one:
All the options

Delete

Drop
45257
Truncate

Your answer is correct.

The correct answer is: Drop


Question 3
Correct

Mark 1.00 out of 1.00

What is the Default format for ‘Date’ datatype?

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

Mark 1.00 out of 1.00

Numeric datatype is used to store_______


45257
Select one:

Natural number

Rational number

Both whole and natural numbers.

Whole number

45257
Your answer is correct.

The correct answer is: Both whole and natural numbers.


Question 5
Correct

Mark 1.00 out of 1.00

Which of the below is DDL Query?

Select one or more:


All the options
Delete * from table_name;


Truncate table table_name;


Drop table table_name;

Your answer is correct.


The correct answers are:
Truncate table table_name;,
Drop table table_name;
45257

◄ Post-Quiz

Jump to...

Data Manipulation Language - Introduction ►

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

Mark 1.00 out of 1.00

45257
Which among the following tags belong to DML?

Select one or more:


ALTER

DELETE

CREATE
UPDATE

Your answer is correct.

45257
The correct answers are: UPDATE, DELETE

Question 2
Correct

Mark 1.00 out of 1.00

State True or False.


COMMIT ends the current transaction by making all pending data changes permanent.

Select one:
FALSE

TRUE 45257
Your answer is correct.
The correct answer is: TRUE
Question 3
Correct

Mark 1.00 out of 1.00

Consider the below table structure:

Column Name DataType Constraint

Empname Varchar(20) Not Null

EmpId int(10) PK

Phoneno bigint(10) Not Null

insert into employee(empid,empname)values('123','John');

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.

Value for phoneno is missing.

The statement will get executed successfully

empid value should be given without single quotes.

Your answer is correct.

The correct answer is: Value for phoneno is missing.

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

The correct answer is: TRUE 45257


Question 5
Correct

Mark 1.00 out of 1.00

Examine the structure of the STUDENT table:

Column Name DataType Constraint

Stud_id int(3) PK

Name Varchar(20) Not Null

Address Varchar(30)

DOB Date

Which statement inserts a new row into the STUDENT table?

Select one:

45257
INSERT INTO student (stud_id, address, dob)

VALUES (101,'100 Main Street','17-JUN-99');

INSERT INTO student VALUES (101,'100 Main Street','17-JUN-99','Smith');

INSERT INTO student (stud_id, address, name, dob)

VALUES (101,'100 Main Street','Smith','1994-02-01');

INSERT INTO student VALUES (101,'Smith');

Your answer is correct.

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

Mark 1.00 out of 1.00

45257
Which statements are true regarding constraints?

Select one or more:


A constraint can be disabled even if the constraint column contains data.

A columns with the UNIQUE constraint can contain NULL values.

A foreign key cannot contain NULL values.

A constraint is enforced only for the INSERT operation on a table.

Your answer is correct.

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

Mark 1.00 out of 1.00

Match the following

Between......and Range of values 

Isnull 45257
checks whether a value is null or not. 

Like Match a character pattern 

In(set) Match any of the list vaues 

Your answer is correct.


The correct answer is: Between......and → Range of values, Isnull → checks whether a value is null or not., Like → Match a character pattern, In(set) →
Match any of the list vaues


Question 3
Correct

Mark 1.00 out of 1.00

The SQL statements executed in a user session as follows:

create table product(pid int(10),pname varchar(10));


Insert into product values(1,'pendrive');
Insert into product values(2,'harddisk');
savepoint a;
update product set pid=20 where pid=1;
savepoint b;
delete from product where pid=2;
commit;
delete from product where pid=10;

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.

Only the seconds DELETE statement is rolled back.

Both the DELETE statements and the UPDATE statement are rolled back.

The rollback generates an error.

Your answer is correct.

The correct answer is: The rollback generates an error.

Question 4
45257
Correct

Mark 1.00 out of 1.00

Which statement is true when a DROP TABLE command is executed on a table?

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.

Only a DBA can execute the DROP TABLE command.

Your answer is correct.


The correct answer is: The table structure and its deleted data cannot be rolled back and restored once the DROP TABLE command is executed.


Question 5
Correct

Mark 1.00 out of 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:
This task cannot be accomplished.

DELETE FROM employee; 

TRUNCATE TABLE employee;

DROP TABLE employee;

Your answer is correct.


The correct answer is: DELETE FROM employee;

45257
◄ Post-Quiz

Jump to...

Select Statement Introduction ►

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

Mark 1.00 out of 1.00

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

Which statement about SQL is true?

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

Mark 1.00 out of 1.00

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

Mark 1.00 out of 1.00

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

Mark 1.00 out of 1.00

Select the suitable option for retrieving all the employees whose salary range is between 40000 and 100000?

Select one or more:


select name,salary from employee where salary between 40000 and 100000;
select name,salary from employee where salary 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;

◄ Venue Details Based On Capacity

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

Mark 1.00 out of 1.00

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.

Which SQL statement would produce the required result?

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

Mark 1.00 out of 1.00

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

Mark 1.00 out of 1.00

To display the names of employees that are not assigned to a department.

Evaluate this SQL statement:

SELECT last_name, first_name

FROM employee

WHERE dept_id = NULL;

Which change should you make to achieve the desired result?

Select one:
Create an outer join.

45257
Add a second condition to the WHERE condition.

Change the column in the WHERE condition.

Change the operator in the WHERE condition.

The correct answer is: Change the operator in the WHERE condition.

Question 4
Correct

Mark 1.00 out of 1.00

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 

clause of the SELECT statement.

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

Mark 1.00 out of 1.00

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

The correct answer is: Oracle

◄ Post-Quiz

Jump to... 45257


FUNCTIONS Introduction ►

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

Mark 1.00 out of 1.00

45257
Single row functions can be nested to any level. State true or False.

Select one:
FALSE
TRUE

The correct answer is: TRUE

Question 2

45257
Correct

Mark 1.00 out of 1.00

Group functions can be used in the where clause. State True or False.

Select one:
FALSE
TRUE

The correct answer is: FALSE

45257
Question 3
Correct

Mark 1.00 out of 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'.

In the ORDER table, the SHIPDATE column has a datatype of DATE. The TOTAL column has a

datatype of INT.

Which statement do you use to create this report?

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

Mark 1.00 out of 1.00

What will be the output for the below query:

select ceil(5.3) from dual;

Select one:
6

5.0
45257
None of the options

Your answer is correct.

The correct answer is: 6


Question 5
Correct

Mark 1.00 out of 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:
FALSE
TRUE

The correct answer is: TRUE

◄ Average Cost For Location

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

Mark 1.00 out of 1.00

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

Mark 1.00 out of 1.00

The COMMISSION column shows the monthly commission earned by the employee.

Emp_Id Dept_Id Commission

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?

Select one or more:


Listing the employees whose annual commission is more than 6000

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

Finding the total commission earned by the employees in department 10

Listing the departments whose average commission is more that 600

Your answer is correct.

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

Mark 1.00 out of 1.00

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;

select round((curdate()-Birth_date)/365) AGE from customer;

select (Birth_date/365) AGE from customer;

select (start_date-curdate())/365) AGE from customer

The correct answer is: select round((curdate()-Birth_date)/365) AGE from customer;

Question 4

45257
Correct

Mark 1.00 out of 1.00

Which statement would display the highest credit limit available in each income level in each city in

the Customers table?

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;

The correct answer is: SELECT cust_city, cust_income_level,MAX(cust_credit_limit)


FROM customers
GROUP BY cust_city, cust_income_level;

45257


Question 5
Correct

Mark 1.00 out of 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:
SELECT e.last_name, d.department_name, d.location_id
FROM employees e, departments d

WHERE manager_id =manager_id;

SELECT employees.last_name, departments.department_name,


departments.location_id FROM employees e, departments d

WHERE e.department_id =d.department_id;

SELECT last_name, department_name, location_id

45257
FROM employees , departments ;

SELECT e.last_name, d.department_name, d.location_id


FROM employees e, departments d

WHERE e.department_id =d.department_id;

Your answer is correct.

The correct answer is: SELECT e.last_name, d.department_name, d.location_id


FROM employees e, departments d
WHERE e.department_id =d.department_id;

45257
◄ Post-Quiz

Jump to...

JOINS & SUB-QUERIES Introduction ►

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

Mark 1.00 out of 1.00

45257
In which cases would you use an outer join?

Select one:
The tables being joined have both matched and unmatched data.

Only when the tables have a primary key/foreign key relationship.

The tables being joined have NOT NULL columns.

The tables being joined have only unmatched data.

The tables being joined have only matched data.

Your answer is correct. 45257


The correct answer is: The tables being joined have both matched and unmatched data.

Question 2
Correct

Mark 1.00 out of 1.00

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

BETWEEN x AND y operator

Your answer is correct.


The correct answer is: equal operator
Question 3
Correct

Mark 1.00 out of 1.00

In which two cases would you use the USING clause? (Choose two)

Select one or more:


The tables to be joined have multiple NULL columns.

You want to create a nonequijoin.

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.

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.

Question 4
45257
Correct

Mark 1.00 out of 1.00

The NOT operator can be used with ______ operators.

Select one or more:


>

ANY

ALL

IN
45257
Your answer is correct.

The correct answers are: IN, ANY, ALL

45257
Question 5
Correct

Mark 1.00 out of 1.00

To display the names of employees who earns more than the average salary of all
employees.

SELECT last_name, first_name


FROMemployee
WHEREsalary > AVG(salary);

Which change should you make to achieve the desired results?

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.

Change the function in the WHERE clause.

45257
Move the function to the SELECT clause and add a GROUP BY clause and a HAVING clause.

Your answer is correct.


The correct answer is: Use a subquery in the WHERE clause to compare the average salary value.

◄ Highest Seating Capacity

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

Mark 1.00 out of 1.00

45257
_____ is used to retrieve records that do not meet the join condition

Select one:
Equi Join

Outer Join

Self Join

Non Equi Join

Your answer is correct.

The correct answer is: Outer Join


45257
Question 2
Correct

Mark 1.00 out of 1.00

Equijoin is called as ______.

Select one:
Self Join

Outer Join

Equal Join
45257
Simple Join

Your answer is correct.


The correct answer is: Simple Join
Question 3
Correct

Mark 1.00 out of 1.00

Joining a table to itself is called as ______.

Select one:
Self Join

Equi Join

Outer Join

Non Equi Join

Your answer is correct.


The correct answer is: Self 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

Mark 1.00 out of 1.00

45257
The _______ join produces the cross product of two tables.

Select one:
Equi

Cross

Self

Outer

Your answer is correct.

The correct answer is: Cross


◄ Post-Quiz

Jump to...

DCL & Database Objects ►

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

Mark 1.00 out of 1.00

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 VIEW emp_dept_vu;

REMOVE emp_dept_vu;

DROP VIEW emp_dept_vu;

DELETE VIEW emp_dept_vu;

45257
Your answer is correct.
The correct answer is: DROP VIEW emp_dept_vu;

Question 2
Correct

Mark 1.00 out of 1.00

Which SQL statement grants a privilege to all the database users?

Select one:
grant select on department to ALL;
45257
grant select on department to PUBLIC;

grant select on department to PRIVATE;

grant select on department to ALL USERS;

Your answer is correct.


The correct answer is: grant select on department to PUBLIC;
Question 3
Correct

Mark 1.00 out of 1.00

An owner can give specific privileges on the owner's objects to others. State True or False.

Select one:
True 

False

The correct answer is 'True'.

Question 4
Correct

Mark 1.00 out of 1.00

CREATE INDEX emp_dept_id_idx


ON employee(dept_id);
45257
Which of the following statements are true with respect to the above index?

Select one:
Override the unique index created when the FK relationship was defined.

Store an index in the EMPLOYEE table.

Increase the chance of full table scans.

45257
May reduce the amount of disk I/O for SELECT statements.

May reduce the amount of disk I/O for INSERT statements.

Your answer is correct.

The correct answer is: May reduce the amount of disk I/O for SELECT statements.

Question 5
Correct

Mark 1.00 out of 1.00

45257
The owner has all the privileges on the object. State true or False.

Select one:
True 

False

The correct answer is 'True'.

◄ Create Index

Jump to...
45257

45257

45257

You might also like