Giter Club home page Giter Club logo

os_assignment_07_mar_20's Introduction

Assignment 7 (March 20, 2023)

SQL Commands Assignment

Description:

In this assignment, you will be working with a fictional database of a company named "XYZ Corp." The database contains two tables, employees and departments. Your task is to write SQL commands to retrieve and manipulate data from these tables.

Instructions:

Use the employees table to answer the following questions:

  1. Write a query to select all columns and rows from the employees table.
  2. Write a query to select only the name and salary columns of all employees with a salary greater than 50000.
  3. Write a query to calculate the average salary of all employees.
  4. Write a query to count the number of employees who work in the "Marketing" department.
  5. Write a query to update the salary column of the employee with an id of 1001 to 60000.
  6. Write a query to delete all employees whose salary is less than 30000.

Use the departments table to answer the following questions:

  1. Write a query to select all columns and rows from the departments table.
  2. Write a query to select only the name and manager columns of the "Finance" department.
  3. Write a query to calculate the total number of employees in each department.
  4. Write a query to insert a new department called "Research" with a manager named "John Doe".

Deliverables:

  • A text file containing all SQL commands written to answer the above questions.
  • A brief explanation of each SQL command and its purpose.

Note: You can assume that both tables have the following columns:

employees: id, name, age, salary, department_id
departments: id, name, manager

os_assignment_07_mar_20's People

Contributors

kavedweller avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.