SQL Practice-HR DataBase
SQL Practice-HR DataBase
--
-- Table structure for table `departments`
--
create database hr;
use hr;
DROP TABLE IF EXISTS `departments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `departments` (
`department_id` int unsigned NOT NULL,
`department_name` varchar(30) NOT NULL,
`manager_id` int unsigned DEFAULT NULL,
`location_id` int unsigned DEFAULT NULL,
PRIMARY KEY (`department_id`),
KEY `location_id` (`location_id`),
KEY `manager_id` (`manager_id`),
CONSTRAINT `departments_ibfk_1` FOREIGN KEY (`location_id`) REFERENCES
`locations` (`location_id`),
CONSTRAINT `departments_ibfk_2` FOREIGN KEY (`manager_id`) REFERENCES `employees`
(`employee_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `departments`
--
--
-- Table structure for table `employees`
--
--
-- Dumping data for table `employees`
--
--
-- Table structure for table `countries`
--
--
-- Dumping data for table `countries`
--
--
-- Table structure for table `job_history`
--
--
-- Dumping data for table `job_history`
--
--
-- Table structure for table `jobs`
--
--
-- Dumping data for table `jobs`
--
--
-- Table structure for table `locations`
--
--
-- Dumping data for table `locations`
--
--
-- Table structure for table `regions`
--
--
-- Dumping data for table `regions`
--