Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

email

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions