Week 1 Day 1: Xampp Installation Guide
Week 1 Day 1: Xampp Installation Guide
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.
mysql -u root -p
CHAPTER 1 TO 4
CHAPTER 4
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
CHAPTER 1 TO 4
CHAPTER 4:
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
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
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
Describe tablename;
Insert into tablename (fieldname, fieldname, fieldname, fieldname) values
(‘value1’,’value2’,’value3’,value4);
String = ‘ ’
Value =
Date = # #
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;