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

(Solved) : 1 Suppose Designing Logic Circuit Segment 7 Segment Display See Fig F Right Represent Arab Q31575641 . . . .(Solved) : 1 Suppose Designing Logic Circuit Segment 7 Segment Display See Fig F Right Represent Arab Q31575641 . . . .

Please answer all parts of the question.<br/><img src="https://media.cheggcdn.com/media%2Fbea%2Fbea1c2f7-e31f-4d46-b459-5ad4ddb51f08%2Fimage.png" alt="1. Suppose we are designing a logic circuit for the A segment of a 7-segment display (see Fig. on the F right)