Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
157 views

Lab 1 Database

This document is a laboratory exercise assignment for a database systems course. It provides instructions for students to create a table in SQL to store bus transportation data, then insert sample records and write queries. The objectives are to understand the SQL insert and select statements and how they can be used to add and retrieve data from the database table. Students are asked to perform steps in the XAMPP application to open MySQL, create a new database, define the table structure, insert records, and write queries to select specific records based on criteria. They then need to answer questions about the queries and output the results.

Uploaded by

Rheny Bondoc
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
157 views

Lab 1 Database

This document is a laboratory exercise assignment for a database systems course. It provides instructions for students to create a table in SQL to store bus transportation data, then insert sample records and write queries. The objectives are to understand the SQL insert and select statements and how they can be used to add and retrieve data from the database table. Students are asked to perform steps in the XAMPP application to open MySQL, create a new database, define the table structure, insert records, and write queries to select specific records based on criteria. They then need to answer questions about the queries and output the results.

Uploaded by

Rheny Bondoc
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 47

Ramon Magsaysay Memorial College

LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
LABORATORY EXERCISE 1
Theory and Concept

Learning Objectives
 Create tables and specify the questionnaires in SQL.

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

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 1


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

5. Then, Select textbox for Database name and type "databaseactivity1."

6. Select SQL then type “create table Bus (Bus_No varchar(5), source varchar(20), destination
varchar(20),CouchType varchar2(10),fair number);”
7. If you encounter the Error, then fix the Error
8. Display the result.
9. Print the result on the page provided.

QUESTIONS

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 2


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
1. What is the SQL script did you use to create a table ?

“create table Bus (Bus_No varchar(5), source varchar(20), destination varchar(20),CouchType


varchar2(10),fair number);”

2. Did you encounter Error in the syntax? How did you fix it? Show the previous SQL script, and
fix SQL script.
create table Bus (Bus_No varchar(5), source varchar(20), destination varchar(20),CouchType
varchar2(10),fairNumber int(20));

Output / Results

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 3


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

Conclusion

XAMPP is a cross-platform web server that is free and open-source. XAMPP is a short form for Cross-
Platform, Apache, MySQL, PHP, and Perl. XAMPP is a popular cross-platform web server that allows

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 4


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
programmers to write and test their code on a local webserver. It was created by Apache Friends, and the
public can revise or modify its native source code

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 5


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
LABORATORY EXERCISE 2
SQL: INSERT and SELECT

Learning Objectives
 To visualize and understand the SQL Select script.
 To understand and analyze the SQL Insert Script.
 To determine the importance of Insert and select 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 by using this script” INSERT INTO TABLE_NAME (column1, column2,
column3,...columnN) VALUES (value1, value2, value3,...valueN);”

Bus Number Source Destination CouchType Fair

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 6


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
BUS53 GENSAN DAVAO DELUXE 250
BUS54 DAVAO MARBEL LUXURY 425
BUS55 MARBEL GENSAN DELUXE 100
BUS56 GENSAN TACURONG SEMI-LUXURY 250
BUS57 DAVAO GENSAN LUXURY 300

7. Select SQL menu, then type "SELECT * FROM bus;"


8. If you encounter the Error, then fix the Error
9. Display the result.
10. Print the result on the page provided.

QUESTIONS

1. What is the result of "SELECT * FROM bus WHERE couch_type=LUXURY AND fair< 400"?

2. Base on the resulting syntax below? What is the result of this syntax? How the data process
and show the result?
INSERT INTO BUS(Bus_No, source, destination,CouchType,fair)
VALUES(BUS58,TACURONG,GENSAN,DELUXE,250.43);
SELECT * bus WHERE Bus_No=BUS58;".

Output / Results

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 7


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

Conclusion

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 8


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 9


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ 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


BUS59 GENSAN DAVAO DELUXE 500

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 10


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
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.

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'

Output / Results

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 11


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

Conclusion

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 12


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 13


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
LABORATORY EXERCISE 4
SQL JOINS

Learning Objectives
 To visualize and understand the SQL JOINS script.
 To determine the importance of JOINS 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/2
5. Select the SQL menu, then
6. Type
CREATE TABLE Bus_Company ( Company_ID int,Company varchar(128), Bus_No
int(15));

7. Insert data like sample below:


FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 14
Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

Company_ID Company Bus Number


COMP_0001 Yellow Bus BUS59
COMP_0002 Mindanao Star BUS60
COMP_0004 Husky BUS61
COMP_0003 Mindanao Star BUS62
COMP_0012 Yellow Bus BUS63

8. Select SQL menu, then type "SELECT * FROM bus CROSS JOIN Bus_Company."
9. If you encounter the Error, then fix the Error
10. Display the result.
11. Print the result on the page provided.

QUESTIONS

1. What is the result of "SELECT * FROM bus CROSS JOIN Bus_Company"? Explain the result.

2. Base on the resulting syntax below? What is the result of this syntax? How the data process
and show the result? How did you fix it if you encounter Error?
SELECT company_id, company, bus_number FROM bus CROSS JOIN where
company=Husky

Output / Results

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 15


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

Conclusion

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 16


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

LABORATORY EXERCISE 5
SQL JOIN: LEFT, RIGHT, FULL, AND SELF JOIN

Learning Objectives

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 17


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
 To visualize and understand the SQL LEFT, RIGHT, FULL, and SELF JOINS script.
 To determine the importance of JOINS 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/2
5. Select the SQL menu, then
6. Type
CREATE TABLE Bus_status (
Status_ID int,
Status varchar(68),
Bus_No int(15));
7. Insert data like sample below:

Status_ID Status Bus Number


STAT_0001 DAMAGE BUS59

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 18


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
STAT_0002 OK BUS60
STAT_0004 DAMAGE BUS61
STAT_0003 DAMAGE BUS62
STAT_0012 OK BUS63

8. Select SQL menu, then type "SELECT * FROM bus CROSS JOIN Bus_Company."
9. If you encounter the Error, then fix the Error
10. Display the result.
11. Print the result on the page provided.

QUESTIONS

1. What is the result of this SQL script "SELECT Bus_no, company_name FROM bus_status O
RIGHT JOIN bus C ON O.bus_nod = C.bus_no WHERE Status IS 'DAMAGE'"? Explain if you
encounter Error of the script and fix the Error?

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 19


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

2. What is the result of this SQL script? "SELECT SELECT Bus_no, compant_nameFROM
bus_status FROM bus C LEFT JOIN bus_status O ON O.bus_no = C.bus_no ORDER BY status '"?
Explain if you encounter Error of the script and fix the Error?

3. Base on the resulting syntax below? What is the result of this syntax? How the data process
and show the result? How did you fix it if you encounter Error?
SELECT B.bus_no AS busnum, B.fare AS fare, A.status AS status FROM Bus_status A,
Bus B WHERE A.bus_no <> B.bus_no ORDER BY A.bus_no

Output / Results

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 20


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

Conclusion

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 21


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

LABORATORY EXERCISE 6
LOGIN

Learning Objectives
 To visualize and understand how to use SQL statement for user login.
 To determine what SQL script use in implementing login or access form.

Prerequisite student experiences and knowledge


FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 22
Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
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
 Programming Application (Visual Studio, Netbeans)
 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/2
5. Select the SQL menu, then
6. Type
CREATE TABLE Users (
User_ID int(15) primary,
name char(128),
username char(64),
password char(64));
7. Insert data like the sample below:

User_ID Name Username Password


1 Xavier Royce Admin Admin101
2 Chi Tui Tuichi Manager101
3 Girl In Mabho MabhoInGirl Manager102

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 23


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
4 Charles Sagittarius SagiCha Manager103
5 Jesso Celestial AngBu Manager104

8. Then, open software for programming to create a form login

9. Then build a syntax for the user can log in to the form
10. If the user login on the form, if the username and password inputted by the user have
existed in the table using the message will appear "Welcome!", hence incorrect the
message will appear "Username/Password Invalid."
11. Display the result.
12. Save and Print the result in the page provided.

QUESTIONS

1. What method did you use to connect to the Database?

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 24


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

2. What Error or problem did you encounter? And how did you resolve the issue?

3. Indicate the full syntax and explain it?

Output / Results

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 25


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

Conclusion

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 26


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

LABORATORY EXERCISE 7
GUI: USER FORM (INSERT, DELETE, UPDATE, AND SEARCH/QUERY)

Learning Objectives
 To demonstrate the SQL statement in PL, such as Visual Studio / Java.
 To visualize and understand the role of the SQL statement in the Programming Languages.
 To determine what SQL script used in implementing in User Form.

Prerequisite student experiences and knowledge

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 27


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
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
 Programming Application (Visual Studio, Netbeans)
 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/2
5. Then, open your program in Laboratory Exercise 6
6. Create a new form and name the form User_form
a. The form must have:
i. Three textboxes for (Name, username, and password)
ii. Button (insert, delete, edit, save, and exit)
iii. Search Textbox and button for display the query information
iv. Table for displaying the list of data from Database to GUI form.
b. Note: The form must have a validation.
7. Then build a syntax
8. Display the result.
9. Save and print the result on the page provided.

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 28


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

QUESTIONS

1. What parts of the process in developing the laboratory exercise 7 give you a problem? Why?

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 29


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

2. Base on question number 1, how did you solve the problem?

3. Indicate the full syntax and explain it?

Output / Results

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 30


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

Conclusion

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 31


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

LABORATORY EXERCISE 8
GUI: BUS FORM (INSERT, DELETE, UPDATE AND SEARCH/QUERY)

Learning Objectives
 To demonstrate the SQL statement in PL, such as Visual Studio / Java.
 To visualize and understand the role of the SQL statement in the Programming Languages.
 To determine what SQL script used in implementing in BUS Form.

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

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 32


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
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
 Programming Application (Visual Studio, Netbeans)
 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/2
5. Then, open your program in Laboratory Exercise 6
6. Create a new form and name the form Bus_form
a. The form must have:
i. A field that fits on the table of the bus
ii. Button (insert, delete, edit, save, and exit)
iii. Search Textbox and button for display the query information
iv. Table for displaying the list of data from Database to GUI form.
b. Note: The form must have a validation.
7. Then build a syntax
8. Display the result.
9. Save and print the result on the page provided.

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 33


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

QUESTIONS

1. What parts of the process in developing the laboratory exercise 8 give you a problem? Why?

2. Base on question number 1, how did you solve the problem?

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 34


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

3. Indicate the full syntax and explain it?

Output / Results

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 35


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

Conclusion

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 36


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

LABORATORY EXERCISE 9
GUI: POSITION FORM (INSERT, DELETE, UPDATE, AND SEARCH/QUERY)

Learning Objectives
 To demonstrate the SQL statement in PL, such as Visual Studio / Java.
 To visualize and understand the role of the SQL statement in the Programming Languages.
 To determine what SQL script used in implementing in BUS Form.

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

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 37


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
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
 Programming Application (Visual Studio, Netbeans)
 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/2
5. Then, open your program in Laboratory Exercise 6
6. Create a new form and name the form Position form
a. The form must have:
i. A field that fits on the table of the Position
ii. Button (insert, delete, edit, save, and exit)
iii. Search Textbox and button for display the query information
iv. Table for displaying the list of data from Database to GUI form.
b. Note: The form must have a validation.
7. Then build a syntax
8. Display the result.
9. Save and Print the result in the page provided.

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 38


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

QUESTIONS

1. What parts of the process in developing the laboratory exercise 9 give you a problem? Why?

2. Base on question number 1, how did you solve the problem?

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 39


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

3. Indicate the full syntax and explain it?

Output / Results

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 40


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

Conclusion

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 41


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

LABORATORY EXERCISE 10
GUI: BUS ASSIGNMENT FORM (INSERT, DELETE, UPDATE AND SEARCH/QUERY)

Learning Objectives
 To demonstrate the SQL statement in PL, such as Visual Studio / Java.
 To visualize and understand the role of the SQL statement in the Programming Languages.
 To determine what SQL script used in implementing in BUS ASSIGNMENT Form.

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

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 42


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________
 PC/Internet
 Pen
 Programming Application (Visual Studio, Netbeans)
 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/2
5. Then, open your program in Laboratory Exercise 9
6. Create a new form and name the form Position form
a. The form must have:
i. A field that fits on the table of the Position
ii. Button (insert, delete, edit, save, and exit)
iii. Search Textbox and button for display the query information
iv. Table for displaying the list of data from Database to GUI form.
b. Note: The form must have a validation.
7. Then build a syntax
8. Display the result.
9. Save and print the result on the page provided.

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 43


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

QUESTIONS

1. What parts of the process in developing the laboratory exercise 10 give you a problem? Why?

2. Base on question number 1, how did you solve the problem?

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 44


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

3. Indicate the full syntax and explain it?

Output / Results

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 45


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

Conclusion

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 46


Ramon Magsaysay Memorial College
LABORATORY EXERCISE
____ SEMESTER: AY: _________

Name: _RHENY JAY Q. BONDOC_____________ Schedule: __ Score: ________


Subject: ___________________________ Instructor: __JIM JAMERO______________ Date:
_________

FUNDAMENTALS OF DATABASE SYSTEMS 2 | Jim S. Jamero, MIT 47

You might also like