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.

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

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.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 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