Break the Query Round-1

Break the Query Round-1

University

30 Qs

quiz-placeholder

Similar activities

SQL Basics

SQL Basics

University

29 Qs

MIDTERM QUIZ IN WEB DEV 101

MIDTERM QUIZ IN WEB DEV 101

University

25 Qs

Query database aset

Query database aset

University

25 Qs

PRE/POST TEST - CSS

PRE/POST TEST - CSS

University

28 Qs

SQL QUIZ-2

SQL QUIZ-2

University

30 Qs

Microsoft Access

Microsoft Access

8th Grade - University

31 Qs

SQL Queries Practical

SQL Queries Practical

University

30 Qs

MID SEMESTER TEST

MID SEMESTER TEST

University

30 Qs

Break the Query Round-1

Break the Query Round-1

Assessment

Quiz

Computers

University

Hard

Created by

HARIHARAN 20ITA13

Used 1+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Write the SQL query to get the third maximum salary of an employee from a table named employees.

SELECT * FROM(

SELECT employee_name, salary, DENSE_RANK() 

OVER(ORDER BY salary DESC)r FROM Employee) 

WHERE r=3;

SELECT * FROM(

SELECT employee_name, salary, DENSE_RANK() 

OVER(ORDER BY salary ASC)r FROM Employee) 

WHERE r=5;

SELECT * FROM(

SELECT employee, salary, DENSE_RANK() 

OVER(GROUP BY salary )a FROM Employee) 

WHERE r=2;

None of these

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

If the SQL table has duplicate rows, the duplicate rows must be removed.

Let’s assume the following table as our dataset:

DELETE table WHERE ID IN (SELECT ID, COUNT(ID) FROM   table ORDER BY  ID HAVING COUNT (ID) > 5); 

REMOVE FROM table where ID IN (SELECT ID, COUNT(ID) FROM   table BY  ID HAVING COUNT (ID) > 1); 

DELETE FROM table WHERE ID IN (SELECT ID, COUNT(ID) FROM   table GROUP BY  ID HAVING COUNT (ID) > 1); 

None of these

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Syntax for SQL CAST function

CAST(expression TO [data type])

CAST(expression AS [data type])

CAST(expression IN [data type])

CAST(expression FOR [data type])

4.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

What are the operators available in SQL?

Arithmetic Operators

Relational Operator

Logical

Operations

Comparison

Operators

5.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

The ways to get the count of records in a table?

SELECT * FROM table1

SELECT COUNT(*) FROM table1

None of these

SELECT rows FROM

sysindexes

WHERE id =

OBJECT_ID(table1) AND indid

< 2

6.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Write a SQL query to find the names of employees that begin with ‘A’?

Consider Table name and column name are emp_details and EmpName

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider a table named "employees" with columns "id", "name", "department", and "salary". Write a SQL query to display the names of employees who earn more than the average salary.

SELECT emp_name FROM employee WHERE salary > (SELECT AVG(salary) FROM employees);

SELECT emp_name FROM employee WHERE salary > (SELECT AVG(salary) FROM employees);

All of these

SELECT name FROM employee WHERE salary < (SELECT AVG(salary) FROM employee);

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?