Coder Social home page Coder Social logo

be-k07's Introduction

Assignment 1:

Database

Mỗi bài tập sẽ lưu trên file sol-{number}.sql

  1. Giải bài tập trên leetcode:

https://leetcode.com/problems/capital-gainloss/description/ (gợi ý: sử dụng CASE)

https://leetcode.com/problems/count-salary-categories/ (ngoài các cách trên leetcode, hãy nghĩ cách để giúp câu query này nhanh hơn, kể cả thay đổi cấu trúc bản)

  1. Bạn hãy viết một script để tạo các bản cho hệ thống với cấu trúc ở dưới

img.png

hệ thống bao gồm:

  • class
  • professor: quan hệ one-many với class
  • student: quan hệ many-many với class
  • course: quan hệ one-many với class
  • room: quan hệ one-one với class
  1. Hãy viết câu query để tìm:
  • những cặp student-professor có dạy học nhau và số lớp mà họ có liên quan
  • những course (distinct) mà 1 professor cụ thể đang dạy
  • những course (distinct) mà 1 student cụ thể đang học
  • điểm số là A, B, C, D, E, F tương đương với 10, 8, 6, 4, 2, 0
  • điểm số trung bình của 1 học sinh cụ thể (quy ra lại theo chữ cái, và xếp loại học lực (weak nếu avg < 5, average nếu >=5 < 8, good nếu >=8 )
  • điểm số trung bình của các class (quy ra lại theo chữ cái)
  • điểm số trung bình của các course (quy ra lại theo chữ cái)

be-k07's People

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.