
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
12 questions
Unit 3.1 - Functions and types of operating systems
Presentation
•
University
12 questions
Programming Language
Presentation
•
12th Grade
13 questions
Online World Unit 1: databases
Presentation
•
12th Grade
14 questions
Fire Safety
Presentation
•
12th Grade
11 questions
DDWC 2743 - SOFTWARE ENGINEERING
Presentation
•
12th Grade - University
13 questions
ORGANISASI DAN ARSITEKTUR KOMPUTER
Presentation
•
12th Grade
9 questions
SAINS KOMPUTER T5 : MEREKA BENTUK KERANGKA APLIKASI
Presentation
•
12th Grade
12 questions
PROFISSÕES DO FUTURO
Presentation
•
University
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Assessment 2
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
12 questions
2026 TAP Technology in the Classroom
Presentation
•
Professional Development
15 questions
HCS SCI 05 Summer School Assessment 2 Review
Quiz
•
5th Grade
15 questions
HCS SCI 04 Summer School Review 2
Quiz
•
4th Grade
59 questions
Geometry Unit 3 Review
Quiz
•
9th - 12th Grade
14 questions
FAST ELA READING SMAPLE TEST MATERIALS
Passage
•
3rd Grade