Lab 01
Lab 01
Introduction to database
Database is a structured collection of data. The data relating to each other by nature, e.g., a product
belonged to a product category and associated with multiple tags. Therefore, we use the term relational
database. Because we deal with a significant amount of data, we need a way to define the databases,
tables, etc., and process data more efficiently. Besides, we want to turn the data into information.
MySQL
MySQL is a database management system that allows you to manage relational databases. It is open
source software backed by Oracle. It means you can use MySQL without paying a dime. Also, if you
want, you can change its source code to suit your needs.
Even though MySQL is open source software, you can buy a commercial license version from Oracle to
get premium support services.
SQL
The language of the relational database. SQL stands for the structured query language. It is standardized
language used to access the database. ANSI/SQL defines the SQL standard. The current version of SQL is
SQL: 2016. Whenever we refer to the SQL standard, we mean the current SQL version.
There are five types of SQL statements, outlined in the following list:
1. Query statements retrieve rows stored in database tables. You write a query using the SQL
SELECT statement.
2. Data Manipulation Language (DML) statements modify the contents of tables. There are three
DML statements:
a. INSERT adds rows to a table.
b. UPDATE changes rows.
c. DELETE removes rows.
3. Data Definition Language (DDL) statements define the data structures, such as tables, that make
up a database. There are five basic types of DDL statements:
a. CREATE creates a database structure. For example, CREATE TABLE is used to create a
table; another example is CREATE USER, which is used to create a database user.
b. ALTER modifies a database structure. For example, ALTER TABLE is used to modify a
table.
c. DROP removes a database structure. For example, DROP TABLE is used to remove a
table.
d. RENAME changes the name of a table.
e. TRUNCATE deletes all the rows from a table.
4. Transaction Control (TC) statements either permanently record any changes made to rows, or
undo those changes. There are three TC statements:
a. COMMIT permanently records changes made to rows.
b. ROLLBACK undoes changes made to rows.
c. SAVEPOINT sets a “save point” to which you can roll back changes.
5. Data Control Language (DCL) statements change the permissions on database structures. There
are two DCL statements:
a. GRANT gives another user access to your database structures.
b. REVOKE prevents another user from accessing your database structures.
MYSQL Installation
https://dev.mysql.com/downloads/
Step 02:
Step 03:
Step 04:
Step 05: Run downloaded file and follow steps in wizard.
Note: This installation required .Net Framework 4.5.2, you may install it using following
link: https://www.microsoft.com/en-US/Download/confirmation.aspx?id=42642