STRUCTURED QUERY LANGUAGE TEST

Progress

1.

Which one is not part of the Database backup file?

2.

Which of the following is a valid SQL type?

3.

To delete the database __________ Command is used

4.

 Which of the following is the original purpose of SQL?

5.

SQL can be used to

6.

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

7.

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;

8.

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

9.

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'

10.

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

11.

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;  

12.

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

13.

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

14.

Find the names of the countries whose condition is sunny

15.

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

16.

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

17.

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

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

18.

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    

19.

Which of the SQL statement is correct?

20.

 Syntax for create a  views is _______

21.

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

22.

The HAVING clause does which of the following?

23.

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?

24.

Select ________ dept_name from instructor; 

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

25.

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;

26.

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;

27.

The SQL WHERE clause used for 

28.

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

29.

Find all the cities whose humidity is 89

30.

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

31.

Which of the following statements are TRUE regarding subqueries?

32.

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

33.

What is "Subquery"?

34.

Can you validate the statement?

An ORDER BY can be used in a subquery.

True or False?

35.

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

36.

Can you validate the statement?

A table contains more than one foreign key

True or False?

37.

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

38.

By default, which key creates Clustered index?

39.

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

40.

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

41.

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

 

42.

What is the function of Full Outer Join in SQL?

43.

Where are Joins used?

44.

What are the joins available in SQL?

45.

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

46.

Can you validate the statement?

Alias is used in Joins.

True or False?

47.

Which type of join is not desirable for retrieval?

48.

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

49.

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

Which Join?

50.

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

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 SQL keyword is used to retrieve a maximum value?

53.

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

 

54.

The SQL Statement

SELECT ROUND(45.926, -1) FROM DUAL;

55.

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

 

56.

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 ;    

 

57.

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

 

58.

In SQL - these functions - AVG, MIN, MAX, COUNT are called as ___________

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.

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

 

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