-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcafe_central(1).sql
103 lines (81 loc) · 2.3 KB
/
cafe_central(1).sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 21, 2017 at 05:15 PM
-- Server version: 5.6.26-log
-- PHP Version: 5.6.14
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 utf8mb4 */;
--
-- Database: `cafe_central`
--
-- --------------------------------------------------------
--
-- Table structure for table `cafe`
--
CREATE TABLE `cafe` (
`cafe_id` int(11) NOT NULL,
`Name` varchar(50) NOT NULL,
`Location` varchar(50) NOT NULL,
`Open_Time` time NOT NULL,
`Close_Time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `cafe`
--
INSERT INTO `cafe` (`cafe_id`, `Name`, `Location`, `Open_Time`, `Close_Time`) VALUES
(1, 'Cafe - ISB', 'Islamabad', '09:00:00', '21:00:00');
-- --------------------------------------------------------
--
-- Table structure for table `employees_cafe`
--
CREATE TABLE `employees_cafe` (
`empcafe_id` int(11) NOT NULL,
`emp_id` int(11) NOT NULL,
`cafe_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `managers`
--
CREATE TABLE `managers` (
`Manager_id` int(11) NOT NULL,
`Name` varchar(50) NOT NULL,
`Cafe_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `cafe`
--
ALTER TABLE `cafe`
ADD PRIMARY KEY (`cafe_id`);
--
-- Indexes for table `employees_cafe`
--
ALTER TABLE `employees_cafe`
ADD PRIMARY KEY (`empcafe_id`);
--
-- Indexes for table `managers`
--
ALTER TABLE `managers`
ADD PRIMARY KEY (`Manager_id`),
ADD KEY `cafe_id` (`Cafe_id`);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `managers`
--
ALTER TABLE `managers`
ADD CONSTRAINT `cafeid_fk` FOREIGN KEY (`Cafe_id`) REFERENCES `cafe` (`cafe_id`) ON DELETE NO ACTION ON UPDATE CASCADE;
/*!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 */;