Per la 4D e 4E SIA: Esportazione delle tabelle in SQL progetto Farmacia della studentessa Anna Franceschetti 5D



-- phpMyAdmin SQL Dump
-- version 4.1.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 24, 2018 alle 11:32
-- Versione del server: 5.6.33-log
-- PHP Version: 5.3.10

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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 utf8 */;

--
-- Database: `my_annafranceschetti`
--
CREATE DATABASE IF NOT EXISTS `my_annafranceschetti` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `my_annafranceschetti`;

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

--
-- Struttura della tabella `ditta`
--

DROP TABLE IF EXISTS `ditta`;
CREATE TABLE IF NOT EXISTS `ditta` (
  `IDDitta` varchar(20) NOT NULL,
  `NomeDitta` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`IDDitta`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `ditta` (`IDDitta`, `NomeDitta`) VALUES
('140', 'FOURINIER PHARMA S.P'),
('168', 'HOSPIRE S.P.A.'),
('180', 'INDUSTRIA FARMACEUTI'),
('228', 'LABORATORIO FARMACEU'),
('310', 'PHARMACIA ITALIA S.P'),
('334', 'RECORDATI INDUSTRIA '),
('355', 'SCHWARZ PHARMA S.P.A'),
('377', 'TEOFARMA S.R.L.'),
('401', 'WYETH MEDICA IRELAND'),
('42 ', 'AVENTIS PHARMA S.P.A'),
('6', 'A.M.S.A. S.R.L.'),
('69 ', 'BRACCO S.P.A.'),
('70', 'BRISTOL MYERS SQUIBB');

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

--
-- Struttura della tabella `farmaco`
--

DROP TABLE IF EXISTS `farmaco`;
CREATE TABLE IF NOT EXISTS `farmaco` (
  `Codice` varchar(20) NOT NULL,
  `Denominazione` varchar(40) DEFAULT NULL,
  `Descrizione` varchar(255) DEFAULT NULL,
  `Prezzo` decimal(12,0) DEFAULT NULL,
  `ATC` varchar(20) DEFAULT NULL,
  `IDDitta` varchar(20) DEFAULT NULL,
  `DataAutMin` date DEFAULT NULL,
  PRIMARY KEY (`Codice`),
  KEY `ATC` (`ATC`),
  KEY `farmaco_ibfk_2` (`IDDitta`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Struttura della tabella `principi`
--

DROP TABLE IF EXISTS `principi`;
CREATE TABLE IF NOT EXISTS `principi` (
  `ATC` varchar(20) NOT NULL,
  `Principioattivo` varchar(15) DEFAULT NULL,
  PRIMARY KEY (`ATC`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `principi` (`ATC`, `Principioattivo`) VALUES
('B03BB01', 'ACIDO FOLICO'),
('D06AX02', 'CLORAMFENICOLO'),
('G03BA03', 'TESTOSTERONE'),
('G03CA57', 'ESTROGENI CONIU'),
('G03GA01', 'GONADOTROPINA C'),
('J01GA01', 'STREPTOMICINA'),
('N01AF03', 'TIOPENTAL'),
('N03AA02', 'FENOBARBITAL'),
('N03AB02', 'FENITOINA'),
('N04AA01', 'TRIESIFENIDILE'),
('P01CB01', 'MEGLUMINA'),
('R03DA04', 'TEOFILLINA');

--
-- Limiti per le tabelle scaricate
--

--
-- Limiti per la tabella `farmaco`
--
ALTER TABLE `farmaco`
  ADD CONSTRAINT `farmaco_ibfk_1` FOREIGN KEY (`ATC`) REFERENCES `principi` (`ATC`),
  ADD CONSTRAINT `farmaco_ibfk_2` FOREIGN KEY (`IDDitta`) REFERENCES `ditta` (`IDDitta`);
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 */;

Commenti