0% found this document useful (0 votes)
23 views

DB - Lab 2 - Lab Tasks

The document describes a lab assignment for a database systems course. Students are instructed to execute queries on a Sakila sample database to complete tasks like displaying staff information, finding a film description, and listing rental rates over $2.99.

Uploaded by

Muhammad Shahbaz
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)
23 views

DB - Lab 2 - Lab Tasks

The document describes a lab assignment for a database systems course. Students are instructed to execute queries on a Sakila sample database to complete tasks like displaying staff information, finding a film description, and listing rental rates over $2.99.

Uploaded by

Muhammad Shahbaz
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

Database Systems Lab (CS-232 )

Database Systems - Lab 2

Namal University Mianwali


Faculty of Computer Science

Lab
Instruct Ms. Asiya Batool Dated 06-03-2024
or
Name MUHAMMAD SHAHBAZ Roll No 30
Max
10 Obtained Marks
Marks

Lab 02 – Lab Tasks


Note :
 Use Sakila database that you created in the previous lab to execute the queries.
 The schema of the database is given on last page.
 Proper alias name should be displayed for column name in result instead of table column name. For
example Film ID should be displayed instead of film_id in the result.
 All the required columns in the task should be displayed in the result.

Write SQL queries for the following tasks.

Task 1 Display Staff id and Full Name of Staff.

Query mysql> select staff_id AS ID,CONCAT(first_name ,last_name) AS FULLNAME from staff;

Output

Task 2 Display the description of the film with film_id 5.

Query mysql> select description AS DESCRIPTION ,film_id AS "FILM ID" from film where film_id=5;

Output

Task 3 List the rental rate and duration for film titles with a rental rate greater than $2.99.

mysql> select rental_duration AS "RENTAL DURATION" ,rental_rate AS "RENTAL RATE" from


Query
film where rental_rate>2.99;

You might also like