0% found this document useful (0 votes)
47 views

Mysql Introdution and Its Data Types

MySQL is a relational database management system developed by Oracle that uses SQL and is suited for large databases. SQL is a programming language used to manage relational databases by retrieving, creating, updating, and deleting data. SQL has characteristics like being declarative, supporting relational databases, and allowing data querying and manipulation through statements. Data types in SQL help define what types of data columns can hold and help prevent errors. Common data types include numeric, character, date/time, and binary types.

Uploaded by

prasad dongare
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Mysql Introdution and Its Data Types

MySQL is a relational database management system developed by Oracle that uses SQL and is suited for large databases. SQL is a programming language used to manage relational databases by retrieving, creating, updating, and deleting data. SQL has characteristics like being declarative, supporting relational databases, and allowing data querying and manipulation through statements. Data types in SQL help define what types of data columns can hold and help prevent errors. Common data types include numeric, character, date/time, and binary types.

Uploaded by

prasad dongare
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

MYSQL INTRODUTION and its

data types
BY
group 1

VidyaPrathit,Gurunath,A
mita,Preshita

This Photo by Unknown Author is licensed under CC BY


Sql Introduction

• MySQL is Relation Database Management Systems(RDBMS) developed by


Oracle that is based on SQL(Structured Query Language).
• Handles very large databases; very fast performance; reliable.

• MySQL’s connectivity, speed, and security make it highly suited for accessing
databases on the internet.
• The name MySQL derives from the name of co-founder Michael Widenius's
daughter and SQL.
# What is SQL

• SQL stands for Structure Query Language.


# SQL PROCESS

• SQL is a programming language that is used to


manage relational databases.

• SQL commands retrieve, create, update, and


delete data from a database.

• Other commands can be used to control and


manage the database.
CHARACTERISTICS OF SQL

SQL (Structured Query Language) is a domain-specific language


used for managing and manipulating relational databases. It is a
standard language for interacting with databases, and it has several
key characteristics.

CHARACTERISTICS :
• Declarative Language: SQL is a declarative language,
which means that you specify what you want to do with the
data (e.g., retrieve, insert, update, or delete).
• RDBMS: SQL Is primarily used with relational databases.
• Data Query and Manipulation: SQL allows users to retrieve, insert,
update, and delete data in a database.
CHARACTERSTICS

• Data Definition Language (DDL): SQL includes DDL statements for defining and
managing the structure of a database.
• Data Integrity: SQL supports data integrity through constraints, which enforce rules
on the data to maintain its accuracy and consistency.
• Structured Data: SQL primarily deals with structured data, where data is organized
into tables with predefined schemas.
• Data Types: SQL supports various data types.
Advantages of sql

• High speed
• Using the SQL queries, the user can quickly and efficiently retrieve a large amount of records
from a database.
• No coding needed
In the standard SQL, it is very easy to manage the database system. It doesn't require a substantial
amount of code to manage the database system.
• Well defined standards
Long established are used by the SQL databases that are being used by ISO and ANSI.
• Portability
SQL can be used in laptop, PCs, server and even some mobile phones.
• Interactive language
SQL is a domain language used to communicate with the database. It is also used to receive
answers to the complex questions in seconds.
• Multiple data view
Using the SQL language, the users can make different views of the database structure.
DIsadvantages

• Complex Interface –
SQL has a difficult interface that makes few users uncomfortable while dealing with the database.

• Cost
Some versions are costly and hence, programmers cannot access it.

• Partial Control
Due to hidden business rules, complete control is not given to the database.
• Limited Flexibility
• SQL databases are less flexible than NoSQL databases when it comes to handling unstructured or semi-
structured data, as they require data to be structured into tables and columns.
• Lack of Real-Time Analytics
• SQL databases are designed for batch processing and do not support real-time analytics, which can be a
disadvantage for applications that require real-time data processing.
• Limited Query Performance
• SQL databases may have limited query performance when dealing with large datasets, as queries may take
longer to process than in-memory databases.
SQL DATAtypes

DATA TYPE

Data type indicates the type of data value that an attribute can have. The data type of an
attribute decides the operations that can be performed on the data of that attribute.

SQL Data Types:

1. Numeric – bit, tinyint, smallint, int, bigint, decimal, numeric, float, real

2. 2. Character/String – Char, Varchar, Varchar(max), Text

3. 3. Date/Time – Date, Time, Datetime, Timestamp, Year

4. 4. Unicode character/String -Nchar, Nvarchar, Nvarchar(max), NText

5. 5. Binary- Binary, Varbinary, Varbinary(max), image 6. Miscellaneous- Clob, Blob, Json,


XML
WHAT are DATA TYPES IN SQL

1. A Simple Definition
Data types in SQL help to define what types of data a particular column or variable
can hold.
2. Why are they important?
Data types help prevent errors and storage issues by ensuring that the right type of
data is stored in the right way.
• 3. How to choose the right type of DataThe right data type depends on the type of
data you are storing, the size of the data, and the operations you plan to perform on that
data.
Numeric Data Types

INTEGER DECIMAL NUMERIC

Numbers without a decimal point. Numbers with a decimal point. A more flexible version of DECIMAL.
e.g. 42, 1234 , etc. e.g. 3.14,22.45, etc. It can hold larger numbers with more
digits, but requires more space.

e.g. 1.23456789
Character and String Data Types

1. CHAR or Character, String ( 0-255)


Char Can Store fixed-length character. CHAR is used Where you Know Fixed
Length of Characters.
e.g CHAR (10) MOHIT_____ Ex. Telephone No. , Zip Code

2. VARCHAR Or Variable Character, String (0-255)


Can Store variable-length character.
e.g PRATHIT
VARCHAR(10)

3. Text
Store large blocks of text data. E.g Name , Address.
Date/Time Data Types

DATE DATETIME
Stores a date. e.g. 2000-11-20 Stores a date and time. e.g. 2000-
11-20 23:59:59

TIMESTAMP INTERVAL
Automatically records the date and time a Stores an interval of time. e.g.
row is inserted or updated. e.g. 2022-10-11 INTERVAL '1 day 2 hours'
15:27:12 means one day and two hours.
Examples of using Data Types in SQL

QUERY DESCRIPTION

SELECT title, release_date FROM movies; Returns the title and release date of all movies in the
database.

INSERT INTO accounts (user_id, password) VALUES Adds a new user with a username and password to
('johndoe', 'mysecretpassword'); the accounts table

UPDATE customers SET credit_limit = 10000 WHERE Increases the credit limit of customer 42 to $10,000.
customer_id = 42;
DATe and time

What is the datetime data type?


In SQL, datetime date data type is used for values that contain both date and time.
Microsoft defines it as a date combined with a time of day with fractional seconds that is based
on a 24-hour clock.

DATE − A date in YYYY-MM-DD format, between 1000-01-01 and 9999-12-31. For example,
December 30th, 1973 would be stored as 1973-12-30.
DATETIME − A date and time combination in YYYY-MM-DD HH:MM:SS format, between
1000-01-01 00:00:00 and 9999-12-31 23:59:59. For example, 3:30 in the afternoon on December
30th, 1973 would be stored as 1973-12-30 15:30:00.
DATe and time

TIMESTAMP − A timestamp between midnight, January 1st, 1970 and sometime in


2037. This looks like the previous DATETIME format, only without the hyphens between
numbers; 3:30 in the afternoon on December 30th, 1973 would be stored as
19731230153000 ( YYYYMMDDHHMMSS ).

TIME − Stores the time in a HH:MM:SS format.

YEAR(M) − Stores a year in a 2-digit or a 4-digit format. If the length is specified as 2


(for example YEAR(2)), YEAR can be between 1970 to 2069 (70 to 69). If the length is
specified as 4, then YEAR can be 1901 to 2155. The default length is 4.
DATe and time
THANKYOU

You might also like