Question
Question 3 Student Table student_id (PK) first_name last_name age address_id last_update Address Table address_id (PK) address address2 county town post_code phone last_update Lecturer Table lecturer_id
Question 3
Student Table | |||||
student_id (PK) | first_name | last_name | age | address_id | last_update |
Address Table | |||||||
address_id (PK) | address | address2 | county | town | post_code | phone | last_update |
Lecturer Table |
| ||||||
lecturer_id (PK) | module_id | first_name | last_name | | address_id | last_update | |
|
| Module Table | ||||||
module_id (PK) | code | description | classroom_id | start_date | end_date | last_update | ||
Classroom Table | ||||
classroom_id (PK) | room_number | building_code | max_size |
|
Write SQL queries based on the tables shown above that return the data requested below. Primary Keys identified by (PK).
Return the first name, last name and student_id of all students whose age is less than 18. (4 marks)
Return the code, description, start_date and end_date of all modules whose code is exactly 2 characters long (4 marks)
Return the first name, last name and town of all students who live in county Carlow
(6 marks)
Return the title of every module that is held in building JS (6 marks)
Total: 20 Marks
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