Insert Data Into SQL Table with Number Datatype

  • Context: Comp Sci 
  • Thread starter Thread starter Crystal037
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around inserting data into an SQL table specifically focusing on the number datatype. Participants explore the syntax and requirements for representing decimal values in SQL.

Discussion Character

  • Technical explanation, Debate/contested

Main Points Raised

  • One participant provides a basic SQL insert statement with a decimal value (1.1).
  • Another participant comments on the legibility of an image, suggesting it is unnecessary as the query is already provided in the text.
  • A third participant reiterates the concern about the image's legibility and emphasizes the sufficiency of the written query.
  • A later reply proposes a specific format for representing decimal numbers in SQL, suggesting the use of number(2, 1) to define the total digits and the digits after the decimal point.
  • The same participant references an external source for further information on the Oracle number data type.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the necessity of the image, and there are differing views on how to represent decimal values in SQL.

Contextual Notes

Limitations include potential ambiguity in the SQL syntax and the specific requirements of the number datatype, which may depend on the SQL implementation being discussed.

Crystal037
Messages
167
Reaction score
7
Homework Statement
I can't understand what is meant by precision and scale while declaring a variable as number datatype in SQL Oracle. I have created a table example and specified attr1 as number(1,1) datatype. According to my understanding it can take one digit before decimal and 1 digit after decimal.But if I'm trying to insert values like 1.1 it's showing value larger than specified precision allowed for this column. Can u explain if my understanding of precision is correct.
Relevant Equations
create table example(
attr1 number(1,1));
insert into example values(1.1);
Screenshot (128).png
 
Last edited by a moderator:
Physics news on Phys.org
Mark44 said:
The image is too small to be legible.
Referring image isn't necessary I've written the query in relevant equations part
 

Similar threads

  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
1K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K