Successfully reported this slideshow.

MS SQL SERVER: Feeding Data Into Database


Published on

MS SQL SERVER: Feeding Data Into Database

Published in: Technology
  • Be the first to comment

  • Be the first to like this

MS SQL SERVER: Feeding Data Into Database

  2. 2. ETL is everything<br />What is ETL?<br />ETL Stands for: Extract – Transform – Load<br />ETL is the set of processes which are done in-order to generate the data what is to be stored in a database/used for analysis<br />
  3. 3. ETL is everything<br />ETL Explained<br />Let us consider Tom who wishes to create a database of famous pop albums. The Process that he undertakes under an ETL model will be as follows:<br />Extract Data<br />TransformData<br />Information from Album DVDs<br />Data Warehouse<br />Load Data<br />A Data warehouse is defines as a data repository from which retrieval is very quick <br />Internet<br />Books<br />Info from friends<br />
  4. 4. Migrating a Database<br />An Important feature in Database systems is the migration of a database<br />It is defined as the process of porting data from one platform/application in one format to another of a same/different format<br />The Process of migration is quite simple:<br />Understand a database and its properties<br />Understand the differences between the source and the destination system<br />Make the pre-migration changes in the source data<br />Migrate from source to destination via automation/manual entry<br />Make the post-migration changes in the destination data<br />
  5. 5. Migrating a Database<br />Illustration: Consider that a school ‘Hermione Internationals’ upgrades its management system from a Foxpro DBMS to SQL Server 2008 system. The Database contain the same data(student information) but the format and organization of stored-data will differ.<br />Extract values from DB<br />Feed data into DB<br />Integrate DB into Application<br />Isolate DB<br />
  6. 6. Inserting into a Database<br />After creating the structure of a database, the next step is to insert values into it. The Insertion of values must be done with care. The Important things which are to had in mind are:<br />The Data type of value that is inserted should match with the data type of the field<br />The Size of the value inserted must fall within the size which is designated for a particular field while designing of the table.<br />
  7. 7. Inserting into Database<br />The SQL command to insert into the database is the insert into command<br />Syntax:<br />insert into &lt;table_name&gt; values (&lt;values&gt;,..)<br />For example, consider a database maintained by a kid named ‘Jessy’. The database contains information about the cartoons that she watches on Tv.<br />Table name: cartoon<br />
  8. 8. Inserting into Database<br />Now suppose Jessy starts watching a new show ‘Laughs and Gags’ on Pogo Channel, she needs to insert this into her database<br />SQL Command:<br />insert into cartoon values(‘Laughs and Gags’,’Pogo’,’4PM: Weekends’, null);<br />Jessy has just started watching the series and can decide on the rating after some-time only. Hence, the field is left as NULL <br />The Order in which the values are given is the order in which they were designed<br />
  9. 9. Updating a Database<br />Now, suppose Jessy has become a fan of ‘Laughs and Gags’ show and wants to give it a rating of 100, she musupdate her database. The SQL syntax for updation is:<br />Syntax:<br />update &lt;table_Name&gt; set &lt;field_Name&gt;=&lt;new_Value&gt; <br />where &lt;condition&gt;<br />For example, consider the database maintained by ‘Jessy’. <br />Null<br />
  10. 10. Updating a Database<br />SQL Command:<br />Update cartoon set rating=100 <br /> where cartoonName = ‘Laughs and Gags’<br />The Where clause:<br /><ul><li> Where is used to specify a condition for the Query
  11. 11. For string matching, use the ‘like’ keyword. Here, wild card characters(% and _)</li></ul>% -character represents a group(or single) of characters<br /> _ -character represents a single character<br />Illustration:<br />To Update cartoons whose names start with the letter ‘a’ must be given as <br />Update cartoon set rating=100 <br /> where cartoonName = ‘a%’<br />
  12. 12. Updating a Database<br />Illustration:<br />To Update cartoons whose names start with the letter ‘a’ and the name must of 3 characters in length:<br />Update cartoon set rating=100 <br /> where cartoonName = ‘a__’<br />
  13. 13. Summary<br />5. Feeding data into a database<br /><ul><li> ETL Process
  14. 14. Migrating a database
  15. 15. Inserting values into a database table
  16. 16. Updating a database table</li></li></ul><li>Visit more self help tutorials<br />Pick a tutorial of your choice and browse through it at your own pace.<br />The tutorials section is free, self-guiding and will not involve any additional support.<br />Visit us at<br />