{"id":109391,"date":"2025-07-02T18:04:32","date_gmt":"2025-07-02T12:34:32","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/"},"modified":"2025-07-02T17:23:57","modified_gmt":"2025-07-02T11:53:57","slug":"sql-data-types","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/","title":{"rendered":"SQL Data Types: Choose the Right Type for Your Database"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"what-are-sql-data-types\">What are SQL Data Types?<\/h2>\n\n\n\n<p>A SQL data type specifies the type of data that a column can hold. For example, a column storing ages needs a numeric data type. A column for names needs a text data type.<\/p>\n\n\n\n<p>SQL data types are important because they help in:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><b>Data Integrity:<\/b> They prevent you from putting the wrong kind of data into a column. You cannot store text in a number column.<\/li>\n\n\n\n<li><b>Storage Efficiency:<\/b> Different data types use different amounts of storage space. Choosing the right type saves disk space.<\/li>\n\n\n\n<li><b>Performance:<\/b> Databases can process <a href=\"https:\/\/www.mygreatlearning.com\/blog\/sql-queries-with-examples\/\">queries<\/a> faster when they know the data type. This improves overall speed.<\/li>\n\n\n\n<li><b>Data Validation:<\/b> Data types act as an initial check. They ensure data fits the expected format.<\/li>\n<\/ul>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Academy Pro<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/practical-sql-training\" class=\"courses-cta-title-link\">SQL Course<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">Master SQL and Database management with this SQL course: Practical training with guided projects, AI support, and expert instructors.<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>7 Hrs<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>2 Projects<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/practical-sql-training\" class=\"courses-cta-button\">\n                Take SQL Course Now\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"numeric-data-types-in-sql\">Numeric Data Types in SQL<\/h2>\n\n\n\n<p>Numeric data types store various kinds of numbers. You use them for integers, decimals, and floating-point numbers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-int-integer\">1. INT (Integer)<\/h3>\n\n\n\n<p>The <b>INT<\/b> data type stores whole numbers without a decimal point. It's common for IDs, counts, and other non-fractional values.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name INT\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a table called <b>Products<\/b>. This table has an <b>id<\/b> column for product identification.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Products (\n    id INT,\n    product_name VARCHAR(255)\n);\n<\/pre><\/div>\n\n\n<p>You insert a whole number into the <b>id<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Products (id, product_name) VALUES (101, &#039;Laptop&#039;);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"2-smallint\">2. SMALLINT<\/h3>\n\n\n\n<p><b>SMALLINT<\/b> stores small whole numbers. It uses less storage than <b>INT<\/b>. Use it when you know numbers will stay within a smaller range.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name SMALLINT\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a table for <b>Employees<\/b>. It has an <b>age<\/b> column. Ages do not usually exceed 127.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Employees (\n    employee_id INT,\n    employee_name VARCHAR(255),\n    age SMALLINT\n);\n<\/pre><\/div>\n\n\n<p>You insert a small integer into the <b>age<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Employees (employee_id, employee_name, age) VALUES (1, &#039;Alice&#039;, 30);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"3-tinyint\">3. TINYINT<\/h3>\n\n\n\n<p><b>TINYINT<\/b> stores very small whole numbers. It saves even more space than <b>SMALLINT<\/b>. Use it for values like true\/false (0 or 1) or small counts.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name TINYINT\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>Settings<\/b> table. It has an <b>is_active<\/b> column to store 0 or 1.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Settings (\n    setting_id INT,\n    setting_name VARCHAR(255),\n    is_active TINYINT\n);\n<\/pre><\/div>\n\n\n<p>You insert a tiny integer into the <b>is_active<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Settings (setting_id, setting_name, is_active) VALUES (1, &#039;Notifications&#039;, 1);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"4-bigint\">4. BIGINT<\/h3>\n\n\n\n<p><b>BIGINT<\/b> stores very large whole numbers. Use it for values that exceed the range of <b>INT<\/b>. This is common for large-scale IDs or very high counts.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name BIGINT\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>LogEntries<\/b> table for system logs. It has a <b>timestamp_id<\/b> column. This stores large numerical timestamps.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE LogEntries (\n    log_id BIGINT,\n    event_description VARCHAR(255)\n);\n<\/pre><\/div>\n\n\n<p>You insert a large integer into the <b>log_id<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO LogEntries (log_id, event_description) VALUES (9223372036854775807, &#039;System shutdown&#039;);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"5-decimal-dec-numeric\">5. DECIMAL (DEC) \/ NUMERIC<\/h3>\n\n\n\n<p><b>DECIMAL<\/b> or <b>NUMERIC<\/b> stores numeric values with a fixed precision and scale. Precision is the total number of digits. Scale is the number of digits after the decimal point. Use these for financial data where accuracy is critical.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name DECIMAL(precision, scale)\ncolumn_name NUMERIC(precision, scale)\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create an <b>Orders<\/b> table. It has a <b>total_amount<\/b> column. This stores currency values with two decimal places.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Orders (\n    order_id INT,\n    item_name VARCHAR(255),\n    total_amount DECIMAL(10, 2)\n);\n<\/pre><\/div>\n\n\n<p>You insert a decimal value into the <b>total_amount<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Orders (order_id, item_name, total_amount) VALUES (1, &#039;Book&#039;, 29.99);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"6-float-real\">6. FLOAT \/ REAL<\/h3>\n\n\n\n<p><b>FLOAT<\/b> and <b>REAL<\/b> store approximate floating-point numbers. They are not exact. Use them when precision is not as critical, like scientific calculations. <b>REAL<\/b> offers single precision, while <b>FLOAT<\/b> offers double precision.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name FLOAT(n) -- n specifies the precision\ncolumn_name REAL\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>Measurements<\/b> table. It has a <b>temperature<\/b> column. This stores temperature readings with decimal values.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Measurements (\n    measurement_id INT,\n    sensor_name VARCHAR(255),\n    temperature REAL\n);\n<\/pre><\/div>\n\n\n<p>You insert a floating-point value into the <b>temperature<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Measurements (measurement_id, sensor_name, temperature) VALUES (1, &#039;Room Sensor&#039;, 23.5);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"7-double-precision\">7. DOUBLE PRECISION<\/h3>\n\n\n\n<p><b>DOUBLE PRECISION<\/b> is similar to <b>FLOAT<\/b> but offers higher precision. Use it for applications requiring more accurate floating-point numbers.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name DOUBLE PRECISION\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>Coordinates<\/b> table. It has <b>latitude<\/b> and <b>longitude<\/b> columns. These require high precision.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Coordinates (\n    location_id INT,\n    city VARCHAR(255),\n    latitude DOUBLE PRECISION,\n    longitude DOUBLE PRECISION\n);\n<\/pre><\/div>\n\n\n<p>You insert double precision values into the <b>latitude<\/b> and <b>longitude<\/b> columns.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Coordinates (location_id, city, latitude, longitude) VALUES (1, &#039;New York&#039;, 40.7128, -74.0060);\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"string-data-types-in-sql\">String Data Types in SQL<\/h2>\n\n\n\n<p>String data types store text. You use them for names, addresses, descriptions, and any other textual information.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-varcharn-character-varyingn\">1. VARCHAR(n) \/ CHARACTER VARYING(n)<\/h3>\n\n\n\n<p><b>VARCHAR(n)<\/b> stores variable-length strings. <b>n<\/b> specifies the maximum number of characters. It saves space because it only uses the storage needed for the actual string length.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name VARCHAR(n)\ncolumn_name CHARACTER VARYING(n)\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>Customers<\/b> table. It has a <b>customer_name<\/b> column. This column stores names up to 255 characters.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Customers (\n    customer_id INT,\n    customer_name VARCHAR(255),\n    email VARCHAR(100)\n);\n<\/pre><\/div>\n\n\n<p>You insert text into the <b>customer_name<\/b> and <b>email<\/b> columns.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Customers (customer_id, customer_name, email) VALUES (1, &#039;John Doe&#039;, &#039;john.doe@example.com&#039;);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"2-charn-charactern\">2. CHAR(n) \/ CHARACTER(n)<\/h3>\n\n\n\n<p><b>CHAR(n)<\/b> stores fixed-length strings. If a string is shorter than <b>n<\/b>, the database pads it with spaces to reach <b>n<\/b> characters. Use it when column values have a consistent length, like country codes.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name CHAR(n)\ncolumn_name CHARACTER(n)\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>Countries<\/b> table. It has a <b>country_code<\/b> column. This column always stores 2 characters.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Countries (\n    country_id INT,\n    country_name VARCHAR(255),\n    country_code CHAR(2)\n);\n<\/pre><\/div>\n\n\n<p>You insert a fixed-length string into the <b>country_code<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Countries (country_id, country_name, country_code) VALUES (1, &#039;United States&#039;, &#039;US&#039;);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"3-text\">3. TEXT<\/h3>\n\n\n\n<p><b>TEXT<\/b> stores large amounts of text. Its maximum length varies by database system. Use it for descriptions, comments, or blog post content.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name TEXT\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>BlogPosts<\/b> table. It has a <b>content<\/b> column. This stores the full text of a blog post.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE BlogPosts (\n    post_id INT,\n    title VARCHAR(255),\n    content TEXT\n);\n<\/pre><\/div>\n\n\n<p>You insert long text into the <b>content<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO BlogPosts (post_id, title, content) VALUES (1, &#039;Understanding SQL&#039;, &#039;SQL is a powerful language for managing databases...&#039;);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"4-ncharn-nvarcharn\">4. NCHAR(n) \/ NVARCHAR(n)<\/h3>\n\n\n\n<p><b>NCHAR<\/b> and <b>NVARCHAR<\/b> are similar to <b>CHAR<\/b> and <b>VARCHAR<\/b> but store Unicode characters. Use them when you need to store text in multiple languages. N stands for National character set.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name NCHAR(n)\ncolumn_name NVARCHAR(n)\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>MultilingualProducts<\/b> table. It has a <b>product_name<\/b> column. This column stores names in various languages.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE MultilingualProducts (\n    product_id INT,\n    product_name NVARCHAR(255)\n);\n<\/pre><\/div>\n\n\n<p>You insert Unicode text into the <b>product_name<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO MultilingualProducts (product_id, product_name) VALUES (1, N&#039;\u00fcr\u00fcn ad\u0131&#039;); -- Example for Turkish\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"5-character-sets-and-collation\">5. Character Sets and Collation<\/h3>\n\n\n\n<p>Character sets define how text characters are stored. Collation rules determine how characters are sorted and compared. For example, UTF-8 is a common character set that handles most world languages. A collation like utf8_general_ci means comparisons are case-insensitive.<\/p>\n\n\n\n<p>You define character sets and collations at the database, table, or column level.<\/p>\n\n\n\n<p>Example (MySQL):<\/p>\n\n\n\n<p>You create a table with a specific character set and collation for a text column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Articles (\n    article_id INT,\n    title VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci\n);\n<\/pre><\/div>\n\n\n<p>This ensures text is stored using utf8mb4 encoding and sorted based on utf8mb4_unicode_ci rules.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"date-and-time-data-types-in-sql\">Date and Time Data Types in SQL<\/h2>\n\n\n\n<p>Date and time data types store dates, times, or combinations of both. You use them for timestamps, birth dates, and event schedules.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-date\">1. DATE<\/h3>\n\n\n\n<p>The <b>DATE<\/b> data type stores a date (year, month, day). It does not include time information.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name DATE\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create an <b>Events<\/b> table. It has an <b>event_date<\/b> column. This stores the date of an event.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Events (\n    event_id INT,\n    event_name VARCHAR(255),\n    event_date DATE\n);\n<\/pre><\/div>\n\n\n<p>You insert a date into the <b>event_date<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Events (event_id, event_name, event_date) VALUES (1, &#039;Company Picnic&#039;, &#039;2025-08-15&#039;);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"2-time\">2. TIME<\/h3>\n\n\n\n<p>The <b>TIME<\/b> data type stores a time of day (hour, minute, second). It does not include date information.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name TIME\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>MeetingSchedule<\/b> table. It has a <b>start_time<\/b> column. This stores the starting time of a meeting.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE MeetingSchedule (\n    meeting_id INT,\n    topic VARCHAR(255),\n    start_time TIME\n);\n<\/pre><\/div>\n\n\n<p>You insert a time into the <b>start_time<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO MeetingSchedule (meeting_id, topic, start_time) VALUES (1, &#039;Project Review&#039;, &#039;10:30:00&#039;);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"3-datetime-timestamp\">3. DATETIME \/ TIMESTAMP<\/h3>\n\n\n\n<p><b>DATETIME<\/b> and <b>TIMESTAMP<\/b> store both date and time information. <b>DATETIME<\/b> stores a fixed date and time. <b>TIMESTAMP<\/b> stores a value relative to a specific time, like Unix epoch. It also updates automatically in some systems when rows change.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name DATETIME\ncolumn_name TIMESTAMP\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>UserActions<\/b> table. It has a <b>action_timestamp<\/b> column. This records when a user performs an action.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE UserActions (\n    action_id INT,\n    user_id INT,\n    action_description VARCHAR(255),\n    action_timestamp DATETIME\n);\n<\/pre><\/div>\n\n\n<p>You insert a date and time into the <b>action_timestamp<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO UserActions (action_id, user_id, action_description, action_timestamp) VALUES (1, 101, &#039;Logged in&#039;, &#039;2025-07-01 14:30:00&#039;);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"4-year\">4. YEAR<\/h3>\n\n\n\n<p>The <b>YEAR<\/b> data type stores a year. Its range is usually from 1901 to 2155.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name YEAR\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>MovieReleases<\/b> table. It has a <b>release_year<\/b> column. This stores the year a movie was released.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE MovieReleases (\n    movie_id INT,\n    movie_title VARCHAR(255),\n    release_year YEAR\n);\n<\/pre><\/div>\n\n\n<p>You insert a year into the <b>release_year<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO MovieReleases (movie_id, movie_title, release_year) VALUES (1, &#039;The Matrix&#039;, 1999);\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"other-important-data-types-in-sql\">Other Important Data Types in SQL<\/h2>\n\n\n\n<p>Beyond numeric, string, and date\/time types, other data types serve specific purposes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-boolean-bool\">1. BOOLEAN (BOOL)<\/h3>\n\n\n\n<p><b>BOOLEAN<\/b> or <b>BOOL<\/b> stores true or false values. Many databases use 0 for false and 1 for true.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name BOOLEAN\ncolumn_name BOOL\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>Task<\/b> table. It has an <b>is_completed<\/b> column. This indicates if a task is done.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Tasks (\n    task_id INT,\n    task_name VARCHAR(255),\n    is_completed BOOLEAN\n);\n<\/pre><\/div>\n\n\n<p>You insert boolean values into the <b>is_completed<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Tasks (task_id, task_name, is_completed) VALUES (1, &#039;Write report&#039;, FALSE);\nINSERT INTO Tasks (task_id, task_name, is_completed) VALUES (2, &#039;Submit form&#039;, TRUE);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"2-blob-binary-large-object\">2. BLOB (Binary Large Object)<\/h3>\n\n\n\n<p><b>BLOB<\/b> stores binary data. This includes images, audio, video, or any other raw data.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name BLOB\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create an <b>Images<\/b> table. It has an <b>image_data<\/b> column. This stores actual image files.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Images (\n    image_id INT,\n    image_name VARCHAR(255),\n    image_data BLOB\n);\n<\/pre><\/div>\n\n\n<p>You can insert binary data into a <b>BLOB<\/b> column using specific functions or prepared statements in your application code, not directly with <b>INSERT<\/b> statements in SQL.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-enum\">3. ENUM<\/h3>\n\n\n\n<p><b>ENUM<\/b> allows you to define a column that can only hold one value from a specified list of allowed values.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name ENUM(&#039;value1&#039;, &#039;value2&#039;, &#039;value3&#039;, ...)\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create an <b>OrderTracking<\/b> table. It has a <b>status<\/b> column. This column can only be 'Pending', 'Shipped', or 'Delivered'.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE OrderTracking (\n    order_id INT,\n    status ENUM(&#039;Pending&#039;, &#039;Shipped&#039;, &#039;Delivered&#039;)\n);\n<\/pre><\/div>\n\n\n<p>You insert one of the predefined values into the <b>status<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO OrderTracking (order_id, status) VALUES (101, &#039;Pending&#039;);\nINSERT INTO OrderTracking (order_id, status) VALUES (102, &#039;Shipped&#039;);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"4-uuid-universally-unique-identifier-uniqueidentifier\">4. UUID (Universally Unique Identifier) \/ UNIQUEIDENTIFIER<\/h3>\n\n\n\n<p><b>UUID<\/b> or <b>UNIQUEIDENTIFIER<\/b> stores a 128-bit number. It creates a unique identifier across all databases and computers. Use it for primary keys in distributed systems.<\/p>\n\n\n\n<p>Syntax (PostgreSQL, MySQL, SQL Server):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name UUID -- PostgreSQL\ncolumn_name UNIQUEIDENTIFIER -- SQL Server\n<\/pre><\/div>\n\n\n<p>Example (PostgreSQL):<\/p>\n\n\n\n<p>You create a <b>Users<\/b> table. It has a <b>user_id<\/b> column that stores unique identifiers.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE EXTENSION IF NOT EXISTS &quot;uuid-ossp&quot;; -- Enable UUID generation in PostgreSQL\nCREATE TABLE Users (\n    user_id UUID DEFAULT uuid_generate_v4(),\n    username VARCHAR(255)\n);\n<\/pre><\/div>\n\n\n<p>You insert a new user. The <b>user_id<\/b> column automatically gets a unique <b>UUID<\/b>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Users (username) VALUES (&#039;AliceSmith&#039;);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"5-array\">5. ARRAY<\/h3>\n\n\n\n<p>The <b>ARRAY<\/b> data type stores a list of values of the same type in a single column. Not all SQL databases support this (e.g., PostgreSQL does). Use it when a single record needs multiple related items.<\/p>\n\n\n\n<p>Syntax (PostgreSQL):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name data_type&#x5B;]\n<\/pre><\/div>\n\n\n<p>Example (PostgreSQL):<\/p>\n\n\n\n<p>You create a <b>ProductTags<\/b> table. It has a <b>tags<\/b> column that stores multiple keywords for a product.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE ProductTags (\n    product_id INT,\n    product_name VARCHAR(255),\n    tags TEXT&#x5B;]\n);\n<\/pre><\/div>\n\n\n<p>You insert an array of tags.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO ProductTags (product_id, product_name, tags) VALUES (1, &#039;Smartphone&#039;, ARRAY&#x5B;&#039;electronics&#039;, &#039;mobile&#039;, &#039;gadget&#039;]);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"6-json-jsonb\">6. JSON \/ JSONB<\/h3>\n\n\n\n<p><b>JSON<\/b> data types store JSON documents. <b>JSONB<\/b> (binary JSON) stores them in a decomposed binary format, which is more efficient for querying. Use these when you need to store flexible, semi-structured data.<\/p>\n\n\n\n<p>Syntax (PostgreSQL, MySQL):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name JSON\ncolumn_name JSONB -- PostgreSQL only\n<\/pre><\/div>\n\n\n<p>Example (PostgreSQL):<\/p>\n\n\n\n<p>You create a <b>UserProfiles<\/b> table. It has a <b>profile_data<\/b> column to store varying user information.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE UserProfiles (\n    user_id INT,\n    profile_data JSONB\n);\n<\/pre><\/div>\n\n\n<p>You insert JSON data into the <b>profile_data<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO UserProfiles (user_id, profile_data) VALUES (\n    1,\n    &#039;{&quot;age&quot;: 30, &quot;city&quot;: &quot;New York&quot;, &quot;interests&quot;: &#x5B;&quot;reading&quot;, &quot;hiking&quot;]}&#039;\n);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"7-spatial-data-types-e-g-point-linestring-polygon\">7. Spatial Data Types (e.g., POINT, LINESTRING, POLYGON)<\/h3>\n\n\n\n<p>Spatial data types store geographical or geometric information. Databases like PostgreSQL (with PostGIS) and MySQL support them. Use these for mapping applications, location services, or geographical analysis.<\/p>\n\n\n\n<p>Syntax (PostgreSQL with PostGIS):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name GEOMETRY(GeometryType, SRID)\n<\/pre><\/div>\n\n\n<p>Example (PostgreSQL with PostGIS):<\/p>\n\n\n\n<p>You create a <b>Cities<\/b> table. It has a <b>location<\/b> column to store geographical coordinates.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE EXTENSION IF NOT EXISTS postgis;\nCREATE TABLE Cities (\n    city_id INT,\n    city_name VARCHAR(255),\n    location GEOMETRY(Point, 4326) -- SRID 4326 for WGS 84 (latitude\/longitude)\n);\n<\/pre><\/div>\n\n\n<p>You insert a point (longitude, latitude) into the <b>location<\/b> column.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Cities (city_id, city_name, location) VALUES (\n    1,\n    &#039;London&#039;,\n    ST_SetSRID(ST_MakePoint(-0.1278, 51.5074), 4326)\n);\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"automatic-id-generation-auto-increment-serial\">Automatic ID Generation (Auto-increment\/Serial)<\/h2>\n\n\n\n<p>You often need unique identifiers for each row in a table. SQL databases provide ways to automatically generate these IDs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-auto_increment-mysql\">1. AUTO_INCREMENT (MySQL)<\/h3>\n\n\n\n<p><b>AUTO_INCREMENT<\/b> automatically generates a sequential number for each new row. You typically use it with <b>INT<\/b> or <b>BIGINT<\/b> for primary keys.<\/p>\n\n\n\n<p>Syntax (MySQL):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name INT AUTO_INCREMENT PRIMARY KEY\n<\/pre><\/div>\n\n\n<p>Example (MySQL):<\/p>\n\n\n\n<p>You create a <b>Posts<\/b> table. The <b>post_id<\/b> automatically increases for each new post.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Posts (\n    post_id INT AUTO_INCREMENT PRIMARY KEY,\n    post_title VARCHAR(255),\n    post_content TEXT\n);\n<\/pre><\/div>\n\n\n<p>When you insert a row, you do not provide a value for <b>post_id<\/b>. The database handles it.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Posts (post_title, post_content) VALUES (&#039;My First Post&#039;, &#039;This is the content of my first post.&#039;);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"2-serial-bigserial-postgresql\">2. SERIAL \/ BIGSERIAL (PostgreSQL)<\/h3>\n\n\n\n<p><b>SERIAL<\/b> and <b>BIGSERIAL<\/b> in PostgreSQL are pseudo-types. They create an integer column that automatically increments. <b>SERIAL<\/b> uses <b>INT<\/b>, and <b>BIGSERIAL<\/b> uses <b>BIGINT<\/b>.<\/p>\n\n\n\n<p>Syntax (PostgreSQL):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name SERIAL PRIMARY KEY\ncolumn_name BIGSERIAL PRIMARY KEY\n<\/pre><\/div>\n\n\n<p>Example (PostgreSQL):<\/p>\n\n\n\n<p>You create a <b>Users<\/b> table with an auto-incrementing user ID.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Users (\n    user_id SERIAL PRIMARY KEY,\n    username VARCHAR(255)\n);\n<\/pre><\/div>\n\n\n<p>The <b>user_id<\/b> column automatically populates when you insert a new user.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Users (username) VALUES (&#039;JaneDoe&#039;);\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"setting-default-values\">Setting Default Values<\/h2>\n\n\n\n<p>You can set a default value for a column. If you do not provide a value for that column during an insert, the database uses the default. This ensures data consistency.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncolumn_name data_type DEFAULT default_value\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p>You create a <b>Tasks<\/b> table. The <b>status<\/b> column defaults to 'Pending', and the <b>created_at<\/b> column defaults to the current timestamp.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCREATE TABLE Tasks (\n    task_id INT PRIMARY KEY,\n    task_description VARCHAR(255),\n    status VARCHAR(50) DEFAULT &#039;Pending&#039;,\n    created_at DATETIME DEFAULT CURRENT_TIMESTAMP\n);\n<\/pre><\/div>\n\n\n<p>When you insert a task without specifying <b>status<\/b> or <b>created_at<\/b>, they receive their default values.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nINSERT INTO Tasks (task_id, task_description) VALUES (1, &#039;Finish report&#039;);\n<\/pre><\/div>\n\n\n<p>You can verify the default values by selecting the data:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSELECT * FROM Tasks;\n<\/pre><\/div>\n\n\n<p>This query shows:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>task_id<\/th><th>task_description<\/th><th>status<\/th><th>created_at<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>Finish report<\/td><td>Pending<\/td><td>2025-07-02 17:18:45<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"best-practices-for-using-sql-data-types\">Best Practices for Using SQL Data Types<\/h2>\n\n\n\n<p>Choosing the correct data type is crucial. Follow these best practices:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><b>Be Specific:<\/b> Always choose the most specific data type that meets your needs. For example, use <b>SMALLINT<\/b> instead of <b>INT<\/b> if the numbers will always be small.<\/li>\n\n\n\n<li><b>Consider Storage:<\/b> Smaller data types save disk space and improve performance. Use <b>TINYINT<\/b> for 0\/1 values.<\/li>\n\n\n\n<li><b>Plan for Growth:<\/b> While being specific, also consider potential future data growth. An <b>INT<\/b> might be better than <b>SMALLINT<\/b> if your maximum value could increase significantly.<\/li>\n\n\n\n<li><b>Use DECIMAL for Money:<\/b> Never use <b>FLOAT<\/b> or <b>DOUBLE PRECISION<\/b> for financial calculations. They can lead to rounding errors. <b>DECIMAL<\/b> ensures accuracy.<\/li>\n\n\n\n<li><b>Normalize Dates and Times:<\/b> Store dates and times consistently. Use <b>DATETIME<\/b> or <b>TIMESTAMP<\/b> for precise moments.<\/li>\n\n\n\n<li><b>Consider Character Sets:<\/b> For multilingual data, use <b>NVARCHAR<\/b> or ensure your <b>VARCHAR<\/b> columns use a character set like UTF-8 and an appropriate collation.<\/li>\n\n\n\n<li><b>Validate User Input:<\/b> Always validate user input in your application before storing it in the database. This adds another layer of protection beyond data types.<\/li>\n\n\n\n<li><b>Use Auto-increment for IDs:<\/b> Leverage <b>AUTO_INCREMENT<\/b> or <b>SERIAL<\/b> to manage unique row identifiers efficiently.<\/li>\n\n\n\n<li><b>Set Logical Defaults:<\/b> Use default values to streamline data entry and maintain data consistency.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>Understanding SQL data types is important for designing databases. You now know how to select the right data type for numbers, text, dates, and more. This includes specialized types, such as JSON and arrays, as well as crucial concepts like character sets and auto-incrementing IDs. This knowledge will help you build efficient and reliable databases.<\/p>\n\n\n\n<p><strong>Suggested Resources to Read:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.mygreatlearning.com\/blog\/sql-commands\/\">SQL Commands with Examples<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mygreatlearning.com\/blog\/sql-tutorial-for-beginners\/\">SQL Tutorial for Beginners<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mygreatlearning.com\/blog\/normalization-in-sql\/\">Normalization in SQL<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mygreatlearning.com\/blog\/sql-joins\/\">SQL Joins \u2013 Inner, Left, Right &amp; Full Join<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>You can use SQL data types to store numbers, text, dates, and more. This guide shows you how to use common SQL data types for your database.<\/p>\n","protected":false},"author":41,"featured_media":109405,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25860],"tags":[36844],"content_type":[],"class_list":["post-109391","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-sql"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Data Types in SQL with Examples<\/title>\n<meta name=\"description\" content=\"You can use SQL data types to store numbers, text, dates, and more. This guide shows you how to use common SQL data types for your database.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Data Types: Choose the Right Type for Your Database\" \/>\n<meta property=\"og:description\" content=\"You can use SQL data types to store numbers, text, dates, and more. This guide shows you how to use common SQL data types for your database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-02T12:34:32+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1027\" \/>\n\t<meta property=\"og:image:height\" content=\"537\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"SQL Data Types: Choose the Right Type for Your Database\",\"datePublished\":\"2025-07-02T12:34:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/\"},\"wordCount\":2103,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/sql-data-types.webp\",\"keywords\":[\"sql\"],\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/\",\"name\":\"Data Types in SQL with Examples\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/sql-data-types.webp\",\"datePublished\":\"2025-07-02T12:34:32+00:00\",\"description\":\"You can use SQL data types to store numbers, text, dates, and more. This guide shows you how to use common SQL data types for your database.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/sql-data-types.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/sql-data-types.webp\",\"width\":1027,\"height\":537,\"caption\":\"Data Types in SQL\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/sql-data-types\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IT\\\/Software Development\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/software\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SQL Data Types: Choose the Right Type for Your Database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Data Types in SQL with Examples","description":"You can use SQL data types to store numbers, text, dates, and more. This guide shows you how to use common SQL data types for your database.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/","og_locale":"en_US","og_type":"article","og_title":"SQL Data Types: Choose the Right Type for Your Database","og_description":"You can use SQL data types to store numbers, text, dates, and more. This guide shows you how to use common SQL data types for your database.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2025-07-02T12:34:32+00:00","og_image":[{"width":1027,"height":537,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types.webp","type":"image\/webp"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"SQL Data Types: Choose the Right Type for Your Database","datePublished":"2025-07-02T12:34:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/"},"wordCount":2103,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types.webp","keywords":["sql"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/","url":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/","name":"Data Types in SQL with Examples","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types.webp","datePublished":"2025-07-02T12:34:32+00:00","description":"You can use SQL data types to store numbers, text, dates, and more. This guide shows you how to use common SQL data types for your database.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types.webp","width":1027,"height":537,"caption":"Data Types in SQL"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/sql-data-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"IT\/Software Development","item":"https:\/\/www.mygreatlearning.com\/blog\/software\/"},{"@type":"ListItem","position":3,"name":"SQL Data Types: Choose the Right Type for Your Database"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types.webp",1027,537,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types-150x150.webp",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types-300x157.webp",300,157,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types-768x402.webp",768,402,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types-1024x535.webp",1024,535,true],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types.webp",1027,537,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types.webp",1027,537,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types-640x537.webp",640,537,true],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types-96x96.webp",96,96,true],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/07\/sql-data-types-150x78.webp",150,78,true]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":0,"uagb_excerpt":"You can use SQL data types to store numbers, text, dates, and more. This guide shows you how to use common SQL data types for your database.","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/109391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=109391"}],"version-history":[{"count":8,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/109391\/revisions"}],"predecessor-version":[{"id":109404,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/109391\/revisions\/109404"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/109405"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=109391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=109391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=109391"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=109391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}