Professional Documents
Culture Documents
MySQL Practical 3
MySQL Practical 3
Customer
Customer Customer Name Customer Address
Number
1000 James 1-2nd Ave
1111 Mary 3235 Mukwati street
1100 John 1-2nd Ave
Orders
Order Number Order Date Customer Number
a123 16 October 2021 1000
a220 27 September 1100
2022
a233 27 September 1100
2022
Marks
Student Number Student Name Quiz 1 Quiz 2
S105666 Mary 45 60
S100001 John 87 40
S105000 James 50 50
Page 1|5
M. Chinyuku Database Systems 2023
b. Orders(onum, odate,cnum)
3. Insert into the customer table the following record (1001, John, Nguruve st)
Insert record – Syntax
INSERT INTO table_name (
field1, field2,...fieldN )
VALUES ( value1, value2,...valueN );
Page 2|5
M. Chinyuku Database Systems 2023
DELETE Syntax
DELETE FROM table_name [WHERE Condition];
Activity
In a college database. A lecturer can teach up to a maximum of 3 courses. Every lecturer must have a
course to teach. For every lecturer, employee id, name and the office is recorded. A course
may be offered in a semester or not at all. A course is defined by its course id, course name
and the department name to which it belongs. Each class is described by a unique classId,
day, times and venue.
Page 3|5
M. Chinyuku Database Systems 2023
LECTURER Table
LecturerID LecturerNam Office
e
E1001 Chinyuku E7
E1002 Kavu E8
E1003 Rugube E10
Page 4|5
M. Chinyuku Database Systems 2023
E1004 Phiri E8
E1005 Moyo E26
COURSE Table
CourseID CourseName Department
CUIT201 Database ICT
CUMT10 OR Maths
5
CUIT206 OOP ICT
CUIT208 Software Eng ICT
CUPE105 Logic Design Engineering
CUIT213 Data Comm Engineering
CUEB401 Database Business
CLASS Table
ClassI LecturerI CourseID Day Time Venu
D
C1001 E1002 CUIT206 Monday 0800 Tlab
C1002 E1001 CUIT201 Monday 1000 Tlab
C1003 E1005 CUPE105 Wednesday 1400 NEC2
C1005 E1004 CUMT105 Friday 1200 NEC3
a. Insert a new lecturer record with the following details (E1010, Moyo, E30)
b. Modify Class table such that all lectures on Monday are shifted to Friday
Page 5|5