The purpose of any database and data platform is to store and manage data.
The name of the object, or identifier. There are two types of identifiers: the general (regular) identifier and the delimited (delimited) identifier.
Rules for identifiers:
(1) Maximum of 128 characters
(2) The first character must be a letter
(3) cannot be T-SQL reserved words
(4) cannot contain spaces or special characters
Object names that do not conform to the rules of an identifier must be enclosed in quotation marks or square brackets [].
Database objects use < instance >.< Database >.< schema >.< object > 4-part schema naming.
The instance, database, and schema are optional. The strength name is unspecified, the object name defaults to the instance that is currently connected, the database name is unspecified, the current database context of the connection is used, the schema name is unspecified, and the default schema is used.
All objects in the database are created under the schema. Schemas not only provide a way to group objects, but also provide security boundaries.
common syntax for creating schemas :
CREATE SCHEMA schema_name AUTHORIZATION owner_name
One of the most fundamental differences between a database and a spreadsheet is that the database provides and enhances the structure of the data store.
One of the most common data types in SQL Server is the numeric data type . There are 9 kinds of numeric data types: tinyint (0~255, 1 bytes), smallint ( -2768~32767,2 bytes), int ( -2^31 to 2^31-1, 4 bytes), bigint ( -2^63 to 2^63-1, 8 bytes), Decimal (P,s) ( -10^38+1 to 10^38-1), numeric (P,s) (-214 748.3648 to 214 748.3647, 4 bytes), smallmoney (9 bytes), Money (4 bytes), Real ( 4 bytes or 8 bytes).
The decimal data type has two parameters: precision and scale. Precision, the sum of the number of digits around the decimal points. Precision, the number of decimal places to the right of the decimal point.
character data Types : char (n), varchar (n), text, nchar (n), nvarchar (n), ntext. The first three types, 1 bytes per character, and the latter three types, 2 bytes per character.
The Unicode character type begins with N, such as NCHAR (n), nvarchar (n), and ntext.