-- phpMyAdmin SQL Dump
-- version 3.1.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 01, 2009 at 12:51 AM
-- Server version: 5.1.30
-- PHP Version: 5.2.1

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!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: `complete_concepts_problem`
--
CREATE DATABASE `complete_concepts_problem` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `complete_concepts_problem`;

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

--
-- Table structure for table `company`
--

CREATE TABLE IF NOT EXISTS `company` (
  `cname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `city` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`cname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `company`
--

INSERT INTO `company` (`cname`, `city`) VALUES
('Anonymous IT', 'Chittagong'),
('Dream Tech', 'Chittagong'),
('First Bank Corporation', 'Dhaka'),
('JONS IT (Pvt.) Limited', 'Sylhet'),
('Small Bank Corporation', 'Dhaka'),
('Square Pharma', 'Bogra'),
('The ONE Limited', 'Dhaka'),
('Unique Softs', 'Dhaka'),
('Unknown Systems', 'Rajshahi'),
('Vegabond Company', 'Bogra');

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

--
-- Table structure for table `employee`
--

CREATE TABLE IF NOT EXISTS `employee` (
  `ename` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `street` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `city` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ename`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `employee`
--

INSERT INTO `employee` (`ename`, `street`, `city`) VALUES
('Barkat', 'x', 'Bogra'),
('Jabbar', 'x', 'Comilla'),
('Jubayer', 'u', 'Faridpur'),
('Najmun Nahar', 'y', 'Sylhet'),
('Oronno', 'z', 'Dhaka'),
('Rafique', 'z', 'Rajshahi'),
('Rahim', 'w', 'Dhaka'),
('Sabbir', 'v', 'Chittagong'),
('Salam', 'y', 'Comilla'),
('Sharafat', 'w', 'Dhaka');

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

--
-- Table structure for table `manages`
--

CREATE TABLE IF NOT EXISTS `manages` (
  `ename` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `mname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  KEY `ename` (`ename`),
  KEY `mname` (`mname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `manages`
--

INSERT INTO `manages` (`ename`, `mname`) VALUES
('Rahim', 'Sharafat'),
('Barkat', 'Sharafat'),
('Salam', 'Sharafat'),
('Rafique', 'Oronno'),
('Jabbar', 'Oronno'),
('Najmun Nahar', 'Sabbir'),
('Jubayer', 'Sabbir');

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

--
-- Table structure for table `works`
--

CREATE TABLE IF NOT EXISTS `works` (
  `ename` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `salary` bigint(20) NOT NULL,
  `jdate` date NOT NULL,
  KEY `ename` (`ename`),
  KEY `cname` (`cname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `works`
--

INSERT INTO `works` (`ename`, `cname`, `salary`, `jdate`) VALUES
('Rahim', 'First Bank Corporation', 50000, '2008-01-01'),
('Barkat', 'First Bank Corporation', 40000, '2007-01-01'),
('Salam', 'First Bank Corporation', 60000, '2009-07-01'),
('Rafique', 'Small Bank Corporation', 30000, '2009-06-08'),
('Sharafat', 'First Bank Corporation', 80000, '2005-06-01'),
('Jabbar', 'Small Bank Corporation', 10000, '2009-06-05'),
('Najmun Nahar', 'Small Bank Corporation', 20000, '2009-06-30'),
('Oronno', 'The ONE Limited', 50000, '2007-06-01'),
('Jubayer', 'Square Pharma', 15000, '2008-01-01'),
('Sabbir', 'Vegabond Company', 100000, '2001-01-01');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `manages`
--
ALTER TABLE `manages`
  ADD CONSTRAINT `manages_ibfk_2` FOREIGN KEY (`mname`) REFERENCES `employee` (`ename`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `manages_ibfk_1` FOREIGN KEY (`ename`) REFERENCES `employee` (`ename`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `works`
--
ALTER TABLE `works`
  ADD CONSTRAINT `works_ibfk_2` FOREIGN KEY (`cname`) REFERENCES `company` (`cname`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `works_ibfk_1` FOREIGN KEY (`ename`) REFERENCES `employee` (`ename`) ON DELETE CASCADE ON UPDATE CASCADE;
