0% found this document useful (0 votes)
11 views5 pages

MYSQL

The document provides an overview of databases, defining them as systematic collections of data managed by Database Management Systems (DBMS). It categorizes databases into relational, object-oriented, hierarchical, and network types, and explains the differences between relational (SQL) and non-relational (NoSQL) databases. Additionally, it includes common SQL queries for managing databases and tables, specifically using MySQL as an example.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

MYSQL

The document provides an overview of databases, defining them as systematic collections of data managed by Database Management Systems (DBMS). It categorizes databases into relational, object-oriented, hierarchical, and network types, and explains the differences between relational (SQL) and non-relational (NoSQL) databases. Additionally, it includes common SQL queries for managing databases and tables, specifically using MySQL as an example.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

MYSQL

DATABASE

DATABSE is a SYSTEMATIC COLLECTION OF DATA that can include words, numbers, images, videos,
and other types of files. Databases are managed using specialized software called a DATABASE
MANAGEMENT SYSTEM (DBMS), WHICH ALLOWS USERS TO STORE , RETRIEVE ,

AND MANIPULATE DATA EFFICIENTLY . It can be accessed and manage by the user very easily. it
allows us to organize data into tables, rows, columns, and indexes to find the relevant information very
quickly. many databases available like MySQL, Sybase, Oracle, MongoDB, PostgreSQL, SQL Server,
etc.

TYPES OF DATABASE

1. Relational Databases
2. Object-Oriented Databases
3. Hierarchical Databases
4. Network Databases

1.RELATIONAL DATABASES

A relational database’s contents are arranged as a collection of tables with rows and columns.
Examples: MySQL, PostgreSQL, Oracle, Microsoft SQL Server.
2. OBJECT-ORIENTED DATABASES

The data is represented and stored as objects which are similar to the objects used in the object-oriented
programming language.

Example: ObjectDB.

3. HIERARCHICAL DATABASES

It is the type of database that stores data in the form of parent-children relationship nodes. Here, it
organizes data in a tree-like structure. Data get stored in the form of records that are connected via links.
Each child record in the tree will contain only one parent. On the other hand, each parent record can
have multiple child records.

4.NETWORK DATABASES

It is the database that typically follows the network data model. Here, the representation of data is in
the form of nodes connected via links between them. Unlike the hierarchical database, it allows each
record to have multiple children and parent nodes to form a generalized graph structure.
In the area of database management, the data is arranged in two ways which are Relational Databases
(SQL) and Non-Relational Databases (NoSQL). While relational databases organize data
into structured tables, non-relational databases use various flexible data models like key-value pairs,
documents, graphs, and wide-column stores.

TYPES OF NON-RELATIONAL DATABASES

SQL
SQL stands for Structured Query Language. It is a standardized programming language used
to manage and manipulate relational databases. It enables users to perform a variety of tasks such as
querying data, creating and modifying database structures, and managing access permissions. SQL is
widely used across various relational database management systems such as MySQL, PostgreSQL,
Oracle, and SQL Server.

How MySQL Works?


SOME COMMON QUERIES

1.show databases; will show existing databases.

2.create database databasename; will create a database.

3.drop database databasename; will remove the entire database.

4.use databasename ; will use the database.

5.create table pets – will eventually creates the table within the specified database

6. SHOW TABLES; shows the created table.


1.INSERT INTO pets(petId,petName)VALUES(100, 'Dog'),(200,'cat'); inserts values to table

2.show tables; show the current table

3.describe pets; shows the table

4.select * from pets; shows the values

select * from pets where petName = 'Dog';

delete from pets where petId =1;

select * from pets;


alter table pets add amount int not null;

describe pets;

alter table pets add colour varchar(30) not null after petName;

alter table pets drop colour;

You might also like