sql basics pdf

Want to know sql basics pdf? we have a huge selection of sql basics pdf information on alibabacloud.com

SQL Basics (Beginner Essentials)

references Type: 1. Entity integrity 2. Referential (referential) integrity 3. Domain Integrity 4. User-defined Integrity Realize: 1, Primary key primary key 2, Foreign key foreign key REFERENCES table name (column name) 3. Unique Constraint 4. Check checking constraints 5. Default Defaults constraint Data management Add data Insert [into] Table name (column list) values (Zhi Leibiao) Update data Update table name set column name 1= value 1, column name 2= value 2 where Delete data Delete from

Aggregation and sequencing of SQL basics

Aggregate functions are functions that are used to sum, average, and maximum minimum values.Commonly used are count, SUM, MAX, MIN, AVG.Count ()The parameter is a column name, or you can use * to represent all columns.The default * will count all rows of data, and if you want to filter out null rows, specify a specific column name.Filter Blank lines:Mysql> SELECT * FROM Employees where ' to_date ' is null; Empty Set (0.00 sec)Aggregation and sequencing of SQ

SQL Compaction Basics (i): differences between inner join, outer join, and Cross join

table has a value, and no match is substituted with a null value.SELECT * from A left OUTER JOIN B on a.name = B.nameA 3.RIGHT [OUTER] JOIN produces a full set of Table B, and a match in table A has a value, and no match is substituted with a null value.SELECT * from A right OUTER JOIN B on a.name = B.nameThe 4.FULL [OUTER] JOIN produces a and B's set. For records that do not have a match, NULL is the value.SELECT * from A full OUTER JOIN B on a.name = B.nameYou can find the value without match

04.SQL Basics--Grouping and grouping functions

) from EMP;Select Job,avg (SAL) from EMP*ERROR at line 1:Ora-00937:not a single-group group function--Use the HAVING clause to filter the grouped results-Query The department number above the average wage and its average wage.Select Deptno,avg (SAL) from EMP Group BY DEPTNO have avg (SAL) >2000;Idle> Select Deptno,avg (SAL) from EMP Group BY DEPTNO have avg (SAL) >2000; DEPTNO AVG (SAL)--------------------20 217510 2916.66667  --to find out the average wage in the above jobs (job)Select Job

SQL Basics--mysql 5 (3)

8. Calculated fieldsConcat () Splicing stringMysql> SelectConcat (Name,'-', msg) fromPw_luck;+-----------------------+|Concat (Name,'-', msg)|+-----------------------+|Wilson- - ||Zhangsan- - ||Lisi-1001 ||Wang5-1001 ||Zhangsan7- + ||Zhangsan8- + ||Zhangsan9- + ||Wang5- + ||Wang5%- - ||WANG5- + |+-----------------------+TenRowsinch Set(0.00SecRTrim () Remove right space LTrim () remove left space Trim

SQL Basics (i)

Tags: def modify pre number not block PAC creat time1. How the data is stored (table property Operations) 1.1 questions to consider before building a table A. Table name B. table contains data type (CHAR (fixed-length character), VARCHAR (indefinite long character), number (numeric), date (date and time), BLOB (large data set), straight string, custom type) C. Fields that make up the primary key D. length of each field E. Which fields can be null1.2 CREATE TABLE Statement Ba

SQL Basics--mysql 5 (9)

Label:16 inserting INSERT into table values ()Mysql> Insert intoPw_priceValues(5, the,'Cai'); Query OK,1Row affected (0.03sec) MySQL> Select * fromPw_price;+-----+-------+------------+|Uid|Price|First_Name|+-----+-------+------------+| 1 | - |Wang|| 2 | + |Zhang|| 3 | - |Li|| 4 | the |Weizhi|| 5 | the |Cai|+-----+-------+------------+5Rowsinch Set(0.00SecInsert a partial fieldMysql> Insert intoPw_price (Uid,first_name)Values(6,'Guo'); Query OK,1Row affected (0.03sec) MySQ

SQL Server Basics

A1. 1 LTRIM (character_expression)-- Delete the starting space in the character variable 2 RTRIM ( character_expression)-- Delete trailing spaces in the character variable 2. Gets the start position of the returned start of the specified string. Return position starting from 1, not starting from 0 1 CHARINDEX (expression1, expression2 [ , Start_location ] ) (ii) SUBSTRING (expression, start, length) parameter expression is a string, a binary string, a text, an image, a column, or a containing

SQL Basics Review

Straight to the point------F41. EnquirySearch queries for the specified data table or view to find the functionality that meets the query criteria, including the following SQL syntax, where "" is optionalselect2. Defining the DDLData definition Language, a language used to define and revoke a specified database object (data tables, views, indexes, stored procedures, users, etc.),①. The "Create table/alter table/drop table" statement for the data table

4.SQL Language Basics

(commit statement)Committing a transaction means persisting all the operations of the database to the database, which is usually done using a commit statement. Execution order:A. Records that the current transaction has been committed within the rollback segment and claims a unique system number (SCN) to uniquely identify the transaction. B. Start the background log write process (LGWR), write the data in the redo log buffer of the SGA area and the SCN of the current transaction into the redo

Total Pages: 15 1 .... 11 12 13 14 15 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.