\documentclass[a4paper,11pt]{article}

\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc} 
\usepackage[french]{babel}
\usepackage[a4paper,hmargin=20mm,vmargin=30mm]{geometry}%\usepackage{fullpage}
\usepackage{url}
\usepackage{comment}
\usepackage{fancyhdr}% fancy header
\usepackage{multirow}
\usepackage{slashbox}

\usepackage{color, colortbl}
\definecolor{Gray}{gray}{0.9}
\usepackage{adjustbox}
\usepackage{slashbox}
%\usepackage{times}
\usepackage{tikz,pgflibraryarrows,pgffor,pgflibrarysnakes}
\usetikzlibrary{decorations.pathreplacing}

\usepackage{pdfpages}

\usepackage{fancyvrb}

\fancypagestyle{monstyle}{
%\fancyhead{}
\renewcommand{\headrulewidth}{1pt}
%% %\renewcommand{\footrulewidth}{0.4pt}

% \fancyhead[LE]{\slshape \thepage/ \pageref{LastPage}}
%% \fancyhead[RO]{\slshape \thepage/ \pageref{LastPage}}


%\fancyhf{}          
%\fancyhead[LE]{\slshape LE}
%\fancyhead[CE]{\slshape CE}
%\fancyhead[RE]{\slshape RE}

\fancyhead[LO]{\bfseries 2018-2019 BD PLS/SQL\rightmark}   
%\fancyhead[CO]{\slshape APF}
\fancyhead[RO]{\bfseries ~\leftmark }

%% %\fancyfoot{}
% \fancyfoot[LE,RO]{}
 \fancyfoot[CO,CE]{}%\slshape\thepage/\pageref{LastPage}}
%% %\fancyfoot[LO,RE]{\small\slshape \ddmmyyyydate version du \today}

}

% \pagestyle{fancy}

\usepackage{amsmath}
\usepackage{amsthm}



\theoremstyle{definition}
\newtheorem{exercice}{Exercice}

\pagestyle{monstyle}

\usepackage{amsmath}
\usepackage{amsthm}

\newcommand{\code}[1]{\texttt{#1}}

\usepackage{boxedminipage}
\usepackage{setspace}


\newsavebox\svbx
\newif\ifcache
\long\def\cache#1{\ \newline
  \setbox\svbx=\vbox{\leavevmode \newline \begin{spacing}{1}#1\end{spacing}}
 \smallskip\par\noindent
 \begin{boxedminipage}{\linewidth}
  \ifcache    
  \leavevmode\hrule height 0pt\vskip \ht\svbx\hrule height 0pt
  \else \unvbox\svbx
  \fi
 \end{boxedminipage}
 \par\smallskip}


\cachefalse % version prof
%\cachetrue % version  etudiant



\begin{document}

\section*{NBA}

\begin{verbatim}

CREATE TABLE  JOUEUR(id_joueur CHAR(6) PRIMARY KEY,
Nom VARCHAR2(20),
Prenom VARCHAR2(20),
Date_de_naissance DATE,
Taille  NUMBER,
Poste char(2)  constraint c_poste CHECK (Poste IN('PG','SG','SF','PF','C')));

CREATE TABLE  EQUIPE(id_equipe CHAR(6) PRIMARY KEY,
Nom VARCHAR2(20),
Ville VARCHAR2(20),
Conference VARCHAR2(5) constraint c_conf check (Conference in('Est','Ouest')),
Date_creation DATE);

CREATE TABLE  GAME(id_game CHAR(6) PRIMARY KEY,
Date_game DATE,
id_equipe_domicile CHAR(6) references EQUIPE,
id_equipe_exterieur CHAR(6) references EQUIPE,
Ville VARCHAR2(20),
Categorie char(7) constraint c_type check (Categorie in('Amical','Saison','Playoff','Allstar')),
Score_domicile NUMBER,
Score_exterieur NUMBER,
Prolongation NUMBER);

CREATE TABLE  JOUE(id_joueur CHAR(6) references JOUEUR,
id_game CHAR(6) references GAME,
Points NUMBER,
Rebonds NUMBER,
Interceptions NUMBER,
Contres NUMBER,
Passes NUMBER,
Balles_perdues NUMBER,
Fautes NUMBER,
PRIMARY KEY(id_joueur,id_game));


CREATE TABLE APPARTIENT(id_contrat CHAR(6) PRIMARY KEY,
id_joueur CHAR(6) references JOUEUR,
id_equipe CHAR(6) references EQUIPE,
Date_debut DATE,
Date_fin DATE,
Salaire_jour  NUMBER);
\end{verbatim}
\newpage

\subsection*{HOPITAL}

\begin{verbatim}

CREATE TABLE  FONCTION(id_fonction CHAR(6) PRIMARY KEY,
Designation VARCHAR(20),
Salaire  NUMBER);

CREATE TABLE  HOPITAL(id_hopital CHAR(6) PRIMARY KEY,
Nom VARCHAR(20),
Ville VARCHAR(20),
Date_creation DATE);


CREATE TABLE  PATIENT(id_patient CHAR(6) PRIMARY KEY,
Nom VARCHAR(20),
Prenom VARCHAR(20),
Date_naissance DATE);

CREATE TABLE  PERSONNEL(id_personnel CHAR(6) PRIMARY KEY,
id_fonction CHAR(6) references FONCTION,
id_hopital CHAR(6) references HOPITAL,
Nom VARCHAR(20),
Prenom VARCHAR(20));


CREATE TABLE AFFECTATION(id_contrat CHAR(6) PRIMARY KEY,
id_personnel CHAR(6) references PERSONNEL,
id_patient CHAR(6) references PATIENT,
Date_debut DATE,
Date_fin DATE);
\end{verbatim}


\end{document}
