0% found this document useful (0 votes)
38 views4 pages

Activity 03

This activity sheet involves creating and manipulating a database and table of movie information. [1] Students are asked to write SQL queries to [2] create a database named "db_rental" and a table named "tbl_movies" with columns for movie details. [3] Another query populates the table with initial movie records. The remaining questions involve writing queries to [4] select specific records based on criteria, [5] insert a new record, [6] update a record, [7] delete a record, [8] sort the table, and [9] retrieve records by multiple criteria.

Uploaded by

Jamaico Garcia
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)
38 views4 pages

Activity 03

This activity sheet involves creating and manipulating a database and table of movie information. [1] Students are asked to write SQL queries to [2] create a database named "db_rental" and a table named "tbl_movies" with columns for movie details. [3] Another query populates the table with initial movie records. The remaining questions involve writing queries to [4] select specific records based on criteria, [5] insert a new record, [6] update a record, [7] delete a record, [8] sort the table, and [9] retrieve records by multiple criteria.

Uploaded by

Jamaico Garcia
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/ 4

Republic of the Philippines

CAVITE STATE UNIVERSITY


Bacoor City Campus
SHIV, Molino VI, City of Bacoor

DEPARTMENT OF COMPUTER STUDIES


DCIT 55: ADVANCED DATABASE SYSTEMS
Activity Sheet
2nd Semester, A.Y. 2020-2021

INTENDED LEARNING OUTCOMES

After the completion of the unit, students will be able to:

1. create SQL commands; and


2. identify proper SQL commands for each given output.

Name: Delos Reyes, Franklin M. Date: April 24,


2021
Course/Yr&Section: BSIT1-1 Score:

ACTIVITY 03: SETTING UP THE DATABASE AND BASIC DATA


MANIPULATION

DIRECTION:

Write the appropriate query on the space provided. (3 points each)

1. Write a query to create a database named db_rental

CREATE DATABASE
db_rental;

2. Write a query to create a table named tbl_movies with the following columns:
movie_id, title, actor, genre and director. Use the appropriate data type
and constraints in each column.
CREATE TABLE tbl_movies (
movie_id,
title,
actor,
genre,
director );

3. Populate the table with the following records.

INSERT INTO tbl_movies (movie_id, title, actor, genre, director)


VALUES (‘1000’, ‘Hello, Love’, ‘Goobye’, ‘Alden and Kathryn’, ‘Romantic
Drama’, ‘Cathy Garcia-Molina’),
(‘1001’, ‘The How of Us’, ‘Daniel and Kathryn’, ‘Romantic Drama’, ‘Cathy
Garcia-Molina’),
(‘1002’, ‘Four Sister and a Wedding’, ‘Bea Alonzo’, ‘Dramatic Comedy’, ‘Cathy
Garcia-Molina’),
(‘1003’, ‘She’s dating the Gangster’, ‘Daniel and Kathryn’, ‘Dramatic Comedy’,
‘Cathy Garcia-Molina’);
(‘1004’, ‘Metro Manila’, ‘John Arcilla’, ‘Dramatic Action’, ‘Sean Ellis’), (‘1005’,

4. Write a query that will show the title and actor of movies directed by Cathy
Garcia-Molina.

SELECT title, actor FROM tbl_movies WHERE director=” Cathy Garcia-


Molina”

5. Write a query that will show all fields of dramatic comedy movies.
SELECT * FROM tbl_movies WHERE genre=” Dramatic Comedy”

6. Write a query that will insert a new data provided the ff: title=Cuddle Weather,
actor=Sue Ramirez and genre=Romantic Drama.

INSERT INTO tbl_movies (title, actor, genre) VALUES (‘Cuddle Weather’, Sue
Ramirez’, ‘Romantic Drama’)

7. Write a query that will modify the actor of movie 1002. (actor=Brenna Garcia)

SELECT actor FROM tbl_movies WHERE movie_id=”1002”

8. Write a query that will delete the records of the movie Dukot.

DELETE FROM tbl_movies WHERE title=” Dukot”

9. Write a query that will sort the table based on the title of the movie in ascending
order.

SELECT * FROM tbl_movies ORDER BY title

10. Write a query that will retrieve the title, genre and director of the movie done by
Daniel and Kathryn.
SELECT title, genre, director FROM tbl_movies WHERE actor=” Daniel and
Kathryn”

You might also like