(' 1-2-31 ')--Accurate acquisition of timeSelect Sysdatetime () --Data conversion, function conversion--castSelect CAST (123 as varchar (20))-value type converted to stringSelect CAST (1.23 as int)--decimal type converted to intSelect CAST (123 as Decimal (18,2))--int type converted to decimalSelect CAST (' 1.23 ' as Decimal (18,2))--Convert string type to decimalSelect CAST (' 12.3 ' as int)--String to int --convert--Front write type, behind write original data, with cast oppositeSelect CONVE
Several types of database fields that are easy to remember and confusing are always incorrect. Here, take notes:
A Chinese Character occupies two bytes.Char (n) contains n characters, n/2 Chinese characters (up to 4000 Chinese characters)N must be a value between 1 and 8,000. The storage size is n Bytes.Nchar (n) contains n characters and n Chinese characters (up to 4000 Chinese characters can be entered)T
Third, indexIn the previous chapter we learned to use explain to generate a query execution plan (QEP) to find the problem with the statement. Of the results returned by explain, three are index-related (possible key, key, extra), and the visible index has a prominent position in improving query efficiency.In this chapter, we will explain in all directions how to use the index to optimize our database.1. Role of the IndexThe principle of indexing is t
SQL script:SELECTTableName= Case whenA.colorder=1 ThenD.nameElse "' End,---table nameTableshowsthat= Case whenA.colorder=1 Then IsNull(F.value,"')Else "' End,---Table DescriptionTheserialnumberfield=A.colorder,---Field ordinalFieldName=A.name,---field nameIdentification= Case when ColumnProperty(A.id,a.name,'isidentity')=1 Then '√'Else "' End, PrimaryKey= Case when exists(SELECT 1 fromsysobjectswhereXtype='PK' andNameinch (SELECTName fromsysinde
Number of records in table: 1578463
Select COUNT (*) from Reorder_guideline; Count---------1578463 (1 Row Records) 2. three statements creating tables CREATE TABLE: (1) most commonly used (23171.485ms) A1stream_db=> CREATE table reorder_guideline_2 as table reorder_guideline; Time: 23171.485 ms (2) with unlogged logo (1734.085ms) Create unlogged table reorder_guideline_2 as table reorder_guideline; Time: 1734.085 ms (3) temporary table with temp ID (1666.934ms) Create temp table reorder_gu
) value.user_pass– user password, varchar (64) value, which is an encrypted result. It seems to be using an irreversible MD5 algorithm.user_nicename– user nickname, varchar (50) value.user_email– user Email address, varchar (100) value.user_url– user URL, varchar (100) value.user_registered– User Registration time, datetime value.user_level– for grade, int (2) value, can be a number between 0-10, different levels have different operation rights to WP.user_activation_key– user activation code, un
1000000.00, beyond the 6-bit integer range.2.3 Minimum value that can be savedThe range of negative numbers is symmetric with the positive range, so the minimum value is -999999.99.3 SummaryNumber (8,2) represents a range of numbers [ -999999.99,999999.99]. Determines whether a given number can be rounded before this range, and then the number of decimal parts is then compared. Judgment steps:
(1) rounding the 3rd decimal place and obtaining a number with 2 decimal places;
(2) Det
In many applications, although the general use of a database operation, but due to the needs of various situations, the business system may be deployed in different types of databases, if the development of the system can easily support a variety of database switching, it can reduce the number of problems for us, while improving the adaptability and robustness of
lock.
There are two basic types of locks in the database: exclusive locks (Exclusive Locks, i.e., x locks) and shared locks (Share Locks, or S locks). When a data object is added to the exclusive lock, no other transaction can read and modify it. Data objects with shared locks can be read by other transactions, but cannot be modified. The database uses these tw
Most SQL database engines (as far as we know, all SQL database engines except SQLite) use strict static types. With a static type, the type of the value is determined by its container-the specific column in which the value is stored.
SQLite uses a more general dynamic type System. In Sqlit, the data type of a value is associated with the value itself, not with i
--right--Execution8, and the database is established. The next step is to create a database context instance and manipulate the data Object! Summary:Using database precedence and model precedence does not require the developer to establish the class and database context corresponding to the tables in the
1,Database backup TypesAccording to the database size backup, there are four types, respectively applied to different occasions, the following brief introduction:1.1Full BackupThis is the way most people use it to back up the entire database, including all database objects,
Tags: Store price har MySQL enumeration oat mysq text DetailWhether it is in the small, free database space or large e-commerce site, reasonable design table structure, make full use of space is very necessary. This requires that we have a good understanding of the common data types of the database system. Below I will write a little bit of my experience to share
-defined table structure
query performance is not high, and the lack of unified query syntax.
Graph Database (graph)
Neo4j, Infogrid, Infinite Graph
Social networks, referral systems, and more. Focus on building a relationship map
Graph structure
Using graph structure correlation algorithm. such as shortest path addressing, N-degree relationship lookup, etc.
Many times need to calculate the entire graph
Data | Database Summary:
This paper discusses the method and function realization of using ASP to access DBF, DBC, MDB, Excel, SQL Server data, and finally gives an example of accessing Excel database by using the function provided in this paper, which has strong practical meaning for enterprise data reuse and sharing.
Keywords:
ASP database access, Dbf,dbc,md
Second, connect the database and open the data table
Different database connection methods are not the same (that is, the establishment of connection instance method is not the same), once the establishment of the connection instance, the use of Recordset objects to access data from the same method, the following for different types of data, write the correspondi
This article will focus on four types of masql database indexes, how do database indexes be built? The columns that appear in the where and join need to be indexed, but not entirely, because MySQL uses the index only for
MySQL indexing is important for the efficient operation of MySQL. Here are a few common types of M
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.