SQL Bondoc
SQL Bondoc
LABORATORY EXERCISE
FIRST SEMESTER: AY: 2021 – 2022
Learning Objectives
To understand how to create a database and tables.
To identify the roles of tables and fields.
To know how to create and drop a database or table.
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 SQL
4. Type SQL Script
CREATE DATABASE IntroSQL;
5. Then, select IntroSQL and select SQL
6. Type SQL script for tbl_user
CREATE TABLE IF NOT EXISTS tbl_user (
user_id INT AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
username VARCHAR(255) NOT NULL,
Ramon Magsaysay Memorial College
LABORATORY EXERCISE
FIRST SEMESTER: AY: 2021 – 2022
2. Run the script below. What happens to the script that you implement?
DROP TABLE tbl_product;
3. Did you encounter an error in the syntax? How did you fix it? Show the previous SQL
script, and fix the SQL script.
I encounter a wrong name or mistype variable in the db_conn.php and I retype it with
the correct spelling of the variable.
Ramon Magsaysay Memorial College
LABORATORY EXERCISE
FIRST SEMESTER: AY: 2021 – 2022
Conclusion
The xampp software is user friendly to use because when I insert some data to the table I simply
click the insert and put the data in it.