STRUCTURED QUERY LANGUAGE TEST

Progress

1.

The result of a SQL SELECT statement is a ______.

2.

To Create a new database __________ Command is used

3.

 Which of the following is the original purpose of SQL?

4.

What is the SQL query used to retrieve all the data from the customer table?

5.

What is the main language of  Transact-SQL?

6.

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

7.

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

8.

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

9.

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

10.

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

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

11.

Can you validate the statement?

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

True or False?

12.

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;  

13.

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;

14.

Select ________ dept_name from instructor; 

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

15.

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'

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.

What is the significance of the statement “GROUP BY d.name” 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    

18.

Select two options which do not belong to the Purpose of Delete

19.

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

20.

Which command is used to change the definition of a table in SQL ?

21.

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;

22.

What is the meaning of the “ORDER BY” clause in MySQL?

23.

The HAVING clause does which of the following?

24.

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

25.

Which one is not used in SQL?

26.

What is the significance of the statement of the below query?

SELECT branch_name, COUNT (DISTINCT customer_name)     
FROM depositor, account           
WHERE depositor.account_number = account.account_number   
GROUP BY branch_id          

27.

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    

28.

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

29.

The SQL WHERE clause used for 

30.

Find the names of the countries whose condition is sunny

31.

Can you validate the statement?

An ORDER BY can be used in a subquery.

True or False?

32.

What is "Subquery"?

33.

Can you validate the statement?

A subquery can be used anywhere an expression is allowed.

True or False?

34.

Which of the following clause is mandatorily used in a sub-query?

35.

Which of the following statements are TRUE regarding subqueries?

36.

Which of the following is not a Key in SQL Server?

37.

How many types of indexes are there in the SQL server?

38.

Does an Index help to speed up?

39.

A ______ index is created based on only one table column.

40.

Student (ID, Name, Dept_name, Total_credit)

In this above query which attribute form the Primary Key?

41.

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

42.

Below image depicts:

43.

Statement: Join for each row of one table to every row of another table.

Which Join?

44.

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

45.

Choose the query that matches the above image.

46.

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

47.

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

48.

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?

49.

How many tables may include with a join? 

50.

Which type of join is not desirable for retrieval?

51.

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

 

52.

Which among the following belongs to an “aggregate function”?

53.

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

 

54.

Which SQL keyword is used to retrieve the highest value? 

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.

What values does the count(*) function ignore?

57.

Use below table (Salesemployee) and answer the following question
What is the output of following query ?
SELECT Count(*) from Salesemployee 
WHERE Salary >500;  

 

58.

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

 

59.

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

 

60.

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%';

 

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