sa afisez pe un rand materile si pe randurile urmatoare notele corespunzatoare fiecarei materie si va rog sa ma ajutati o niste lini de cod
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 31, 2011 at 09:35 PM
-- Server version: 5.5.16
-- PHP Version: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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: `mydb`
--
-- --------------------------------------------------------
--
-- Table structure for table `clase`
--
CREATE TABLE IF NOT EXISTS `clase` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nume` text NOT NULL,
`materie_id` int(11) NOT NULL,
`profesor_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;
--
-- Dumping data for table `clase`
--
INSERT INTO `clase` (`id`, `nume`, `materie_id`, `profesor_id`) VALUES
(1, '9A', 1, 1),
(2, '9A', 2, 1),
(3, '9C', 0, 0),
(4, '10A', 0, 0),
(5, '10B', 0, 0),
(6, '10C', 0, 0),
(7, '11A', 0, 0),
(8, '11B', 0, 0),
(9, '11C', 0, 0),
(10, '12A', 0, 0),
(11, '12B', 0, 0),
(12, '12C', 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `elev`
--
CREATE TABLE IF NOT EXISTS `elev` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nume` text NOT NULL,
`parola` text NOT NULL,
`cnp` int(11) NOT NULL,
`clasa` text NOT NULL,
`email` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `elev`
--
INSERT INTO `elev` (`id`, `nume`, `parola`, `cnp`, `clasa`, `email`) VALUES
(1, 'Mihai', '7c37ed5b5b72d2c6927e25357e6c488a', 0, '9A', '
[email protected]');
-- --------------------------------------------------------
--
-- Table structure for table `elev_has_materie`
--
CREATE TABLE IF NOT EXISTS `elev_has_materie` (
`elev_id` int(11) NOT NULL,
`materie_id` int(11) NOT NULL,
`abs` varchar(45) DEFAULT NULL,
KEY `fk_elev_has_materie_materie1` (`materie_id`),
KEY `fk_elev_has_materie_elev` (`elev_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `elev_has_materie`
--
INSERT INTO `elev_has_materie` (`elev_id`, `materie_id`, `abs`) VALUES
(1, 1, '1'),
(1, 1, '2'),
(1, 1, '10'),
(1, 2, '10/2x');
-- --------------------------------------------------------
--
-- Table structure for table `main`
--
CREATE TABLE IF NOT EXISTS `main` (
`bgcolor` text NOT NULL,
`textcolor` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `materie`
--
CREATE TABLE IF NOT EXISTS `materie` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nume` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ;
--
-- Dumping data for table `materie`
--
INSERT INTO `materie` (`id`, `nume`) VALUES
(1, 'Limba romana si literatura romana'),
(2, 'Limba moderna 1'),
(3, 'Limba moderna 2'),
(4, 'Matematica'),
(5, 'Fizica'),
(6, 'Chimie'),
(7, 'Biologie'),
(8, 'Istorie'),
(9, 'Geografie'),
(10, 'Socio-umane / Educatie pentru societate'),
(11, 'Socio-umane'),
(12, 'Religie'),
(13, 'Educatie muzicala'),
(14, 'Educatie plastica'),
(15, 'Educatie fizica'),
(16, 'Consiliere si orientare'),
(17, 'Tehnologia informatiei si a comunicatiilor '),
(18, 'Informatica'),
(19, 'Educatie antreprenoriala');
-- --------------------------------------------------------
--
-- Table structure for table `note`
--
CREATE TABLE IF NOT EXISTS `note` (
`elev_id` int(11) NOT NULL,
`materie_id` int(11) NOT NULL,
`nota` float NOT NULL,
KEY `elev_id` (`elev_id`),
KEY `materie_id` (`materie_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `note`
--
INSERT INTO `note` (`elev_id`, `materie_id`, `nota`) VALUES
(1, 1, 10),
(1, 2, 1),
(1, 1, 4),
(1, 1, 10),
(1, 1, 10),
(1, 1, 10),
(1, 1, 1010),
(1, 2, 10);
-- --------------------------------------------------------
--
-- Table structure for table `profesori`
--
CREATE TABLE IF NOT EXISTS `profesori` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nume` text NOT NULL,
`parola` text NOT NULL,
`dirig` text NOT NULL,
`email` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
--
-- Dumping data for table `profesori`
--
INSERT INTO `profesori` (`id`, `nume`, `parola`, `dirig`, `email`) VALUES
(2, 'admin', '7c37ed5b5b72d2c6927e25357e6c488a', 'admin', '
[email protected]'),
(4, 't', 't', 't', 't'),
(5, 'Mihai', '2eff751817560434a16345d8f94a8abe', '9A', '
[email protected]');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `elev_has_materie`
--
ALTER TABLE `elev_has_materie`
ADD CONSTRAINT `fk_elev_has_materie_elev` FOREIGN KEY (`elev_id`) REFERENCES `elev` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_elev_has_materie_materie1` FOREIGN KEY (`materie_id`) REFERENCES `materie` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
/*!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 */;