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:
- Display the details of teachers whos office number is 128.
- Display the details of teachers whos office number is 129 or 130.
- Display the details of teachers whos office number is in (129, 130, 131)
- Display the details of courses taught by Mr. Asharul Islam
- Change the office of Mr. Raja from 130 to 131.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started