0% found this document useful (0 votes)
7 views1 page

Tutorial I 9.1.2025 A

The document outlines a tutorial for a Database System Concepts course at the University of Computer Studies (Taungoo), focusing on a social media database schema. It includes tasks related to identifying primary and foreign keys, constructing a schema diagram, and performing relational algebra expressions on a flight booking database. Specific queries are provided for analyzing passenger and flight data based on various conditions.

Uploaded by

myat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Tutorial I 9.1.2025 A

The document outlines a tutorial for a Database System Concepts course at the University of Computer Studies (Taungoo), focusing on a social media database schema. It includes tasks related to identifying primary and foreign keys, constructing a schema diagram, and performing relational algebra expressions on a flight booking database. Specific queries are provided for analyzing passenger and flight data based on various conditions.

Uploaded by

myat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

University of Computer Studies (Taungoo)

Second Year Computer Science & Technology


Database System Concepts (CST-2124)
Tutorial -1 (Second Year Section (A)) Date 9-1-2025
Users (user_id, user_name, email, password, profile_picture, bio, privacy_setting)
Posts (post_id, user_id, content, timestamp, visibility)
Likes ( like_id, user_id, post_id, timestamp, reaction_type)
Comments (comment_id, user_id, post_id, content, timestamp, replies)
Messages (message_id, sender_id, receiver_id, content, timestamp, read_status)
Friendships (friendship_id, first_user_id, second_user_id, status, timestamp)
Notification (notification_id, user_id, type, source_id, timestamp)
Media (media_id, user_id, file_type, file_url, timestamp)
Activity_logs (log_id, user_id, actionType, timestamp)
Figure 1: Social media database
1. Consider the social media database of Figure1. Assume that the ID number uniquely identify in each
table. What are the appropriate primary key and foreign key? (5 mark)
2. Construct a schema diagram for the social media database of Figure1. (5 mark)
3. Write down the expression with the relational algebra by considering the following Flight_booking
database. (15 mark)
Passenger ( pid, pname, pgender, pcity)
Flight ( fid, fdate, time, departure_city, arrival_city)
Booking ( pid, fid, num_of_seats)
(a) Find the id of passengers who lives in the same city.
(b) Find the passenger names who do not have any bookings in any flights.
(c) Get the details of flight that are scheduled on both date ‘2024/03/10’ and ‘2024/03/11’’.
(d) Get the details of passenger who have booked flight id ‘123’.
(e) Find the city of passengers who have booked from ‘Yangon’ to ‘Naypyitaw’.

You might also like