STRUCTURED QUERY LANGUAGE TEST

Progress

1.

What is the meaning of a Database?

2.

Which of the following is not a database object?

3.

Which is the subset of SQL command used to manipulate Database structures, including tables?

4.

Which of the following database cannot be dropped?

5.

What is the full form of SQL?

6.

The HAVING clause does which of the following?

7.

Can you validate the statement?

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

True or False?

8.

Select ________ dept_name from instructor; 

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

9.

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    

10.

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

11.

Which of the SQL statement is correct?

12.

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

13.

Find all the cities whose humidity is 89

14.

Which syntax is used for Drop Index (idx_pname) from the Person table in MYSQL?

15.

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

16.

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

17.

Which one is not used in SQL?

18.

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;

19.

Find the names of the countries whose condition is sunny

20.

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?

21.

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

22.

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

23.

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

24.

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;  

25.

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

26.

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

27.

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'

28.

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          

29.

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

30.

The SQL WHERE clause used for 

31.

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

32.

Which of the following is true about sub-queries?

33.

Can you validate the statement?

An ORDER BY can be used in a subquery.

True or False?

34.

A subquery in an SQL SELECT statement is enclosed in

35.

Can you validate the statement?

A subquery can be used anywhere an expression is allowed.

True or False?

36.

How many Primary Keys can have in a table?

37.

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

38.

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

39.

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

40.

A Key which is a set of one or more columns that can identify a record uniquely is called?

41.

What is the function of Full Outer Join in SQL?

42.

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?

43.

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

44.

Where are Joins used?

45.

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

46.

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? 

47.

Can you validate the statement?

Alias is used in Joins.

True or False?

48.

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

 

49.

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

50.

What are the joins available in SQL?

51.

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

 

52.

Which of the following set of operations is a valid set of Aggregate operations in SQL?

53.

The SQL Statement

SELECT ROUND(45.926, -1) FROM DUAL;

54.

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

 

55.

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

 

56.

Use below table (Salesemployee)  and answer the following question

What is the output of the following query?

SELECT SUM(Salary) from Salesemployee     
WHERE Gender = 'Male';      
        

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.

Which of the following is incorrect SQL?

59.

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

 

60.

Which SQL keyword is used to retrieve the highest value? 

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