Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Teacher Initial:

Daffodil International University DTB


Spring 2021
Department of Computer Science and Engineering
Final Assessment Answer Script
Full Marks: 40 Allowed, Time: 7:00 hrs.
Date: Saturday 24, April 2021

General Information (must be filled by the student)


COURSE CODE: CSE313
CSE311 SECTION: A PROGRAM: DAY

STUDENT ID: 191-15-12481 TIME STARTED: 10:00 AM TIME ENDED: 04:00 PM


5:00 PM

[Student must either TYPE or HAND WRITE the answers in this template; In case needed
just write your detail on the paper using hand]

** Plagiarism will be checked while you submit your response. You are advised to be honest
during the open book exam.
Student ID:

Ans to the question no: 1


Teacher :

0NF

teacher ( teacher_id,teacher_first_name, teacher_surname, teacher_street,


teacher_suburb, teacher_postcode, teacher_phone, teacher_email,
teacher_password, lession booking id, studentid,category id, teacher_photo,
teacher_time_slot, confirmation id, confirmation_status, language, Alb
registration no, level, qualification, reference_name, reference_phone,
teacher_testimonial)

1nf

teacher ( teacher_id,teacher_password,teacher_email,lesson booking


id,studentid,category id,teacher_photo, teacher_testimonial)

contact (teacher_phone)

reference(teacher_id,reference_name,reference_phone)

language( teacher_id,qualification, alb registration no,level)

teacher_status ( teacher_id,teacher_time_slot)

confirmation info(teacher_id,confirmation_id,confirmation_status)

2nf

teacher (teacher_id,teacher_password,teacher_email,
teacher_photo,reference,teacher_testimonial)

teacher_name (teacher_first_name,teacher_surname)

teacher_address ( teacher_suburb,teacher_street)

contact (teacher_phone)

join (teacher_id,booking_id,studentid,category_id)

2
Student ID:

reference(teacher_id,reference_name,reference_phone,)

language( teacher_id,qualification,alb_registration_no,level)

teacher_status ( teacher_id,teacher_time_slot)

confirmation_info(confirmation_id,confirmation_status)

3nf

teacher (teacher_id,teacher_password,teacher_email,
teacher_photo,teacher_testimonial)

teacher_name (teacher_first_name,teacher_surname)

teacher_address (teacher_suburb,teacher_street)

contact (teacher_phone)

join (teacher id,booking id,studentid,category id)

reference(teacher id,reference_name,reference phone)

language( teacher_id,qualification,alb_registration_no,level)

teacher_status ( teacher_time_slot)

confirmation_info(confirmation_id,confirmation_status)

3
Student ID:

course:
0nf course ( course_id, teacher_id, language,level,distance,transport,cost_rate)

1nf course ( course_id, course_id, language,level,distance,transport,cost_rate)

2nf course (course_id,language,level,distance,transport,cost_rate)

info (course_id,teacher_id)

3nf

course ( course id,language)

transport_info (course_id,distance,transport,cost_rate)

info (course_id,teacher_id)

Student :

0nf student( student id, teacher_id,student_name,


student_password,student_email,student_phone,student_address,feeback)

1nf

student ( student_id, teacher_id,student_name,


student_password,student_email, student_address,feebeck)

student_contact (student_phone)

2nf

student ( student_id ,student_name, student_password, student_email,


student_address,feedback)

student_info (student_id,course_id)

student_contact (student_phone)

3nf

student (student_id ,student_name, student_password, student_email,


student_address,feedback)

4
Student ID:

student_info (student_id,course_id)

student_contact (student_phone)

Booking request
0nf ( booking_id,teacher_id,course_id,student_id,
payment_id,payment_type,payment_cost,payment_date,booking
_confirmation id,lesson_type)

1nf

booking
(booking_id,teacher_id,course_id,student_id,Confirmation_id,payment
_id,payment_type, cost,payment_date,lesson_type)

2nf

booking
(booking_id,teacher_id,course_id,student_id,Confirmation_id,lesson_type)

Payment(confirmation_id,payment_id,payment_type,cost,payment_date,cour
se_type)

3nf

booking
(booking_id,teacher_id,course_id,student_id,Confirmation_id,lesson_type)

5
Student ID:

payment(confirmation_id,payment_id,payment_type,cost,payment_date,cour
se_type)

Ans to the question no 2

CREATE DATABASE language_gurus;

CREATE TABLE teacher(

teacher_id int PRIMARY KEY,

teacher_email varchar(255),

teacher_password varchar(255),

teacher_testimonial varchar(255),

teacher_photo varchar(255)

);

CREATE TABLE teacher_name(

teacher_id int ,

teacher_first_name varchar(50),

teacher_surname varchar(255),

FOREIGN KEY(teacher_id)

REFERENCES teacher(teacher_id)

);

6
Student ID:

CREATE TABLE teacher_address(

teacher_id int,

teacher_suburb VARCHAR(100),

teacher_street VARCHAR(100),

FOREIGN KEY(teacher_id)

REFERENCES teacher(teacher_id)

);

CREATE TABLE contact(

teacher_id int,

teacher_phone int,

FOREIGN KEY(teacher_id)

REFERENCES teacher(teacher_id)

);

CREATE TABLE reference(

teacher_id int,

reference_name varchar(255),

reference_phone varchar(255),

FOREIGN KEY(teacher_id)

REFERENCES teacher(teacher_id)

);

7
Student ID:

CREATE TABLE language(

teacher_id int,

qualification VARCHAR(50),

alb_registration_no int,

level int(3),

FOREIGN KEY(teacher_id)

REFERENCES teacher(teacher_id)

);

CREATE TABLE teacher_status(

teacher_id int ,

teacher_time_slot VARCHAR(100),

FOREIGN KEY(teacher_id)

REFERENCES teacher(teacher_id)

CREATE TABLE confirmation_info(

teacher_id int,

confirmation_id int,

confirmation_status int(1),

FOREIGN KEY(teacher_id)

REFERENCES teacher(teacher_id)

);

8
Student ID:

INSERT INTO teacher VALUES

(1001,'ssadman@gmail.com','2655','good','ssadman.jpg')

(1002,'sakib@gmail.com','56456','good','sakib.jpg')

INSERT INTO teacher_name VALUES

(1001,'sakib','sadman')

(1002,'ssadman','ananna')

INSERT INTO teacher_address VALUES

(1001,'6th road','dhaka')

(1002,'7th road','cantonment')

INSERT INTO teacher_contact VALUES

(1001,0174726)

(1002,01754544)

INSERT INTO reference VALUES

(1001,'jon liani','95921919')

(1002,'rena lopiana','54654654')

INSERT INTO lanuage VALUES

(1001,'melbourne language center',98431,8)

(1002,'rajabazar language center',556456,5)

9
Student ID:

INSERT INTO confirmation_info VALUES

(1001,54,yes)

(1002,45,no)

INSERT INTO teacher_status values

(1001,3-4)

(1001,6-5)

(1002,9-8)

DROP TABLE teacher_status;

DROP TABLE confirmation_info;

DROP TABLE lanuage;

DROP TABLE reference;

DROP TABLE teacher_contact;

DROP TABLE teacher_address;

DROP TABLE teacher_name;

DROP TABLE teacher;

CREATE TABLE course(

course_id int PRIMARY KEY,

language varchar(100)

);

10
Student ID:

CREATE TABLE transport_info(

course_id int,

distance varchar(10),

transport varchar(30),

cost_rate float(10,2),

FOREIGN KEY(course_id)

REFERENCES course(course_id)

);

CREATE TABLE info(

course_id int,

teacher_id int,

FOREIGN KEY(course_id)

REFERENCES course(course_id),

FOREIGN KEY(teacher_id)

REFERENCES teacher(teacher_id)

);

11
Student ID:

INSERT INTO course VALUES

(cse311,'italian')

(cse312,'english')

INSERT INTO transport VALUES

(cse311,'2-5 km','private car',28$)

(cse312,'5-6 km','bus',42$)

INSERT INTO course_info VALUES

(cse311,1001)

(cse312,1002)

DROP TABLE course_info;

DROP TABLE transport;

DROP TABLE course;

CREATE TABLE student(

student_id int PRIMARY KEY,

student_name varchar(200),

student_email varchar(255),

12
Student ID:

student_password varchar(255),

student_address varchar(255),

feedback varchar(100)

);

CREATE TABLE student_info(

student_id int,

course_id int,

FOREIGN KEY(course_id)

REFERENCES course(course_id),

FOREIGN KEY(student_id)

REFERENCES student(student_id)

);

CREATE TABLE student_contact(

student_id int,

student_phone VARCHAR(255),

FOREIGN KEY(student_id)

REFERENCES student(student_id)

);

13
Student ID:

INSERT INTO student VALUES

(12260,'sadman','ssadman@gmail.com','54','dhaka cantonment','best')

(12261,'sakib','sakib@gmail.com','465','dhaka cantonment','good')

INSERT INTO course_info VALUES

(12260,cse311)

(12261,cse312)

INSERT INTO student_contact VALUES

(12260,'01765464)

(12261,'65554')

DROP TABLE student_contact;

DROP TABLE course_info;

DROP TABLE student;

CREATE TABLE booking(

booking_id int PRIMARY KEY,

teacher_id int,

course_id int,

student_id int,

confirmation_id int,

lesson_type varchar(50),

14
Student ID:

FOREIGN KEY(teacher_id)

REFERENCES teacher(teacher_id),

FOREIGN KEY(course_id)

REFERENCES course(course_id),

FOREIGN KEY(student_id)

REFERENCES student(student_id),

CONSTRAINT FK_Personbooking1 FOREIGN KEY (Confirmation_id )

REFERENCES teacher(Confirmation_id)

);

CREATE TABLE payment(

booking_id int PRIMARY KEY,

confirmation_id int,

payment_id int ,

payment_type int(1),

cost float(10,2),

payment_date date,

course_type varchar(50),

FOREIGN KEY(confirmation_id)

REFERENCES teacher(confirmation_id),

FOREIGN KEY(booking_id)

REFERENCES booking(booking_id)

);

15
Student ID:

INSERT INTO booking VALUES

(1,1001,cse311,12260,54,'regular')

(2,1002,cse312,12261,45,'single')

INSERT INTO payment VALUES

(1,54,12'1',4555.2,2020-21-5,'regular')

(2,45,13,0,4254.2,2020-20-4,'single')

DROP TABLE payment;

DROP TABLE booking;

16

You might also like