Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
16 views12 pages

Mysql

The document explains the concept of databases, highlighting the differences between relational (RDBMS) and non-relational (NoSQL) databases, with MySQL as an example of the former. It provides SQL commands for creating and deleting databases and tables, along with an example of creating a 'student' table and inserting sample data. The document emphasizes the structured nature of relational databases and the use of SQL for data management.

Uploaded by

hrjesgroup
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)
16 views12 pages

Mysql

The document explains the concept of databases, highlighting the differences between relational (RDBMS) and non-relational (NoSQL) databases, with MySQL as an example of the former. It provides SQL commands for creating and deleting databases and tables, along with an example of creating a 'student' table and inserting sample data. The document emphasizes the structured nature of relational databases and the use of SQL for data management.

Uploaded by

hrjesgroup
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/ 12

MySQL,

A database is an organized collection of data that allows for easy access,


management, and updating. It stores information in a structured way, typically
using tables, so users can retrieve and manipulate data efficiently. Databases are
managed using Database Management Systems (DBMS) like MySQL,
PostgreSQL, and SQL Server.

The image explains the types of databases, categorized into:


1. Relational Databases (RDBMS) – Data is stored in tables and follows a
structured format with relationships between data.
o Examples: MySQL, SQL Server, Oracle, PostgreSQL

o Uses SQL for managing data.

2. Non-relational Databases (NoSQL) – Data is not stored in tables and


follows a flexible schema, often in document, key-value, or graph formats.
o Example: MongoDB

SQL is used to interact with relational databases, while NoSQL databases use
different querying methods.
The image provides SQL commands for creating and deleting a database:
1. Creating a Database
2. CREATE DATABASE db_name;
o This command creates a new database with the specified name.

3. Dropping a Database
4. DROP DATABASE db_name;
o This command deletes an existing database along with all its data.

Let me know if you need further clarification!


#

The image provides SQL commands for creating a table:


1. Using a Database
2. USE db_name;
o This selects the database where the table will be created.

3. Creating a Table (General Syntax)


4. CREATE TABLE table_name (
5. column_name1 datatype constraint,
6. column_name2 datatype constraint,
7. column_name3 datatype constraint
8. );
o Defines a new table with specified columns, data types, and
constraints.
9. Example: Creating a "student" Table
10.CREATE TABLE student (
11. id INT PRIMARY KEY,
12. name VARCHAR(50),
13. age INT NOT NULL
14.);
o id: Integer and set as the primary key.

o name: Variable character field with a max length of 50.

o age: Integer and cannot be NULL.

Let me know if you need further clarification!


Here’s an example of the student table with
some sample data:
Table Structure
CREATE TABLE student (
id INT PRIMARY KEY,
name VARCHAR(50),
age INT NOT NULL
);
Inserting Sample Data
INSERT INTO student (id, name, age) VALUES
(1, 'Pratik Kumar', 25),
(2, 'Amit Sharma', 22),
(3, 'Neha Singh', 23),
(4, 'Rahul Verma', 24);
Resulting Table

i ag
name
d e

Pratik
1 25
Kumar

Amit
2 22
Sharma

Neha
3 23
Singh

Rahul
4 24
Verma

Let me know if you need modifications! 🚀


I wrote the code
Asked deepseek to correct

You might also like