
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- 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?
- How can I use 2-digit year value in MySQL DATEDIFF() function?
- Can we use “year” as a column came in a MySQL Table?
- How to check if a year is a leap year using Python?
- How to detect if a given year is a Leap year in Oracle?
- In which format Year(2) or Year(4) MySQL will return the value of year from date ‘0000-00-00’?
- How to get year in android using year API class?
- Changing year in MySQL date?
- How can fetch records from specific month and year in a MySQL table?
- Create a dynamic table name from current year in MySQL like 2019
- Add a single year to all the date records in a MySQL table column
- What is the difference between YEAR(2) and YEAR(4) in MySQL?
- JavaScript program to check if a given year is leap year
Advertisements