Showing Page:
1/4
Ramon Magsaysay Memorial College
LABORATORY EXERCISE
FIRST SEMESTER: AY: 2020 2021
Name: __________________________ Schedule: __ Score: ________
Subject: IM101 Advance Database Instructor: _________________________ Date: _________
LABORATORY EXERCISE 3
SQL: DELETE and UPDATE
Learning Objectives
To visualize and understand the SQL DELETE script.
To understand and analyze the SQL UPDATE Script.
To determine the importance of DELETE AND UPDATE and handling data.
Prerequisite student experiences and knowledge
Database management has evolved from a specialized computer application to a central
component of a modern computing environment. As a result, knowledge about database systems
has become an essential part of computer science.
Background
SQL (Structured Query Language) is a nonprocedural language, and you specify what you
want, not how to get it. A block-structured format of English keywords uses in this Query
language. It has the following components. The SQL DDL (Data Definition Language) provides a
command for defining relation schemas, deleting relations, and modifying relation schema. DML
(Data Manipulation Language) includes commands to insert tuples into, delete tuples from and
modify tuples in the Database. Embedded and Dynamic SQL define how SQL statements can
embed within general-purpose programming languages, such as C, C++, JAVA, COBOL, Pascal, and
Fortran.
Materials/Resources
PC/Internet
Pen
MySQL (Xampp, Wampp & MySQL)
Web Browser (Internet Explorer, Mozilla, Google Chrome, Etc.)
Word-processing program
Laboratory Activity
Instructions: Perform the following steps.
1. Open the program Xampp
2. Click the Start for Apache and MySQL
3. Then, click MySQL Admin
4. Select Database, then click the Database created on laboratory exercise 1
5. Select the SQL menu, then
6. Insert the data below:
Bus Number
Source
Destination
CouchType
Fare
Showing Page:
2/4
Ramon Magsaysay Memorial College
LABORATORY EXERCISE
FIRST SEMESTER: AY: 2020 2021
Name: __________________________ Schedule: __ Score: ________
Subject: IM101 Advance Database Instructor: _________________________ Date: _________
BUS59
GENSAN
DAVAO
DELUXE
500
BUS60
DAVAO
MARBEL
LUXURY
450
BUS61
MARBEL
GENSAN
LUXURY
350
BUS62
GENSAN
TACURONG
SEMI-LUXURY
300
BUS63
DAVAO
GENSAN
LUXURY
500
7. Update the data below ""
Bus Number
Source
Destination
CouchType
Fare
BUS59
GENSAN
DAVAO
LUXURY
400
BUS60
DAVAO
MARBEL
LUXURY
350
BUS61
MARBEL
GENSAN
LUXURY
250
BUS62
GENSAN
TACURONG
SEMI-LUXURY
200
BUS63
DAVAO
GENSAN
LUXURY
400
8.
9. Select SQL menu, then type "SELECT * FROM bus WHERE fare<400;"
10. If you encounter the Error, then fix the Error
11. Display the result.
12. Print the result on the page provided.
QUESTIONS
1. What is the result of "DELETE * FROM bus WHERE Fair=400 AND"? Explain the result.
There is an error with the code above, It should be specific and complete. We should specify
what we should delete and write it on the script just right after the delete statement.
2. Base on the resulting syntax below? What is the result of this syntax? How the data
process and show the result? UPDATE BUS SET fere=’130' AND
SET=destination=’Polomolok' Where Bus_No=’BUS60'
There is an error with the script above and ithink it is because of the spelling of
some of the words written and we all need to make sure that the data or script
that we put should be what it be to avoid any error.
Showing Page:
3/4