Question: Q 1: Write the SQL query to Create two tables Teacher and Course as per the below structure. Make Teacherno as primary key in the

Q 1: Write the SQL query to Create two tables Teacher and Course as per the below structure. Make Teacherno as primary key in the teacher table and foreign key in the course table. Insert 10 records in both the tables as given below.

Teacher Table

Teacherno

Teachername

Job

officeno

1211

Dr. Atef Masmoudi

HOD

128

1212

Ashique Rasool

Lecturer

129

1213

Raja Abdul Sattar

Lecturer

130

1214

Prof. Jalel Akaichi

Professor

131

1215

Prof. Jalel Akaichi

Professor

132

1216

Asharul Islam

Lecturer

128

1217

Hesham HUmmadi

Lecturer

129

1218

Dr. Usman Ahmed

Professor

130

1219

Dr. Yessine Alqassem

Professor

131

1220

Dr. Ali Algarwi

Dean

132

Course Table

courseno

coursename

crhr

day

Teacherno

121ISM

Intro to IS

3

1, 3

222ISM

DBMS

3

2, 4

223ISM

Data Mining

3

3, 5

224ISM

SAD - 1

3

2, 4

225ISM

GIS

3

1, 3

326ISM

SAD - 2

3

1, 3

341ISM

Operations Research

3

2, 4

362ISM

Internet Technologies

3

3, 5

383ISM

Knowledge Base System

3

2, 4

435ISM

Multimedia

3

1, 3

After inserting data write queries for the following:

  1. Display the details of teachers whos office number is 128.
  2. Display the details of teachers whos office number is 129 or 130.
  3. Display the details of teachers whos office number is in (129, 130, 131)
  4. Display the details of courses taught by Mr. Asharul Islam
  5. Change the office of Mr. Raja from 130 to 131.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!