• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Practical MS SQL Introduction
 

Practical MS SQL Introduction

on

  • 725 views

Practical MS SQL Introduction

Practical MS SQL Introduction

Statistics

Views

Total Views
725
Views on SlideShare
725
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • The flat-file style of database are ideal for small amounts of data that needs to be human readable or edited by hand…The typical flat-file database is split up using a common delimiter. http://websiteowner.info/articles/cgi/databasetypes.aspThe relational databases such as MySQL, Microsoft SQL Server and Oracle, have a much more logical structure in the way that it stores data. Tables can be used to represent real world objects, with each field acting like an attribute. For example, a table called books could have the columns title, author and ISBN, which describe the details of each book where each row in the table is a new book.A data file that is not related to or does not contain any linkages to another file. It is generally used for stand-alone lists. When files must be related (customers to orders, vendors to purchases, etc.), a relational database manager is used, not a flat file manager. Flat files can be related, but only if the applications are programmed to do so. http://www.answers.com/topic/flat-fileLike a flat file, an XML file can contain many different types of data. There are many possible ways to represent the information in a flat file using XML. For example, each field and each record could be an XML element. One advantage of using XML would be that each field is named. A disadvantage is that the file would be larger. A file containing XML is not generally called a flat file, even though it satisfies the definition. It usually is called an XML file.
  • Relational databases do not link records together physically, but the design of the records must provide a common field, such as account number, to allow for matching. Often, the fields used for matching are indexed in order to speed up the process. http://www.answers.com/topic/dbms-technologyData SecurityData IntegrityInteractive Query
  • Database integrity ensures that data entered into the database is accurate, valid, and consistent. Any applicable integrity constraints and data validation rules must be satisfied before permitting a change to the database.
  • tables, indexes, views, defaults, triggers, rules constraints and procedures
  • Balanced Tree
  • 8-KB (Page) - 96-byte (Header) = 8096 BytesIndex = 4-Bytes => 8096/4 = 2024
  • A heap is a table without a clustered index.
  • http://www.scribd.com/doc/7502188/Sample-SQL-Server
  • Each database consists of at least two files: one is a primary datafile (by default, with the .mdf extension), the other is log file(by default, with the .ldf extension).
  • RAID 0 (striped disks) distributes data across several disks in a way that gives improved speed and full capacity, but all data on all disks will be lost if any one disk fails. RAID 5 (striped disks with parity) combines three or more disks in a way that protects data against loss of any one disk; the storage capacity of the array is reduced by one disk.
  • How do I recover data from SQL Server's log files?There are several tools available for reviewing SQL Server log files, and restoring data that was accidentally lost or corrupted, say, after your last backup. Three such products are:      Apex SQL Log      Log Explorer      SQL Log Rescue http://sqlserver2000.databases.aspfaq.com/how-do-i-recover-data-from-sql-server-s-log-files.html
  • Tip: Place log on separate drive for performanceIf the log contains multiple physical log files, the logical log will move through all the physical log files before it wraps back to the start of the first physical log file. http://msdn.microsoft.com/en-us/library/ms179355(SQL.90).aspxhttp://jmkehayias.blogspot.com/2008/11/database-transaction-log-part-2-how.htmlDBCC LOGINFO -- Database Consistency Checker (DBCC)
  • http://www.onlamp.com/pub/a/onlamp/2001/03/20/aboutSQL.html?page=2
  • The database community has developed a series of guidelines for ensuring that databases are normalized. These are referred to as normal forms and are numbered from one (the lowest form of normalization, referred to as first normal form or 1NF) through five (fifth normal form or 5NF). In practical applications, you'll often see 1NF, 2NF, and 3NF along with the occasional 4NF. Fifth normal form is very rarely seen and won't be discussed in this article. http://databases.about.com/od/specificproducts/a/normalization.htm
  • The database community has developed a series of guidelines for ensuring that databases are normalized. These are referred to as normal forms and are numbered from one (the lowest form of normalization, referred to as first normal form or 1NF) through five (fifth normal form or 5NF). In practical applications, you'll often see 1NF, 2NF, and 3NF along with the occasional 4NF. Fifth normal form is very rarely seen and won't be discussed in this article. http://databases.about.com/od/specificproducts/a/normalization.htm
  • Next we test each table for partial dependencies on a concatenated key. This means that for a table that has a concatenated primary key, each column in the table that is not part of the primary key must depend upon the entire concatenated key for its existence. If any column only depends upon one part of the concatenated key, then we say that the entire table has failed Second Normal Form and we must create another table to rectify the failure. http://www.phlonx.com/resources/nf3/#intro
  • At last, we return to the problem of the repeating Department information. As our database now stands, if an employee works in more than one project then we have to input all of that employee's departmentinformation again. This is because there are columns in the Employees table that rely on "non-key attributes".
  • In 1986, ANSI approved a rudimentary version of SQL as the official standard, but most versions of SQL since then have included many extensions to the ANSI standard. In 1991, ANSI updated the standard. The new standard is known as SAG SQL. http://www.webopedia.com/TERM/S/SQL.htmlAmerican National Standards Institute. This organization is responsible for approving US standards in many areas, including computers and communications. Standards approved by this organization are often called ANSI standards (eg, ANSI C is the version of the C language approved by ANSI). www.incredible.co.za/services/glossary/glossary.asp
  • SELECT FROM * = All Columns
  • SELECTOrd.OrderID,Ord.OrderDate,(SELECTMAX(OrdDet.UnitPrice)FROM Northwind.dbo.[Order Details] ASOrdDetWHEREOrd.OrderID=OrdDet.OrderID)ASMaxUnitPriceFROMNorthwind.dbo.OrdersASOrdA subquery is a SELECT query that returns a single value and is nested inside a SELECT, INSERT, UPDATE, or DELETE statement, or inside another subquery. A subquery can be used anywhere an expression is allowed.
  • Round, Ceiling, Floor, … Mathematical Functions
  • BETWEEN Between an inclusive range LIKE Search for a pattern % _ [^]IN If you know the exact value you want to return for at least one of the columns select * from orders where CustomerID like '[^vtbsp]%'select * from Orders WHERE OrderDate BETWEEN '1996-08-01' AND '1996-09-02'
  • At times you may need to join two or more tables to retrieve the information you need from your database.
  • (kär-tzhn)
  • Including the customers with 0 orders
  • SELECT CompanyName, ContactName, Phone, CountryFROM CustomersWHERE (Country = @CountryName)
  • http://www.answers.com/topic/object-relational-mappinghttp://mattfleming.com/node/192http://www.mssqlcity.com/Articles/General/sql2000_locking.htmhttp://msdn.microsoft.com/en-us/library/ms190440.aspx (log)http://www.mssqlcity.com/Articles/Tuning/FileOptimTips.htm
  • http://www.answers.com/topic/object-relational-mappinghttp://databases.about.com/od/specificproducts/a/keys.htmhttp://www.gre-sqlserver-solutions.com/Memory.html

Practical MS SQL Introduction Practical MS SQL Introduction Presentation Transcript