uppose that the following are true: all id column are primary keys in whichever table they are the dept_id in course table is foreign key that is referencing the id column in the department table the foreign keys stud_type_id, stud_cat_id in the student table are referencing the id columns in the student_type and student_category tables respectively. the coursecode and stud_id columns in the registration table are foreign keys in the course and student tables respectively. 1. Design an Entity Relationship Diagram for the system above. 2. Write query that would return the names and contacts of all Local students. 3. Write a query that would return names, contact and locations of all departments that has a location text with Ave 3 as part of it. [hint: use the LIKE clause with "_" or “%"] 4. What would be the result returned for the following query: SELECT first_name, last_name, student_type.name, student_category.name FROM student, student_type, student_category WHERE stud_type_id = student_type.id AND stud_cat_id = student_category.id AND student_type.name = "Sandwich";

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
Suppose that the following are true:
all id column are primary keys in whichever table they are
the dept id in course table is foreign key that is referencing the id column in the department table
the foreign keys stud_type_id, stud_cat_id in the student table are referencing the id columns
in the student_type and student_category tables respectively.
the coursecode and stud_id columns in the registration table are foreign keys in the course
and student tables respectively.
1. Design an Entity Relationship Diagram for the system above.
2. Write query that would return the names and contacts of all Local students.
3. Write a query that would return names, contact and locations of all departments that has a
location text with Ave 3 as part of it. [hint: use the LIKE clause with "_" or "%"]
4. What would be the result returned for the following query:
SELECT first_name, last_name, student_type.name,
student_category.name
FROM student, student_type, student_category
WHERE stud_type_id = student_type.id
AND stud_cat_id = student_category.id
AND student type.name = "Sandwich";
5. Write a query that would present the first and last names, student type and category of all
distance students.
6. What would be the result of the following query:
SELECT student.id, first_name, last_name, contact,
registration_type.name, course.code
FROM student, registration, registration_type, course
WHERE student.id = stud id
AND reg_type_id = registration_type.id
AND registration_type.name = "re-sit"
AND course_code = course.code;
7. Write a query that would return the names and date of birth of all students that have
registration_type of Normal.
8. Write a query that would return the first names, last names, contacts and student types of all
sandwich students.
9. What would be the results of this query:
SELECT course_code, department.name department
FROM course,registration, department
WHERE course.dept_id = department.id
AND course.code=course code
GROUP BY course code
ORDER BY course code desc;
10. Write a query that would return the departments names and the number of courses registered
from them.
Transcribed Image Text:Suppose that the following are true: all id column are primary keys in whichever table they are the dept id in course table is foreign key that is referencing the id column in the department table the foreign keys stud_type_id, stud_cat_id in the student table are referencing the id columns in the student_type and student_category tables respectively. the coursecode and stud_id columns in the registration table are foreign keys in the course and student tables respectively. 1. Design an Entity Relationship Diagram for the system above. 2. Write query that would return the names and contacts of all Local students. 3. Write a query that would return names, contact and locations of all departments that has a location text with Ave 3 as part of it. [hint: use the LIKE clause with "_" or "%"] 4. What would be the result returned for the following query: SELECT first_name, last_name, student_type.name, student_category.name FROM student, student_type, student_category WHERE stud_type_id = student_type.id AND stud_cat_id = student_category.id AND student type.name = "Sandwich"; 5. Write a query that would present the first and last names, student type and category of all distance students. 6. What would be the result of the following query: SELECT student.id, first_name, last_name, contact, registration_type.name, course.code FROM student, registration, registration_type, course WHERE student.id = stud id AND reg_type_id = registration_type.id AND registration_type.name = "re-sit" AND course_code = course.code; 7. Write a query that would return the names and date of birth of all students that have registration_type of Normal. 8. Write a query that would return the first names, last names, contacts and student types of all sandwich students. 9. What would be the results of this query: SELECT course_code, department.name department FROM course,registration, department WHERE course.dept_id = department.id AND course.code=course code GROUP BY course code ORDER BY course code desc; 10. Write a query that would return the departments names and the number of courses registered from them.
DCIT184
STAT181
Closely examine the following tables and use it to answer the questions that follow:
department
student_type
student_category
id
|name
| location
| contact
id
name
id
name
Computer Science
Mathematics
Statistics
Sociology
005 | History
English
Linguistic
North Ave 1 | +233234545453
North Ave 2 | +233234564554
North Ave 3
001
002
1 | Regular
2| Distance
3 | Sandwich
1 | Foreign
2| Local
003
+233285475547
004
East Ave 4
+233264638374
East Ave 2
+233244454744
006
East Ave 3
+233245653443
007
East Ave 4
+233268888888
course
code
| title
dept_id | credit
CSIT205
Object Oriented Techniques For IT Problem Solving
Applied IT Programming
Database Fundamentals
Office Productivity Tools
Programming Fundamentals
Introduction to History
History of The Gold Coast
Introduction To Basic Statistics
CSIT206
3
CSIT207
DCIT103
DCIT104
HIST101
5 |
3
HIST103
3
STAT101
Student
id
first_name
last_name
dob
contact
stud_cat_id | stud_type_id
e0000001
Stephen
Amankwah
1999-01-12
+233456789021
1
e0000002
Favor
Anekenu
2001-02-13
+243456789021
2
1
Anthony
Abel
Marvel
2005-02-15
2003-04-27
00000003
+123768875748
1
3
e0000004
Nelson
+656534875748
1
3
Samuel
Emmanuel
00000005
Laryeh
Naagba
Nuku
2000-07-24
+233208875748
1
e0000006
2002-06-07
+247654231565
e0000007
warrior
2003-09-25
+727868875748
2
e0000008
Abakok
| Mensah
2007-09-30
+876534875748
2
2
00000009
Charles
Anane
2009-10-27
+234308875748
2
registration
registration_type
stud_id | semester | reg_date
| reg_type_id | course_code
id| name
| 2020-Ө1-13 өө:00:00
| 2021-04-23 09:35:47
| 2020-01-13 00:00:00
2020-01-13 00:00:00
1 | STAT101
1 | DCIT103
1 | HIST101
| HIST103
2 | HIST101
Sem 1
1| Normal
| 2 | Re-sit
3 | Supplementary
1
Sem 1
Sem 1
1
Sem 1
Sem 1
1
2021-01-13 00:00:00
Sem 1
2021-01-13 00:00:00
1
CSIT205
Sem 1
2021-01-13 ее:ө0:0ө
1
CSIT207
2021-04-23 09:35:47
2019-81-1A e0:00:00
Sem 1
2
DCIT103
Sem 1
2019-01-10
1
DCIT103
Sem 1
2019-01-10 өө:өө:өө
1
Sem 1
2019-01-10 өө:ө0:00
Sem 1
2019-01-1ө өө:00:00
HIST103
Sem 1
Sem 1
2019-01-10 е0:ө0:0е
HIST101
2021-02-17 00:00:00
CSIT205
Sem 1
2021-01-17 e0:00:00
CSIT207
Sem 1
2019-01-10 e0:00:00
2
DCIT103
Sem 1
2021-04-23 09:35:47
2
DCIT103
8
Sem 1
2021-04-23 09:35:47
DCIT103
4
Sem 1
2021-04-23 09:35:47
2
DCIT103
9
Sem 1
2021-04-23 09:35:47
2
DCIT103
3
Sem 1
2021-04-22 20:40:46
1
CSIT206
3
Sem 1
2021-04-22 20:41:01
2 | CSIT207
Transcribed Image Text:DCIT184 STAT181 Closely examine the following tables and use it to answer the questions that follow: department student_type student_category id |name | location | contact id name id name Computer Science Mathematics Statistics Sociology 005 | History English Linguistic North Ave 1 | +233234545453 North Ave 2 | +233234564554 North Ave 3 001 002 1 | Regular 2| Distance 3 | Sandwich 1 | Foreign 2| Local 003 +233285475547 004 East Ave 4 +233264638374 East Ave 2 +233244454744 006 East Ave 3 +233245653443 007 East Ave 4 +233268888888 course code | title dept_id | credit CSIT205 Object Oriented Techniques For IT Problem Solving Applied IT Programming Database Fundamentals Office Productivity Tools Programming Fundamentals Introduction to History History of The Gold Coast Introduction To Basic Statistics CSIT206 3 CSIT207 DCIT103 DCIT104 HIST101 5 | 3 HIST103 3 STAT101 Student id first_name last_name dob contact stud_cat_id | stud_type_id e0000001 Stephen Amankwah 1999-01-12 +233456789021 1 e0000002 Favor Anekenu 2001-02-13 +243456789021 2 1 Anthony Abel Marvel 2005-02-15 2003-04-27 00000003 +123768875748 1 3 e0000004 Nelson +656534875748 1 3 Samuel Emmanuel 00000005 Laryeh Naagba Nuku 2000-07-24 +233208875748 1 e0000006 2002-06-07 +247654231565 e0000007 warrior 2003-09-25 +727868875748 2 e0000008 Abakok | Mensah 2007-09-30 +876534875748 2 2 00000009 Charles Anane 2009-10-27 +234308875748 2 registration registration_type stud_id | semester | reg_date | reg_type_id | course_code id| name | 2020-Ө1-13 өө:00:00 | 2021-04-23 09:35:47 | 2020-01-13 00:00:00 2020-01-13 00:00:00 1 | STAT101 1 | DCIT103 1 | HIST101 | HIST103 2 | HIST101 Sem 1 1| Normal | 2 | Re-sit 3 | Supplementary 1 Sem 1 Sem 1 1 Sem 1 Sem 1 1 2021-01-13 00:00:00 Sem 1 2021-01-13 00:00:00 1 CSIT205 Sem 1 2021-01-13 ее:ө0:0ө 1 CSIT207 2021-04-23 09:35:47 2019-81-1A e0:00:00 Sem 1 2 DCIT103 Sem 1 2019-01-10 1 DCIT103 Sem 1 2019-01-10 өө:өө:өө 1 Sem 1 2019-01-10 өө:ө0:00 Sem 1 2019-01-1ө өө:00:00 HIST103 Sem 1 Sem 1 2019-01-10 е0:ө0:0е HIST101 2021-02-17 00:00:00 CSIT205 Sem 1 2021-01-17 e0:00:00 CSIT207 Sem 1 2019-01-10 e0:00:00 2 DCIT103 Sem 1 2021-04-23 09:35:47 2 DCIT103 8 Sem 1 2021-04-23 09:35:47 DCIT103 4 Sem 1 2021-04-23 09:35:47 2 DCIT103 9 Sem 1 2021-04-23 09:35:47 2 DCIT103 3 Sem 1 2021-04-22 20:40:46 1 CSIT206 3 Sem 1 2021-04-22 20:41:01 2 | CSIT207
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY