[go: up one dir, main page]

0% found this document useful (0 votes)
830 views8 pages

Week 1 Day 1: Xampp Installation Guide

This document provides an overview and installation guide for XAMPP and Termux. It discusses what XAMPP is, provides an SQL overview covering relational databases, data definition, manipulation, and SQL standards. It also covers installing and using the XAMPP control panel. The document then shifts to discussing MySQL commands, database concepts, data types, creating tables with examples, selecting, inserting, updating, deleting data with SQL statements, and using logical operators like BETWEEN, LIKE and ORDER BY.
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)
830 views8 pages

Week 1 Day 1: Xampp Installation Guide

This document provides an overview and installation guide for XAMPP and Termux. It discusses what XAMPP is, provides an SQL overview covering relational databases, data definition, manipulation, and SQL standards. It also covers installing and using the XAMPP control panel. The document then shifts to discussing MySQL commands, database concepts, data types, creating tables with examples, selecting, inserting, updating, deleting data with SQL statements, and using logical operators like BETWEEN, LIKE and ORDER BY.
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/ 8

WEEK 1 DAY 1

XAMPP, TERMUX INSTALLATION GUIDE

XAMPP INSTALLATION GUIDE


What is XAMPP?
XAMPP is a completely free, easy to install Apache distribution containing MariaDB, PHP, and Perl. The
XAMPP open source package has been set up to be incredibly easy to install and to use

SQL Overview
 SQL is a programming language for Relational Databases. It is designed over relational algebra
and tuple relational calculus. SQL comes as a package with all major distributions of RDBMS.
 SQL comprises both data definition and data manipulation languages. Using the data definition
properties of SQL, one can design and modify database schema whereas data manipulation
properties allows SQL to store and retrieve data from database. SQL is a standard language for
storing, manipulating and retrieving data in databases.

XAMMP CONTROL PANEL

mysql -u root -p
CHAPTER 1 TO 4
CHAPTER 4

RESULT AND DISCUSSION


GRAPHICAL USER INTERFACE

CHAPTER 5:
SUMMARY
CONCLUSION
RECOMMENDATION
SOURCE CODE
REFERENCES
C.V
BLANK PAPER

SPECS:
.5 MARGIN EXPECT LEFT WHICH IS 1 INCHES
font style, font style
short band paper 8.5 x 11

APR 4 -DEADLINE - CAPSTONE PROJECT DOCUMENTATION (HARDBOUND)

CHAPTER 1 TO 4
CHAPTER 4:

RESULT AND DISCUSSION


GRAPHICAL USER INTERFACE

Summary of CODES
1. mysql -u root -p = To connect to SQL server.
2. show databases; = To show all available and active databases.
3. Use databasename; = To use the database.
4. Show tables; = to check all table of the database used.
5. Create database databasename; = to create a database
6. Drop database databasename; = to delete or remove a database
7. Drop table tablename; = to delete an existing table
8. Use databasename; = to use an existing database
9. Show tables; = to show all tables from a database
10. Describe tablename; = to verify specification of a table
11. * represents "all"
12. Exit to go back in connecting to SQL Server

Entering commands (2)


• Choosing a database and showing its tables
o USE test;
o SHOW tables;

Client program can be a MySQL command line client, GUI client, or a program written in any language
such as C, Perl, PHP, Java that has an interface to the MySQL server.
Client-Server Interaction
MySQL Server
Make a request
(SQL query)
Get results
Client Program

MYSQL Database 2 tier Architecture


2-Tier Architecture
Web Browser (Client)
Web Server
PHP

MYSQL Database 3 tier Architecture


3-Tier Architecture
Web Browser (Client)
Web Server
PHP
Database Server
The "table" - containing the "records"
Each row shows a different "record"
Each record contains "fields" - the different parts of the record.
This is a "field name"

In this database table there are four records, each with four fields - can you spot them all?

Database concepts
• Parts of a database (smallest to largest)
- Character
- Field (attribute)
- Record (entity)
- File (table)
- Database

MySQL DATA TYPES


COMMON DATA TYPEs USED IN MYSQL
DATE TYPE SPEC DATA TYPE SPEC
CHAR String (0 - 255) INT Integer (-2147483648 to
2147483647)
VARCHAR String (0 - 255) BIGINT Integer (-9223372036854775808
to 9223372036854775807)
TINYTEXT String (0 - 255) FLOAT Decimal (precise to 23 digits)
TEXT String (0 - 65535) DOUBLE Decimal (24 to 53 digits)
BLOB String (0 - 65535) DECIMAL "DOUBLE" stored as string
MEDIUMTEXT String (0 - 16777215) DATE YYYY-MM-DD
MEDIUMBLOB String (0 - 16777215) DATETIME YYYY-MM-DD HH:MM:SS
LONGTEXT String (0 - 4294967295) TIMESTAMP YYYYMMDDHHMMSS
LONGBLOB String (0 - 4294967295) TIME HH:MM:SS
TINYINT Integer (-128 to 127) ENUM One of preset options
SMALLINT Integer (-32768 to 32767) SET Selection of preset options
MEDIUMINT Integer (-8388608 to 8388607) BOOLEAN TINYINT(1)

Create table example


CREATE TABLE Persons (
PersonlD int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);

Select specific field of table


SYNTAX:
Select fieldname, fieldname from tablename;

Select *from tablename;

Describe tablename;
Insert into tablename (fieldname, fieldname, fieldname, fieldname) values
(‘value1’,’value2’,’value3’,value4);
String = ‘ ’
Value =
Date = # #

Truncate table tablename;

Alter table tablename modify fieldname type;

CREATE TABLE WITH PRIMARY KEY


CREATE TABLE Persons (Personid int NOT NULL AUTO_INCREMENT, LastName varchar(255) NOT NULL,
FirstName varchar(255), Age int, PRIMARY KEY (Personid));

UPDATE tablename SET fieldname1 = ‘jhon keneth’ WHERE fieldname2 = value1;


The SQL ORDER BY Keyword
The ORDER BY keyword is used to sort the result-set in ascending or descending order.
The ORDER BY keyword sorts the records in ascending order by default. T
o sort the records in descending order, use the DESC keyword.

SELECT * FROM Customers ORDER BY Country ASC;


SELECT * FROM Customers ORDER BY Country DESC;

WHERE LIKE OPERATORS


Here are some examples showing different LIKE operators with ‘%’ and ‘_’ wildcards:
LIKE operator Description
WHERE CustomerName LIKE ‘a%’ Finds any values that start with "a"
WHERE CustomerName LIKE ‘%a’ Finds any values that end with "a"
WHERE CustomerName LIKE ‘%or%’ Finds any values that have "or” in any position
WHERE CustomerName LIKE ‘_r%’ Finds any values that have "r" in the second position
WHERE CustomerName LIKE ‘a_%’ Finds any values that start with "a" and are at least 2
characters in length
WHERE CustomerName LIKE ‘a__%’ Finds any values that Start with “a” and are at least 3
characters in length
WHERE ContactName LIKE ‘a%o’ Finds any values that start with "a" and ends with "o"

LOGICAL COMPARATOR
The following operators can be used in the WHERE clause:
Operator Description
= Equal
> Greater than
< Less than
>= Greater than or equal
<= Less than or equal
<> NOT EQUAL. Note: In some versions of SQL this operator may be written as !=
BETWEEN Between a certain range
LIKE Search for a pattern
IN To specify multiple possible values for a column
SQL Logical Operators
Operator Description
ALL TRUE if of the subquery meet the condition
AND TRUE it all the conditions separated by AND is TRUE
ANY TRUE if any of the subquery values meet the condition
BETWEEN TRUE if the operand is within the range of comparisons
EXISTS TRUE if the subquery returns or more records
IN TRUE if the operand is equal to one of a last of expressions
LIKE TRUE if the operand matches a pattern
NOT Displays a record if the condition(s) is NOT TRUE
OR TRUE if any the subquery values meet the condition
SOME TRUE if any of the conditions separated by OR is TRUE

BETWEEN OPERATOR
The SQL BETWEEN Operator
The BETWEEN operator selects values within a given range. The values can be numbers, text, or dates,
The BETWEEN operator is inclusive: begin and end values are included.
BETWEEN syntax
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 and value2;

You might also like