Label:Objective
On a relational database commonly used SQL statement syntax is mainly relational database general structure, this paper discusses the relational database query SQL syntax.
Grammar Review
SELECT [ALL|DISTINCT]
The order of SQL
The new features of Visual Basic 9.0 are originally designed to cater to the. NET Framework's new data Framework-Linq. One of the slogans of Linq is "Making queries everywhere". It introduces SQL-like syntax to Visual Basic and can be used in any combination. Do not just wri
[Zhuantang learning notes] basic SQL query statements (single-Table query and multi-Table query)SQLQueryBasic1. Single Table query
It is also called projection.
Basic
Tags: union function combination join like multiple blog multi-column subqueryUnit03:sql (Basic query), SQL (associative query) Column Aliases when the column queried in the SELECT clause is a function or an expression, the name of the field in the result set that is querie
In this series of articles, we'll delve into how to combine the. NET 2.0 and SQL Server 2005 query notification features to inform the application when critical data changes in order to eliminate the recurring query database.
First, the introduction
One of the typical problems with database applications is updating stale data.
Imagine a typical E-commerce site th
key, and the primary key is not allowed to be null.ALTER TABLE dbo. Employees ADD constrant pk_employees PRIMARY KEY (empid);Create a PRIMARY KEY constraintUnique constraint: Enforces the uniqueness of the row, allowing the concept of alternate keys for the relational model to be implemented in its own database. Multiple unique constraints are allowed within the same table, no requirement to allow null for the field, but SQL Server rejects du
Just a little bit of Linq was attracted by it, and I suddenly came up with the idea of learning and using it in one breath. So I posted a video on the ASP. NET official website. I am not very good at English, but I can understand how to use it. Below I wrote a little bit of fur I learned. It is a learning record.
First, I use Visual Studio 2008 development tools and SQL Server data sources, which are writte
tree, B-tree, C + tree, b* tree | 2013-09-21 12:30:18 || 1379 | MySQL basic SQL statements Common Management SQL | 2013-09-21 12:39:23 |+------+----------------------------------------------------------------+---------------------+7 rows in Set (0.01 sec)
To sort query results:Order by Field_name {asc| DESC}
syntax for the ORDER BY clause is as follows: [ ORDER BY {order_by_expression [ASC | desc][] ]The main parameters are described below:Order_by_espression: Specifies the column to sort, the alias of the column, an expression, or a negative integer that is specified as the location of the name, alias, or expression within the selection list.ASC: Sorts the values in the specified column in ascending order.Desc: Sorts the values in the specified column in descending order.Seven, having a filter
Oracle experiences 1 -- oracle introduction @ basic SQL statement @ conditional query @ sort data theory and case studies1. Oracle IntroductionOracle is the first word for English translation of oracle (Oracle bone inscriptions) Unearthed from Yin. Oracle is the world's largest supplier of information management software and services. It was founded in 1977 and i
' Connect by prior E Mpno = Mgr;--traverse from the bottom up (swapping the conditions in connect by prior, using MGR = empno)--note that connect by prior MGR = Empno Understanding--prior represents the previous record, That is, the empno of the next return record should be equal to the MGR of the previous record.Select level, lpad (", 2 * level-1) | | ename as" ename ", --traverse from bottom up (you can also put prior to the right of the equals sign to get the same result)Select level, lpa
Label:--------------------------------------------Basic Common Query-------------------------------------- I made a watch with a simple practice. Today I looked at the SQL Server T-hoojo High-level query of the great God, I can only understand the basis of the current level, so I share the part of my contact and unders
) |
+----+-----------------------------------------------+
| 1 | 90.0,95.0,98.0,92.0,88.0,90.0,96.0,100.0,98.0 |
+----+-----------------------------------------------+
1 row in Set
Filter group having Having is used to filter data after grouping, for example, to query student information with an average score of less than 95, when using having, the data is already in memory. Mysql> SELECT ID, AVG (score) from score GROUP by
------------------------------------------------------------------------------7900 james clerk 7698 03-DEC-81 950 307902 ford analyst 7566 03-DEC-81 3000 207934 miller clerk 7782 23-JAN-82 1300 10
14 rows selected.
You can use a connection to query data in multiple tables:
The basic statement is as follows:
SELECT table1.column, table2.column from table1, table2 where table1.column1 = table2.column2
There a
For more information about SQL Server basic knowledge data retrieval and query of sorting statements, see.
For more information about SQL Server basic knowledge data retrieval and query of sorting statements, see.
The Code is as
marks SELECT ename,sal,sal*12 ' yearly ' from EMP; either use double quotation marks, or no, single quotation mark is not used.
- SELECTEname,sal,sal* AAnnual salary fromEMP; - SELECTEname,sal,sal* A as"Nianxin" fromEMP; - --using aliases
- --processing Null:null represents an unknown value, not a space, or 0, note: When an expression contains null, the result is also null
- --use NVL or NVL2 to handle null NVL equivalent to the ISNULL function in SQL
underscore is not a minus sign]
represents a single character
SELECT * from emp where ename like ' _a ';--ename as long as the second letter is a, the output
[A-f]
any single character in A to F, can only be any of a B C D E F
SELECT * from emp where ename like ' _[a-f]% ';
--Put the second letter of the ename in the data output of a or B or C or D or E or F
[A,f]
A or F
[^A-c]
not A, nor
Label:Use SQL query: SQL query Basic syntax: SELECT [all| DISTINCT] [TOP ( [Groud by [Have [ORDER by [For XML {row| auto| Explicit| path[( [OPTION ( The SQL statement above looks very complex. Now we are going to explain. SELECT
Add, query, modify, and delete operations on data in basic SQL statements1. create a database: create database For example, create database student;2. connect to an existing database: use For example, use student;3. delete a database: drop database For example, drop database student;4. create a table: create table For example, create table stuInfo (stuId int prim
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.