Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8863107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:53:38+00:00 2026-06-14T15:53:38+00:00

i created a table composers VALUES (name VARCHAR(30), birth YEAR(4), death YEAR(4), city VARCHAR(30),

  • 0

i created a table “composers” VALUES (name VARCHAR(30), birth YEAR(4), death YEAR(4), city VARCHAR(30), country VARCHAR(30)). then i INSERT INTO composers VALUES (‘BACH Johann Sebastian’,1685,1750,’Eisenach’,’Germany’);. it returns 2 errors. the years are not between 1901 and 2155.

is there any way of changing this default so i can have an actual year for those columns? cant seem to find anything on the web.

i resorted to just use INTEGER(4) for those columns but would like to use YEAR(4) if it’s possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:53:40+00:00Added an answer on June 14, 2026 at 3:53 pm

    It seems quite clear that this is the only way this type works in the docs.

    The YEAR(4) type only uses 1 byte, and is limited to a range of 256 years. If your use case falls completely within a different 256 year space, you could certainly store them off by a certain amount, and adjust the yourself before writing and after reading, say by -300.

    Alternatively, use a SMALLINT or UNSIGNED SMALLINT instead of a full INT to use 2 bytes. Not quite the 1 byte that a ‘YEAR(4)’ uses, but less than the 4 bytes for an INT

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created table and inserted values as below. create table mytable (id INT,
I created a table then added a foreign key reference to its primary key
I have a dynamically created table which in the last <td> there is a
i created a table in the database (mysql),and i write a code for inserting
I created a table like this CREATE TABLE pull_dtl ( source_schema VARCHAR2(4000), source_tablename VARCHAR2(4000),
I created a table without a primary key Like this: private static final String
I created a table tbl_Candidate , but I forgot to set the primary key
I have just created this table: create table dbo.OrderTypes ( ID smallint primary key
I have created a table in Visual Studio. That table has two columns. First
I have a table created in sql. but in my application I am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.