STRUCTURED QUERY LANGUAGE TEST

Progress

1.

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

2.

SQL can be used to

3.

What is the full form of SQL?

4.

What is the meaning of a Database?

5.

Which of the following is not a database object?

6.

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

7.

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

8.

 Syntax for create a  views is _______

9.

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

10.

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

11.

Which one is not used in SQL?

12.

Find all the cities whose humidity is 89

13.

You can delete a view with _____________ Command.

14.

The SQL WHERE clause used for 

15.

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    

16.

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;

17.

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

18.

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    

19.

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

20.

Which of the SQL statement is correct?

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.

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;

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.

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

25.

Select ________ dept_name from instructor; 

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

26.

Find the names of the countries whose condition is sunny

27.

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

28.

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

29.

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;

30.

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?

31.

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

32.

What is "Subquery"?

33.

Which of the following operators cannot be used in a sub-query?

34.

Where subqueries can not be used?

35.

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

36.

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

37.

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

38.

Can you validate the statement?

A table contains more than one foreign key

True or False?

39.

Which key accepts multiple NULL values?

40.

Can you validate the statement?

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

True or False?

41.

Where are Joins used?

42.

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

43.

Can you validate the statement?

Alias is used in Joins.

True or False?

44.

What is the function of Full Outer Join in SQL?

45.

What is the syntax for joining two tables? Pick Two

46.

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

47.

Below image depicts:

48.

Which type of join is not desirable for retrieval?

49.

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

50.

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

 

51.

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

52.

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 ;  

 

53.

Which SQL keyword is used to retrieve the highest value? 

54.

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

 

55.

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 ;  

 

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

 

57.

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

58.

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

59.

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

60.

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

 

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