
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How MySQL use YEAR data type to store year value in a table?
MySQL permits to declare a column YEAR type, with the help of which we can store year values in that column.
mysql> Create table year1 (Year_Copyright YEAR); Query OK, 0 rows affected (0.21 sec) mysql> Insert into year1(Year_Copyright) values (2017); Query OK, 1 row affected (0.08 sec) mysql> Select * from year1; +----------------+ | Year_Copyright | +----------------+ | 2017 | +----------------+ 1 row in set (0.00 sec)
- Related Articles
- How can we insert current year automatically in a YEAR type column of MySQL table?
- How to use year input type in HTML?
- MySQL datatype to store month and year only?
- Can we use “year” as a column came in a MySQL Table?
- How can I use 2-digit year value in MySQL DATEDIFF() function?
- In which format Year(2) or Year(4) MySQL will return the value of year from date ‘0000-00-00’?
- How can fetch records from specific month and year in a MySQL table?
- Add a single year to all the date records in a MySQL table column
- Create a dynamic table name from current year in MySQL like 2019
- How MySQL evaluates if I store date along with time value in a column having DATE data type?
- How to detect if a given year is a Leap year in Oracle?
- Changing year in MySQL date?
- How to get year in android using year API class?
- How to store XML data in a table in Oracle?
- How to store time created in a MySQL table?

Advertisements