Git Product home page Git Product logo

db-university's Introduction

Modellizzare la struttura di una tabella per memorizzare tutti i dati riguardanti una università:

  • sono presenti diversi Dipartimenti (es.: Lettere e Filosofia, Matematica, Ingegneria ecc.);
  • ogni Dipartimento offre più Corsi di Laurea (es.: Civiltà e Letterature Classiche, Informatica, Ingegneria Elettronica ecc..)
  • ogni Corso di Laurea prevede diversi Corsi (es.: Letteratura Latina, Sistemi Operativi 1, Analisi Matematica 2 ecc.);
  • ogni Corso può essere tenuto da diversi Insegnanti;
  • ogni Corso prevede più appelli d'Esame;
  • ogni Studente è iscritto ad un solo Corso di Laurea;
  • ogni Studente può iscriversi a più appelli di Esame;
  • per ogni appello d'Esame a cui lo Studente ha partecipato, è necessario memorizzare il voto ottenuto, anche se non sufficiente. Pensiamo a quali entità (tabelle) creare per il nostro database e cerchiamo poi di stabilirne le relazioni. Infine, andiamo a definire le colonne e i tipi di dato di ogni tabella.

Tabelle:

  • Departments
  • Degree_courses
  • Course
  • Teachers
  • Exams
  • Studenti
  • Voti

oneToMany => Dipartimenti - Corsi_di-laurea manyToMany => Corsi_di_laurea - Corsi oneToMany => Inseganti - Corsi oneToMany => Corsi - Esami manyToMany => Corsi - Studenti oneToMany => Studenti - Corsi_di_laurea manyToMany => Studenti - Esami

Departments: -id | BIGINT - PK - AI - NOTNULL - UNIQUE -name | VARCHAR(50) - NOTNULL -code | CHAR(5) - NOTNULL -UNIQUE

Degree_courses: -id | BIGINT - PK - AI - NOTNULL - UNIQUE -id_department | FK - BIGINT -name | VARCHAR(100) - NOTNULL -code | CHAR(5)

Course_DegreeCourse: ##### -id | BIGINT - PK - AI - NOTNULL - UNIQUE -id_Course | FK - BIGINT -id_DegreeCourse | FK - BIGINT

Courses: -id | BIGINT - PK - AI - NOTNULL - UNIQUE -id_teacher | FK - BIGINT -name| VARCHAR(50) - NOTNULL -code | CHAR(5)

Student_Course: ####### -id | BIGINT - PK - AI - NOTNULL - UNIQUE -id_student | FK - BIGINT -id_course | FK - BIGINT

Students: -id | BIGINT - PK - AI - NOTNULL - UNIQUE -id_degree_course | FK - BIGINT -freshman | CHAR(5) - NULL -fullname | VARCHAR(50) - NOTNULL -date_of_birth | DATE - NULL -email | VARCHAR(30) - NULL -phone | INT - NULL

Student_exam: ###### -id | BIGINT - PK - AI - NOTNULL - UNIQUE -id_student | FK - BIGINT -id_exam | FK - BIGINT -number_of_exam | SMALLINT - NULL

Exams: -id | BIGINT - PK - AI - NOTNULL - UNIQUE -id_course | FK - BIGINT -name | VARCHAR(100) - NOTNULL -date | DATETIME - NULL -vote | TINYINT - NULL

Teachers: -id | BIGINT - PK - AI - NOTNULL - UNIQUE -fullname| VARCHAR(100) - NOTNULL -email | VARCHAR(30) - NULL -phone | INT - NULL -code | CHAR(5) - NULL -role | VARCHAR(30) - NULL

db-university's People

Watchers

Paolo Evangelistella 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.