Monday, March 1, 2021
More
    Home Tags Sql server

    sql server

    Customers Who Never Order

    Suppose that a website contains two tables, the tableCustomers and the tableOrders. Write a SQL query to find all customers who never order anything. Table:...

    Employees Earning More Than Their Managers

    The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id. +----+-------+--------+-----------+ |...

    Delete Duplicate Emails

    Write a SQL query to delete all duplicate email entries in a table named,Person keeping only unique emails based on its smallestId. +----+------------------+ | Id | Email...

    Rising Temperature

    Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates. +---------+------------+------------------+ | Id(INT) | Date(DATE) |...

    Department Highest Salary

    The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id. +----+-------+--------+--------------+ | Id | Name...

    Swap Sex Field

    Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f...

    Combine Two Tables

    Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | PersonId | int | | FirstName |...

    Nth Highest Salary

    Write a SQL query to get the nth highest salary from the Employee table. +----+--------+ | Id | Salary | +----+--------+ | 1 | 100 | | 2 ...

    Must Read