
SQL - Data types
Presentation
•
Computers
•
12th Grade
•
Medium
Preeti s
Used 17+ times
FREE Resource
12 Slides • 4 Questions
1
SQL - Data types
Learning Objectives
At the end of this session, the learners will be able to
understand what are data types
apply proper data types while creating tables in SQL
differentiate between CHAR and VARCHAR data types
Out of INT and CHAR, which data type to prefer when no calculations are to be perfomed?
2
Let's quickly revise what we have learnt so far...
​
3
Multiple Choice
SQL stands for ...
Simple Query Language
Sqmple Query Language
Structured Query Language
Simple Query Learning
4
Multiple Choice
The sub-language of SQL that deals with the structure of the table is ...
Data Control Language
Data Manipulaiton Language
Data Definition Language
None of these
5
Multiple Choice
The SQL command to define the structure of the table is ...
Make Table
Draw Table
Show Table
Create Table
6
Syntax of Create Table command
CREATE TABLE student
(
adm_no INT,
name CHAR (20),
class CHAR (10),
marks INT
) ;
7
Now, let's learn about
Data Types
8
Data Types
They are used to identify the type of data e.g. consider the following table:
What type of value we are storing in these attributes?
Let's discuss.
9
CHAR(n)
Specifies character type data of length n where n could be any value from 0 to 255.
CHAR is of fixed length, means, declaring CHAR (10) implies to reserve spaces for 10 characters.
If data does not have 10 characters (for example, ‘city’ has four characters), MySQL fills the remaining 6 characters with spaces padded on the right.
10
VARCHAR(n)
Specifies character type data of length ‘n’ where n could be any value from 0 to 65535.
But unlike CHAR, VARCHAR is a variable-length data type. That is, declaring VARCHAR (30) means a maximum of 30 characters can be stored but the actual allocated bytes will depend on the length of entered string.
So ‘city’ in VARCHAR (30) will occupy the space needed to store 4 characters only.
11
INT
INT specifies an integer value. Each INT value occupies 4 bytes of storage.
The range of values allowed in integer type are -2147483648 to 2147483647. For values larger than that, we have to use BIGINT, which occupies 8 bytes.
12
FLOAT
Holds numbers with decimal points.
Each FLOAT value occupies 4 bytes.
13
DATE
The DATE type is used for dates in 'YYYY-MM-DD' format. YYYY is the 4 digit year, MM is the 2 digit month and DD is the 2 digit date.
The supported range is '1000-01-01' to '9999-12-31'.
14
Think and Reflect
Which data type out of Char and Varchar will you prefer for storing mobile number?
How can I change the data type after creating the table?
15
Poll
Have I understood the concept and can I apply it practically?
Confident
I can try
I have not understood
I have doubts.
16
Let's do it practically ...
https://extendsclass.com/mysql-online.html
SQL - Data types
Learning Objectives
At the end of this session, the learners will be able to
understand what are data types
apply proper data types while creating tables in SQL
differentiate between CHAR and VARCHAR data types
Out of INT and CHAR, which data type to prefer when no calculations are to be perfomed?
Show answer
Auto Play
Slide 1 / 16
SLIDE
Similar Resources on Wayground
11 questions
Akuntansi sebagai sistem informasi
Presentation
•
12th Grade
11 questions
Pengolahan Data Bervolume Besar
Presentation
•
12th Grade
10 questions
Excel Chart Lesson
Presentation
•
12th Grade
12 questions
Pengayaan UKK 2022
Presentation
•
12th Grade
9 questions
Pengenalan Hardware Komputer
Presentation
•
12th Grade
9 questions
ICT SKILLS chapter 1
Presentation
•
12th Grade
11 questions
Population Ecology
Presentation
•
12th Grade
15 questions
[ITAL] Disaster Recovery Management
Presentation
•
12th Grade
Popular Resources on Wayground
6 questions
PRIDE Always and Everywhere
Presentation
•
12th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
26 questions
KOR Review Kahoot Questions
Quiz
•
8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
12 questions
Unit Zero lesson 2 cafeteria
Presentation
•
9th - 12th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
10 questions
Riddles Riddles fun Riddles
Quiz
•
6th - 12th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade