Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED HELP CREATING/ ASSIGNING TEACHERS FOR EACH CLASS ! SET SQL_MODE = NO_AUTO_VALUE_ON_ZERO; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = +00:00; /*!40101 SET

NEED HELP CREATING/ ASSIGNING TEACHERS FOR EACH CLASS !

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";

SET AUTOCOMMIT = 0; START TRANSACTION; 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: `stdmgdb` --

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

-- -- Table structure for table `course` --

DROP TABLE IF EXISTS `course`; CREATE TABLE IF NOT EXISTS `course` ( `id` int(11) NOT NULL AUTO_INCREMENT, `label` varchar(50) NOT NULL, `hours_number` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;

-- -- Dumping data for table `course` --

INSERT INTO `course` (`id`, `label`, `hours_number`) VALUES (3, 'Information tech', 99), (5, 'html', 4), (8, 'javascript', 57), (10, 'mysql', 10), (11, 'jquery', 32), (12, 'sql', 17), (14, 'C++', 26);

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

-- -- Table structure for table `score` --

DROP TABLE IF EXISTS `score`; CREATE TABLE IF NOT EXISTS `score` ( `student_id` int(11) NOT NULL, `course_id` int(11) NOT NULL, `student_score` float NOT NULL, `description` varchar(150) NOT NULL, KEY `fk_score_student` (`student_id`), KEY `fk_score_course` (`course_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- -- Dumping data for table `score` --

INSERT INTO `score` (`student_id`, `course_id`, `student_score`, `description`) VALUES (22, 12, 10, 'ok'), (20, 10, 17.5, 'very good');

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

-- -- Table structure for table `student` --

DROP TABLE IF EXISTS `student`; CREATE TABLE IF NOT EXISTS `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(50) NOT NULL, `last_name` varchar(50) NOT NULL, `sex` varchar(10) NOT NULL, `birthdate` date NOT NULL, `phone` varchar(50) NOT NULL, `address` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1;

-- -- Dumping data for table `student` --

INSERT INTO `student` (`id`, `first_name`, `last_name`, `sex`, `birthdate`, `phone`, `address`) VALUES (16, 'Lisa', 'yuan', 'Female', '2017-06-09', '1234567890', 'aaaaa'), (18, 'john', 'bing', 'Male', '2017-06-09', '1234567890', 'aaaaa'), (19, 'Taylor', 'guam', 'Female', '2010-10-31', '122222', 'earth'), (20, 'nancy', 'stevens', 'Female', '2012-04-01', '987654345678', 'planet'), (21, 'frank', 'lenon', 'Male', '2004-06-17', '56765434', 'ttt'), (22, 'fernando', 'liam', 'Male', '2017-06-04', '98765678', 'new Test'), (23, 'baze', 'slam', 'Male', '2011-11-22', '111222457', 'earth');

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

-- -- Table structure for table `user` --

DROP TABLE IF EXISTS `user`; CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, `password` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

-- -- Dumping data for table `user` --

INSERT INTO `user` (`id`, `username`, `password`) VALUES (1, 'potato', 'ps123'), (2, 'robot', '112233'), (3, 'macckentaj', '123456');

-- -- Constraints for dumped tables --

-- -- Constraints for table `score` -- ALTER TABLE `score` ADD CONSTRAINT `fk_score_course` FOREIGN KEY (`course_id`) REFERENCES `course` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `fk_score_student` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`) ON DELETE CASCADE; COMMIT;

/*!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 */;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions