Sort common SQL statements for interviews

We all know that database knowledge is usually used during the interview, so here we have sorted out some query statements commonly used in our frequently-used interviews, my test database is SQLServer2008. First, create a test database in the

SQL Server's use of Indexes

SQL Server uses filters to filter out some records when writing SQL statements for indexing. SQL statements are short for filtering conditions: SARG (searchargumentSARG) amount6000 SQL Server uses filters to filter out some records when writing SQL

SQLServer six methods for deleting duplicate rows

SQLServer deleting duplicate rows is one of the most common operations. The following describes six methods for deleting duplicate rows in SQLServer for your reference. 1. If there is an ID field, it is a unique field

MSSQLServer automatically generates the serial number of the date plus Digit

Requirement: The following serial number must be generated. The first half is a year, month, and day number in yyyymmdd format. The second half is a number that increases sequentially from 1 day, And the digits must be fixed, fill in 0 for the

FAQs about using logexplorer [reprinted]

1) when the database is completely different and the log backup is performed, the unused entries in the transaction log are deleted, and then the Log Explorer attempts to view the log, prompting Nologrecordersfoundthatmatchthefilter, when

Difference between SQL Server and Mysql triggers

After practicing sqlserver today, I felt like the Oracle and Mysql syntaxes at the beginning. However, after one afternoon of hard work, I felt that the three databases were actually different, I used Mysql when I learned the trigger. I feel okay,

Meanings of syscolumns fields in sqlserver

The name of the namesysname column or the name of the process parameter. The ID of the table object to which the column belongs or the Stored Procedure ID associated with this parameter. The physical storage type in xtypetinyintpolicypes.

Differences between table variables and temporary tables

Note: Compared with temporary tables, table variables have the following advantages: Table variables (such as local variables) have a clearly defined range, these table variables are automatically cleared at the end of the range. Compared with

Chapter 3 T-SQL Programming

3.1 Using Variable variables is an object that can store data values. You can use local variables to pass data to SQL statements. Many variables can be declared for temporary use when executing a batch of SQL statements in the T-SQL. After declaring

SQLserver User-Defined Function instance

Createfunctiondbo. t_bh (@ strvarchar (20) returnsvarchar (20) asbegindeclare @ bhvarchar (20), @ lengthint, @ iintset @ length12-LEN (@ str) ifLEN (@ str) 12beginset @ i0while @ I @ lengthbeginset @ str0 + @ strset @ I + 1endreturn @ str Create

SQL Server performance monitoring level step

The following figure shows the steps and sequence of the performance monitoring level. 1. identify the causes of the bottleneck. For example, the resource is insufficient, hardware needs to be added or upgraded. The workload is unevenly distributed

First try ColumnStoreIndex

First, use the non-clustered INDEX TIMEONSELECTMemberId, (VExpd) (DD, (DD, FactOrdersoWITH (INDEX (IX_IsBigOrder_O) to parse the result SQLServerparseandcompiletime: CPUtimems. SQLServe First use non-clustered index time on SELECT MemberId, (VExpd) (

SQLServer remote database backup

In some database-related projects, regular database backup is often required. It is quite easy to back up data to the local machine on a regular basis and the task can be completed. However, if the entire machine crashes, it makes no sense to back

Use TSQL to delete one or more tables from the sqlserve publishing and subscription chain

A simple stored procedure is used to delete one or more tables from a SQLSERVE publish/subscribe chain. * 1.stop daily Reader Agent 2.exe cusp _ Delete the table dbtestPub and test13. open the Log Reader Agent author: 51 akdate: 20130509 run the *

What is the In-Flight log In SQLServer?

In SQLServer, WAL of logs is used to ensure the durability of relational databases. However, due to the characteristics of hard disks, it is impossible to write a log directly to the disk every time a log is generated, therefore, logs are cached and

0. Relationship between disk read/write and database

One disk physical structure (1) disk Disk: the disk body consists of multiple disk fragments stacked together. When the hard disk is released, the hard disk manufacturer completes low-level formatting (physical formatting). The function is to divide

1. Application of RAID in database storage

As a single disk shows limitations in data security, performance, and capacity, the disk array (RedundantArraysofInexpensiveIndependentDisks, RAID) appears. RAID combines multiple Independent Disks in different ways, form a disk group to obtain data

01. SELECTINTO the stored procedure result set to a temporary table

In the development process, the result set is often stored in a temporary table. There are two common methods. 1. SELECTINTO1. using selectinto will automatically generate a temporary table without creating # tempfromsysobjects # temp In the

Chapter 4 advanced Query

4.1 what is a simple subquery? What is the use of subqueries? With such questions, we may wish to solve the first problem in this chapter first. StuInfo and stuMarks. StuNamestuNostuSexstuAgestuSeatstuAddress Zhang qiuli s25301 male 181 Beijing

SQL Notes [long-term updates] (

SQL Notes [long-term update] (-2013.7) -- tableA -- CREATETABLETABLEA (-- Column1VARCHAR (20), -- Column2VARCHAR (20), -- Column3VARCHAR (20), -- Column4int, -- Column5VARCHAR (20), -- Column6DATETIME --) * -- ROW_NUMBER () OVER (), use of

Total Pages: 12780 1 .... 10469 10470 10471 10472 10473 .... 12780 Go to: GO

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.