Course Solutions Uncategorized (Solved) : Execute Following Sql Successfully Create Two Tables Employee Department Set Foreignkeyche Q32042967 . . . .

(Solved) : Execute Following Sql Successfully Create Two Tables Employee Department Set Foreignkeyche Q32042967 . . . .

 

Execute the following SQL and successfully create two tables,employee and department.

# SET FOREIGN_KEY_CHECKS=1;
#
# DROP DATABASE IF EXISTS `COMPANY`;
# CREATE DATABASE `COMPANY`;
# USE `COMPANY`;

# TABLE: `COMPANY`.`employee`
CREATE TABLE `employee` (
`Fname` varchar(15) NOT NULL,
`Minit` char(1) DEFAULT NULL,
`Lname` varchar(15) NOT NULL,
`SSN` char(9) NOT NULL,
`bdate` date DEFAULT NULL,
`Address` varchar(30) DEFAULT NULL,
`sex` varchar(2) DEFAULT NULL,
`Salary` decimal(10,2) DEFAULT NULL,
`Super_ssn` char(9) DEFAULT NULL,
`Dno` int(11) NOT NULL,
PRIMARY KEY (`SSN`),
CONSTRAINT `employee_ibfk_1` FOREIGN KEY (`Dno`) REFERENCES`department` (`dnumber`)
);
# TABLE: `COMPANY`.`department`
CREATE TABLE `department` (
`dname` varchar(15) NOT NULL,
`dnumber` int(11) NOT NULL,
`mgr_ssn` char(9) NOT NULL,
`mgr_start_date` date DEFAULT NULL,
PRIMARY KEY (`dnumber`),
UNIQUE KEY `dname` (`dname`),
KEY `mgr_ssn` (`mgr_ssn`),
CONSTRAINT `department_ibfk_1` FOREIGN KEY (`mgr_ssn`) REFERENCES`employee` (`SSN`)
) ;

#drop table department;
#drop table

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post