SQL Query Writing

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

What is the correct query to retrieve complete data of employee with ID 7?

  • select * from employee where emp_id=7
  • select * from employee where Eid=7 (correct)
  • select * from employee where EmployeeID=7
  • select * from employee where ID=7

Which query correctly displays/retreives the name of employees with salary greater than 2000?

  • select Name from employee where salary>2000
  • select EMPName from employee where salary>=2000 (correct)
  • select EmployeeName from employee where salary>2000
  • select Name from employee where salary>=2000

What is the correct query to display/retrieve the average salary in the employee table?

  • select * from employee where salary=average
  • select AVG(salary) as [Average Salary] from employee (correct)
  • select average(salary) from employee
  • select avg_salary from employee

Which query correctly retrieves records of employees with salary greater than the average salary of all employees?

<p>select * from employee where salary&gt;(select AVG(salary) from employee) (D)</p> Signup and view all the answers

Flashcards are hidden until you start studying

More Like This

SQL Queries for Database Design
12 questions
SQL Queries and Database Design
16 questions
Use Quizgecko on...
Browser
Browser