STRUCTURED QUERY LANGUAGE TEST

Progress

1.

Which of the following database cannot be dropped?

2.

In SQL, which command is used to change a table's storage characteristics?

3.

 What does a  DML Stand for?

4.

What is the full form of SQL?

5.

To Create a new database __________ Command is used

6.

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          

7.

How to delete the Customer name of Alfreds Futterkiste (CustomerID is 1) from the Customers table?

8.

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

9.

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

10.

Select ________ dept_name from instructor; 

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

11.

Identify the average salary of the jobs 'MANAGER' and 'ANALYST'. Display job, average salary if the identified average salary is more than 1500.

12.

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

13.

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

14.

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    

15.

The HAVING clause does which of the following?

16.

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

17.

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

18.

The SQL WHERE clause used for 

19.

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

20.

Find all the cities whose humidity is 89

21.

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;  

22.

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;

23.

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

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

24.

You can delete a view with _____________ Command.

25.

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''?

26.

Find the names of the countries whose condition is sunny

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.

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

29.

Which one is not used in SQL?

30.

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

31.

Can you validate the statement?

A subquery can be used anywhere an expression is allowed.

True or False?

32.

Which of the following statement(s) is TRUE regarding subqueries?

33.

What is "Subquery"?

34.

Which of the following is true about sub-queries?

35.

Can you validate the statement?

An ORDER BY can be used in a subquery.

True or False?

36.

Does an Index help to speed up?

37.

Which of the following is correct DROP INDEX Command?

38.

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

39.

Student (ID, Name, Dept_name, Total_credit)

In this above query which attribute form the Primary Key?

40.

Which of the following do you need to consider when you make a table in SQL?

41.

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? 

42.

In the absence of WHERE condition this JOIN will function like a _______.

43.

Choose the query that matches the above image.

44.

Can you validate the statement?

Alias is used in Joins.

True or False?

45.

What are the joins available in SQL?

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.

Below image depicts:

49.

Which type of join is not desirable for retrieval?

50.

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

Which Join?

51.

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

 

52.

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

 

53.

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

 

54.

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 ;  

 

55.

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

 

56.

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

 

57.

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

 

58.

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

 

59.

Which of the following is incorrect SQL?

60.

Use below table (Salesemployee) and answer the following question
What is the output of following query ?
SELECT MAX(Salary) from Salesemployee 
WHERE Salary >=2500 and Dept = 'Sales' ;

 

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