• Complain

Vannini Marcus. - The 2016 Hitchhikers Reference Guide to SQL

Here you can read online Vannini Marcus. - The 2016 Hitchhikers Reference Guide to SQL full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    The 2016 Hitchhikers Reference Guide to SQL
  • Author:
  • Genre:
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

The 2016 Hitchhikers Reference Guide to SQL: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "The 2016 Hitchhikers Reference Guide to SQL" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Amazon Digital Services LLC, 2016. 37 p. ASIN: B01BI8KANOSQL is a universal programming language for interaction with databases. All statements here are designed to comply with SQL-89 and SQL-92, the 2 most common standards. Not all databases entirely comply with all standards, so be prepared to check for differences in the reference material for the DB you are using. This book provides a quick reference to common statements needed in database administration.
All control words (SQL specific) are capitalized for your reference. In general, SQL is not case sensitive for the control words (SELECT, DROP, UPDATE, etc.) and many DBs are not case sensitive for the table and field names, but your results may vary. A good convention is to upper case all control words, and match the case of all field names and table names, etc.
This book is designed as a reference book for people who already have a basic understanding of SQL, not complete beginners

Vannini Marcus.: author's other books


Who wrote The 2016 Hitchhikers Reference Guide to SQL? Find out the surname, the name of the author of the book and a list of all author's works by series.

The 2016 Hitchhikers Reference Guide to SQL — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "The 2016 Hitchhikers Reference Guide to SQL" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make

The 2016HitchhikersReference GuidetoSQLMarcus S. Vannini


HitchhikersTable of Knowledge Bombs & Intergalactic Gargleblasters
Introduction
SQL is a universal programming language for interaction withdatabases. All statements here are designed to comply with SQL-89 and SQL-92,the 2 most common standards. Not all databases entirely comply with allstandards, so be prepared to check for differences in the reference materialfor the DB you are using. These statements are an attempt to provide quickreference to common statements needed in web programming. All control words (SQL specific) are capitalized for yourreference.

In general, SQL is not case sensitive for the control words(SELECT, DROP, UPDATE, etc.) and many DBs are not case sensitive for the tableand field names, but your results may vary. A good convention is to upper caseall control words, and match the case of all field names and table names, etc. This book is designed as a reference book for people whoalready have a basic understanding of SQL, not complete beginners.

SQL & Database Basics
SQL stands for Structured Query Language SQL is pronounced sequel SQL is a declarative language SQL is used to access & manipulate data in databases Common SQL Databases are MS SQL Server, Oracle, DB2 and MySQL SQL is a RDBMS (Relational Database Management System) Software that stores and manipulates data arranged in relational databasetables. Table A set of data arranged in columns and rows. General form of a SQL SELECT statement: SELECT FROM WHERE GROUP BY HAVING ORDER BY
SQL Commands Categories & Common Definitions
SQL consists of the following four Command Categories: Data Query Language (DQL) SELECT - Retrieve data from table(s) Data Manipulation Language (DML) INSERT - Insert data into db table UPDATE - Update data in db table DELETE - Delete data from table Data Definition Language (DDL) CREATE - Create db object (table, view, etc.) ALTER - Modify db object (table, view, etc.) DROP - Delete db object (table, view, etc.) Data Control Language (DCL) GRANT - Assign privilege REVOKE - remove privilege Common DefinitionsSELECT Fields with an expression to query(fields are columns in table) AS Alias name for a column to be returned FROMTable to retrieve data from WHERE Row level filter GROUP BY Group when calculating aggregates HAVING Group level filter ORDER BY Alphabetical or numerical sortorder (ASC [ascending] or DESC [descending])
SELECT STATEMENTS EXAMPLES
Select statements enable us to view tables or selectedrecords and selected fields in a table or tables. 1. 1.

SELECT ,....FROM - Select data from specific field(s) in a table 2. SELECT * FROM - Selects everythingfrom the table 3. SELECT FROM ORDER BY, .....ASC- Select data fromfield(s) then sorts in ascending order 4. SELECT FROM ORDER BY, ....DESC- Select data fromfield(s) then sorts in descending order 5. SELECT FROM WHERE- Select data using WHERE clause for a given condition. SELECT ... SELECT ...

FROM WHERE OR - Select datausing WHERE clause with OR for two given conditions. 7. SELECT FROM WHEREAND - Select data using WHERE clausewith AND for two given conditions. 8. SELECT FROM WHEREBETWEEN AND - Select data usingWHERE clause using BETWEEN with AND for two given values. 9.

SELECT FROM WHERE LEFT(,1)IN ('E', 'G', 'H')- Select data using WHERE clause surname starts with E,G or H) 10. SELECT FROM WHEREIS NULL;- Select data using WHERE clause with NULL 11. SELECT FROM WHERELIKE 'A*' OR LIKE 'B*'- Select datausing WHERE clause with LIKE 12. SELECT TOP 10* FROM ORDER BY DESC - Select data using ORDER BY with TOP to query asorted list 13. SELECT * FROM WHERE = 'O'' Neil'- Select data using double quotes to cancel out 'single quotes'

INSERT, UPDATE & DELETE Data
Insert New DataINSERT INTO (,,.....)VALUES (, , ..... )- Inserts new data into a single table Update Existing Data UPDATE SET = WHERE = Updates existing data in a single table Delete Existing DataDELETE FROM WHERE =(usually an integer value)- Deletes ONE row of data froma table DELETE * FROM - Deletes EVERYTHING froma table Be careful of this one!
Performing Calculations in a Query with MAX, SUM,AVG, MIN, COUNT, ROUND
1.

SELECT MAX() AS MaxField1,MAX() AS MaxField2 FROM 2. SELECT SUM() AS [TotalMarks] FROM 3. SELECT AVG() AS [AverageMark] FROM 4. SELECT MIN() AS [First First Name],MAX() AS [Last Surname] FROM 5. SELECT COUNT(*) AS [Number of Students] FROM 6. SELECT ROUND(AVG(YEAR(BDate)),2) AS AvgBDate FROM WHERE = 3

Joining Tables
1.

SELECT,,.... FROM,, WHERE = AND = This is a general SQL query combining TWO tables using WHEREclause 2. SELECT ,field2>, FROM INNER JOIN ON = (Alternative method) Returns all rows when there is at least one match in BOTHtables. 3. SELECT ,,FROM LEFT JOIN ON = General form of a LEFT JOIN Returns all rows from the lefttable, and the matched rows from the right table. 4.

SELECT ,,FROM RIGHT JOIN ON = General form of a RIGHT JOIN Returns all rows from the righttable, and the matched rows from the left table. 5. CREATE TABLE(,,,); General form for CREATING a table in a database

How to Order Data & Using Union
How to Order Data SELECT FROM WHERE ORDER BY Example: SELECT FirstName, LastName, OrderDate FROM Orders WHERE OrderDate > '10/10/2010' ORDER BY OrderDate Using Union SELECT FROM UNION SELECT FROM Example: SELECT FirstName, LastName FROM Orders2010 UNION SELECT FirstName, LastName FROM Orders2011
SQL Cheat Sheet
t =table name, c = column name, vw = view name, v = value, dt= data type, l = data type length, at = table alias, aggregate= aggregate function, idx = index name
SQL SELECT STATEMENTS SELECT * FROM t SELECT c1,c2 FROM t SELECT c1,c2 FROM t WHERE conditions SELECT c1,c2 FROM t WHERE conditions ORDER BY c1 ASC,c2 DESC SELECT DISTICT c1,c2 FROM t SELECT c1, aggregate(c2 * c3) FROM t GROUP BY c1 SELECT c1, aggregate(c2 * c3) FROM t GROUP BY c1 HAVING c1 > v1 SQL OPERATORS SELECT * FROM t WHERE c1 [NOT] BETWEEN v1 AND v2 SELECT * FROM t WHERE c1 [NOT ] IN (v1,v2,) SELECT* FROM t WHERE c1 > v1 AND c1 < v2 SELECT * FROM t WHERE c1 < v1 OR c1 > v2 SELECT * FROM t WHERE c1 = v1 SELECT * FROM t WHERE c1 <> v1 SQL VIEW STATEMENTS CREATE UNIQUE INDEX idx ON t(c1,c2..) DROP INDEX t.idx SQL JOIN STATEMENTS SELECT * FROM t1 INNER JOIN t2 ON conditions SELECT * FROM t WHERE c1 [NOT ] IN (v1,v2,) SELECT * FROM t1 INNER JOIN t2 ON conditions WHERE conditions SELECT * FROM t1, t2 WHERE conditions SELECT * FROM t1 LEFT JOIN t2 ON conditions SELECT * FROM t1 RIGHT JOIN t2 ON conditions SELECT * FROM t1 FULL OUTER JOIN t2 ON conditions SELECT * FROM t1 AS at1 INNER JOIN t2 AS at2 ON at1.c1 = at2.c2 SQL TABLE STATEMENTS SQL TABLE STATEMENTS CREATE TABLE t( c1 dt1(l1), c2 dt2(l2), ... ) DROP TABLE t ALTER TABLE t ADD COLUMN c dt(l) ALTER TABLE t DROP COLUMN c SQL UPDATE DATABASE INSERT INTO t (c1,c2) VALUES (v1,v2) INSERT INTO t1 (c1,c2) SELECT c1,c2 FROM t2 WHERE conditions UPDATE t SET c1 = v1, c2 = v2, WHERE conditions DELETE FROM t WHERE conditions TRUNCATE TABLE t SQL VIEW STATEMENTS CREATE VIEW vw AS SELECT c1,c2 FROM t ALTER VIEW vw AS SELECT c1,c2 FROM t DROP VIEW vw
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «The 2016 Hitchhikers Reference Guide to SQL»

Look at similar books to The 2016 Hitchhikers Reference Guide to SQL. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «The 2016 Hitchhikers Reference Guide to SQL»

Discussion, reviews of the book The 2016 Hitchhikers Reference Guide to SQL and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.