-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassignment.sql
More file actions
153 lines (123 loc) · 3.75 KB
/
assignment.sql
File metadata and controls
153 lines (123 loc) · 3.75 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 02, 2024 at 02:08 AM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `assignment`
--
-- --------------------------------------------------------
--
-- Table structure for table `assignments`
--
CREATE TABLE `assignments` (
`AssignmentID` int(11) NOT NULL,
`CourseID` int(11) DEFAULT NULL,
`AssignmentName` varchar(100) DEFAULT NULL,
`Deadline` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `courses`
--
CREATE TABLE `courses` (
`CourseID` int(11) NOT NULL,
`CourseName` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `lectures`
--
CREATE TABLE `lectures` (
`LectureID` int(11) NOT NULL,
`CourseID` int(11) DEFAULT NULL,
`LectureTitle` varchar(100) DEFAULT NULL,
`LectureDate` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `students`
--
CREATE TABLE `students` (
`StudentID` int(11) NOT NULL,
`FirstName` varchar(50) DEFAULT NULL,
`LastName` varchar(50) DEFAULT NULL,
`Email` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `submissions`
--
CREATE TABLE `submissions` (
`SubmissionID` int(11) NOT NULL,
`AssignmentID` int(11) DEFAULT NULL,
`StudentID` int(11) DEFAULT NULL,
`SubmissionDate` datetime DEFAULT NULL,
`Grade` decimal(4,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `assignments`
--
ALTER TABLE `assignments`
ADD PRIMARY KEY (`AssignmentID`),
ADD KEY `CourseID` (`CourseID`);
--
-- Indexes for table `courses`
--
ALTER TABLE `courses`
ADD PRIMARY KEY (`CourseID`);
--
-- Indexes for table `lectures`
--
ALTER TABLE `lectures`
ADD PRIMARY KEY (`LectureID`),
ADD KEY `CourseID` (`CourseID`);
--
-- Indexes for table `students`
--
ALTER TABLE `students`
ADD PRIMARY KEY (`StudentID`),
ADD UNIQUE KEY `Email` (`Email`);
--
-- Indexes for table `submissions`
--
ALTER TABLE `submissions`
ADD PRIMARY KEY (`SubmissionID`),
ADD KEY `AssignmentID` (`AssignmentID`),
ADD KEY `StudentID` (`StudentID`);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `assignments`
--
ALTER TABLE `assignments`
ADD CONSTRAINT `assignments_ibfk_1` FOREIGN KEY (`CourseID`) REFERENCES `courses` (`CourseID`);
--
-- Constraints for table `lectures`
--
ALTER TABLE `lectures`
ADD CONSTRAINT `lectures_ibfk_1` FOREIGN KEY (`CourseID`) REFERENCES `courses` (`CourseID`);
--
-- Constraints for table `submissions`
--
ALTER TABLE `submissions`
ADD CONSTRAINT `submissions_ibfk_1` FOREIGN KEY (`AssignmentID`) REFERENCES `assignments` (`AssignmentID`),
ADD CONSTRAINT `submissions_ibfk_2` FOREIGN KEY (`StudentID`) REFERENCES `students` (`StudentID`);
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 */;