STRUCTURED QUERY LANGUAGE TEST

Progress

1.

To Create a new database __________ Command is used

2.

What is the full form of SQL?

3.

To delete the database __________ Command is used

4.

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

5.

 Which of the following is the original purpose of SQL?

6.

The SQL WHERE clause used for 

7.

Can you validate the statement?

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

True or False?

8.

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'

9.

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

10.

Select ID, GPA from student grades order by GPA ____________.

In order to give only 10 ranks, on the whole, we should use.

11.

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

12.

You can delete a view with _____________ Command.

13.

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

14.

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

15.

Which of the SQL statement is correct?

16.

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;

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.

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;

19.

You need to find out the names of all employees who belong to the same department as the employee 'Jessica Butcher' who is in department 100 and has an employee ID 40. Which of the following queries will be correct?

20.

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;  

21.

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

22.

Find the names of the countries whose condition is sunny

23.

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

24.

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

25.

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

26.

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

27.

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

28.

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    

29.

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

30.

Select ________ dept_name from instructor; 

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

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.

Where subqueries can not be used?

34.

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

35.

Can you validate the statement?

An ORDER BY can be used in a subquery.

True or False?

36.

Can you validate the statement?

A column with a Unique key has duplicate values.

True or False?

37.

Which key accepts multiple NULL values?

38.

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

39.

Can you validate the statement?

A table contains more than one foreign key

True or False?

40.

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

41.

Choose the query that matches the above image.

42.

Where are Joins used?

43.

What are the joins available in SQL?

44.

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

45.

How many tables may include with a join? 

46.

Choose the correct query for the below scenario.

 

47.

Below image depicts:

48.

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

49.

Can you validate the statement?

Alias is used in Joins.

True or False?

50.

What is the syntax for joining two tables? Pick Two

51.

What values does the count(*) function ignore?

52.

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

53.

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 ;  

 

54.

Which of the following is incorrect SQL?

55.

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

 

56.

Which SQL keyword is used to retrieve the highest value? 

57.

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

 

58.

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

 

59.

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

 

60.

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

 

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