In this chapter you will learn:
Example of data types
Some exercises of data types
Example of data types
Create a database with the name student and create a student_details table. Insert three columns in this table with the data type and size. The columns should be:
- StudentId – integer data type
- StudentName – char data type
- StudentAddress – varchar data type
create database student create table student_details ( StudentId int, StudentName char(50), Address varchar(50) );
Example Description
In the above example create database student is used to create the database of the name of student in which create table student_details is used to creating the table and StudentId int is used to create columns in the database table in which StudentId is the name of table and int is a data type that means the StudentId column stores only integer type of data.
Exercises
- What do you mean by data types?
- What is the purpose to use date data types?
- Create a table in student database, the name of the table should be StudentResult in which insert 5 columns that details are given below.
StudentId - int
StudentName – varchar 30
Phy –int
Che – int
Total – int