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 8711451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:52:50+00:00 2026-06-13T04:52:50+00:00

For the following SQL I get the error: Data truncation occurred on a write

  • 0

For the following SQL I get the error:

Data truncation occurred on a write of column 0Data was 0 bytes long and 0 bytes were transferred.

Code:

CREATE TABLE faculty_members
(
fid        INTEGER AUTO_INCREMENT PRIMARY KEY,   
first_name VARCHAR(30) NOT NULL,
last_name  VARCHAR(30) NOT NULL,
rank       VARCHAR(25) NOT NULL,        
office     CHAR(8),                        
phone      CHAR(12),            
dob        DATE NOT NULL,
salary     DECIMAL(8,2),
CONSTRAINT faculty_members_pk PRIMARY KEY(fid),         
CONSTRAINT faculty_members_ck UNIQUE(first_name,last_name,dob),    
CONSTRAINT valid_salary CHECK(salary > 0)       

);

And these are the INSERT statements

INSERT INTO faculty_members(first_name,last_name,rank,office,phone,dob,salary) VALUES
('Charles', 'Xavier', 'Professor', 'HSC 641', '563-555-6020', '11/09/1942', 125000),
('Bruce', 'Banner', 'Associate Professor', 'FO1 120', '563-555-8212', '06/20/1969', 87000),
('Hank', 'McCoy', 'Professor', 'FO1 120', '563-555-8212', '06/20/1972', 95000),
('Jeane', 'Grey', 'Assistant Professor', 'ECS 547', '563-555-8239', '03/19/1975', 95000),
('Erik', 'Lehnsherr', 'Professor', 'HSC 641', '563-555-6020', '11/09/1940', 115000),
('Diana', 'Prince', 'Associate Professor', 'HSC 400', '563-555-8212', '07/28/1967', 105100),
('Logan', 'Wolverine', 'Assistant Professor', 'ECS 540', '563-555-8100', '02/27/1964', 82000),
('Ororo', 'Storm', 'Assistant Professor', 'ECS 540', '563-555-8101', '05/01/1973', 82500);  
  • 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-13T04:52:51+00:00Added an answer on June 13, 2026 at 4:52 am

    Your dob values are incorrect. MySQL’s date format is yyyy-mm-dd. Most like you’re getting the default 0000-00-00 stored and the data truncation error from that.

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

Sidebar

Related Questions

While trying to insert data to my SQl db i get the following error
In the below sql statement i get the following error Cannot use an aggregate
When I try to I get the following error in SQL Server Management Studio:
I get the following error from the SQL Script I am trying to run:
I am trying some SQL code but I get an error when I try
I get a error when trying out the following code in Chrome: var db
In my php file I have the following code //create SQL to select schedule
Sometimes I get the following from SQL Server 2005 when executing a stored procedure:
I get the following error when I try to execute a particular recursive CTE:
I have writen the following code but when i execute him i get this

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.