SQL introduction Classic (5th Edition) Learning Notes (2)
1. Judge right or wrong: personal social security number, input format is' 111111111111', it can be any of the following data types: fixed length characters, variable length characters, numeric values.
Error cannot be numeric quotation marks will be converted to characters
2. Judge right or wrong: the scale of the value type refers to the overall length of the value.
Yes, it will be completed automatically.
3. Do all SQL implementations use the same data type?
Different on-demand use
4. What are the significant digits and scales defined below?
The former is the significant digit and the latter is the scale.
5. Which of the following values can be entered into the field defined as DECIMAL (4prime1)?
A.16.2
B.116.2
C.16.21
D.1116.2
E.1116.21
A b c
6. What is data?
Data is a collection of information, stored in a database as a certain data type.
2.5.2 activity
1. Consider the following field names, set the appropriate data type for them, determine the appropriate length, and give some demonstration data:
A) ssn
Varchar (p)
B) state
Varchar (p)
C) city
Varchar (p)
D) phone_number
Varchar (p)
E) zip
BLOB
F) last_name
Varchar (p)
G) first_name
Varchar (p)
H) middle_name
Varchar (p)
I) salary
Float
J) hourly_pay_rate
Float (2Jing 2)
K) date_hired
Data ()
2.These same fields, determine that they should be NULL or NOT NULL. Realize that in different applications, some fields that are generally NOT NULL may be NULL, and vice versa.
A) ssn
NOT NULL
B) state
NOT NULL
C) city
NOT NULL
D) phone_number
NOT NULL
E) zip
NOT NULL
F) last_name
NOT NULL
G) first_name
NOT NULL
H) middle_name
NULL
I) salary
NOT NULL
J) hourly_pay_rate
NOT NULL
K) date_hired
NOT NULL