STRUCTURED QUERY LANGUAGE TEST

Progress

1.

The result of a SQL SELECT statement is a ______.

2.

Which of the following is a valid SQL type?

3.

 What does a  DML Stand for?

4.

Which one is a non-relational database?

5.

Which file type is used for database backup?

6.

Which SQL keyword is used to sort the result-set?

7.

Which SQL Query is used for updating the ContactName in the Customers table?

8.

What is the significance of “ORDER BY” in the following MySQL statement?

SELECT emp_id, fname, lname  
FROM person    
ORDER BY emp_id;  

9.

If emp_id contains the following set {-1, -2, 2, 3, -3, 1}, what will be the output on the execution of the following MySQL statement?

SELECT emp_id
FROM person
ORDER BY emp_id;

10.

You can delete a view with _____________ Command.

11.

Analyze the following Query and Mark the answer whether it's a correct query or not?

Select OrderID, Shipdate
From Orders  
Where CustomerID=20
Order by Shipdate;

12.

If you don't specify ASC or DESC after a SQL ORDER BY clause, the following is used by default

13.

We can use one table to create another table using the below query. True or False ?

CREATE TABLE TestTable AS

SELECT customername, contactname

FROM customers;

14.

How to create index idx_pname for multiple columns (Lastname, Firstname) in a Person table?

15.

Find the name of these cities with temperature and condition whose condition is neither sunny nor cloudy

16.

With SQL, how do you select all the records from a table named "Persons" where the value of the column "Firstname" ends with an ''a''?

17.

Select ID, name, dept name, salary * 1.1 where instructor;

The query given below will not give an error. Which one of the following has to be replaced to get the desired output?

18.

What is the meaning of the “HAVING” clause in MySQL?

19.

With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?

20.

Select ________ dept_name from instructor; 

Here which of the following displays the unique values of the column?

21.

Which of the following query is correct for selecting the name of the staff from ''staffinfo'' table where salary is 10000 or 25000?

22.

The HAVING clause does which of the following?

23.

Which of the SQL statement is correct?

24.

The _______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predicate.

25.

What is the significance of the statement “HAVING COUNT (emp_id)>2” in the following MySQL statement?

SELECT d.name, COUNT (emp_id) emp_no  
FROM department d INNER JOIN Employee e  
ON d.dept_id=e.emp_id      
GROUP BY d.name      
HAVING COUNT (emp_id)>2    

26.

Can you validate the statement?

"ORDER BY" can only be used by WHERE Clause.

True or False?

27.

Analyse the following Query and Mark the answer whether it's the correct query or not?

SELECT Name, Age, Firstname, Lastname
FROM EMPLOYEE     
GROUP BY NAME, SALARY;  

28.

What can be the condition in the "WHERE" clause in a SQL query?

29.

Analyze the following Query and Mark the answer whether it's the correct query or not ?

select deptName
from Employee
having avg (salary)
group by deptName
where sex = 'M'

30.

Find the names of the countries whose condition is sunny

31.

Which of the following statements are TRUE regarding subqueries?

32.

What is "Subquery"?

33.

Can you validate the statement?

An ORDER BY can be used in a subquery.

True or False?

34.

Where subqueries can not be used?

35.

Which of the following multi-row operators can be used with a sub-query?

36.

Can you validate the statement?

A column with a Primary key has a Null value.

True or False?

37.

Student (ID, Name, Dept_name, Total_credit)

In this above query which attribute form the Primary Key?

38.

Can you validate the statement?

We can use the index on columns that contain a high number of NULL values.

True or False?

39.

Does an Index help to speed up?

40.

Which one of the following can be taken as a Primary Key?

41.

 In which two cases would you use an outer join? (Choose two.)

42.

What is the function of Full Outer Join in SQL?

43.

List all orders, showing order number, customer name and credit limit of a customer.

Orders Table:  
Order_Number, Customer, Product_Amount
Customers Table:  
Customer_Number, Customer_Name, Credit_Limit

 Which of the below query satisfy the above question?

44.

Can you validate the statement?

Alias is used in Joins.

True or False?

45.

Evaluate this SQL statement:

SELECT employee_id, e.department_id, department_name, salary
FROM employees e, departments d  
WHERE e.department_id = d.department_id;  

Which SQL statement is equivalent to the above SQL statement? 

46.

Analyze the following tables and output and choose the correct query to achieve the output.

 

47.

Can you validate the statement?

Join is different from Inner join.

True or False?

48.

Choose the query that matches the above image.

49.

Analyze the following tables and output and choose the correct query to achieve the output.

50.

Where are Joins used?

51.

Use below table (Salesemployee) and answer the following question
What is the output of following query ?
SELECT Count(*) from Salesemployee 
WHERE Gender = 'Male';  

 

52.

Use below table (Salesemployee) and answer the following question
What is the output of following query ?  
SELECT MIN(Salary) from Salesemployee   
WHERE Employee_ID % 2 != 0 ;    

 

53.

Which SQL keyword is used to retrieve a maximum value?

54.

The _____ aggregation operation adds up all the values of the attribute

55.

Use below table (Salesemployee) and answer the following question
What is the output of following query ?
SELECT COUNT(*) from Salesemployee 
WHERE Employee_ID % 2 <> 0 ;  

 

56.

Which of the following is incorrect SQL?

57.

Use below table (Salesemployee) and answer the following question
What is the output of following query ?
SELECT Count(Salary) from Salesemployee 
where name Like 'S%' and Dept ='HR';

 

58.

“COUNT” keyword belongs to which categories in MySQL?

59.

Use below table (Salesemployee) and answer the following question
What is the output of following query ?
SELECT SUM(Salary) from Salesemployee ;

 

60.

Use below table (Salesemployee) and answer the following question
What is the output of following query?
SELECT MIN(Salary) from Salesemployee 
WHERE Gender = 'Female';  

 

Assessment complete! Thank you for you time.
We are redirecting you to the result page, Please click on 'SUBMIT'