-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Creato il: Mar 17, 2025 alle 10:04
-- Versione del server: 10.4.28-MariaDB
-- Versione PHP: 8.2.4

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `scuola (compito)`
--

-- --------------------------------------------------------

--
-- Struttura della tabella `alunni`
--

CREATE TABLE `alunni` (
  `ID_Alunno` int(11) NOT NULL,
  `Nominativo` varchar(100) DEFAULT NULL,
  `Sesso` char(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dump dei dati per la tabella `alunni`
--

INSERT INTO `alunni` (`ID_Alunno`, `Nominativo`, `Sesso`) VALUES
(1, 'Luca Bianchi', 'M'),
(2, 'Anna Verdi', 'F'),
(3, 'Marco Rossi', 'M'),
(4, 'Giulia Neri', 'F');

-- --------------------------------------------------------

--
-- Struttura della tabella `prove`
--

CREATE TABLE `prove` (
  `ID_Prova` int(11) NOT NULL,
  `Data` date DEFAULT NULL,
  `Voto` int(11) DEFAULT NULL,
  `ID_Alunno` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dump dei dati per la tabella `prove`
--

INSERT INTO `prove` (`ID_Prova`, `Data`, `Voto`, `ID_Alunno`) VALUES
(1, '2024-03-01', 7, 1),
(2, '2024-03-02', 6, 2);

--
-- Indici per le tabelle scaricate
--

--
-- Indici per le tabelle `alunni`
--
ALTER TABLE `alunni`
  ADD PRIMARY KEY (`ID_Alunno`);

--
-- Indici per le tabelle `prove`
--
ALTER TABLE `prove`
  ADD PRIMARY KEY (`ID_Prova`),
  ADD KEY `ID_Alunno` (`ID_Alunno`);

--
-- Limiti per le tabelle scaricate
--

--
-- Limiti per la tabella `prove`
--
ALTER TABLE `prove`
  ADD CONSTRAINT `prove_ibfk_1` FOREIGN KEY (`ID_Alunno`) REFERENCES `alunni` (`ID_Alunno`);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
