0% found this document useful (0 votes)
11 views

Handouts - 02 (Data Base Intro)

The document discusses database concepts like what is a database, what is a table, DDL, DML, DCL and DRL commands. It also discusses the Teradata data dictionary and how table structures and columns are stored in DBC.tables and DBC.columns tables.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Handouts - 02 (Data Base Intro)

The document discusses database concepts like what is a database, what is a table, DDL, DML, DCL and DRL commands. It also discusses the Teradata data dictionary and how table structures and columns are stored in DBC.tables and DBC.columns tables.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Quality Thought ETL Testing Daily Handouts

Note: Follow Handouts & Material & Examples which are discussing in classes to get good knowledge on ETL Testing
Session-2
Topics covered in session:
1. what is Database?
2. What is a Table?
3. DDL, DML, DCL and DRL commands
4. Teradata Data dictionary

1. What is Database?
Database: Database is nothing but collection of database objects for the purpose of
storing/maintaining data.
Database Objects: In database we are having different database objects, those are
1. Tables 2.Views 3.Triggers 4.Macros 5.Stored Procedures

2. What is a table?
Table: In a table we can able to store data based on requirement and we can represent that
data in 2-D format, means we can represent data in Rows X Columns format.
Row: Instance of an entity
Columns: Characteristics of an entity and in columns we need to maintain like data
Entity: Entity is nothing but real time object for which we are collecting data.

- If you want to create a table or if you want to maintain data in that table or if you
want to maintain data in table we need to maintain communication with database.
- For the purpose of maintaining communication with database we should have to use
a language, that language we are calling as SQL.
3. Types of commands in SQL: (DDL, DML, DCL & DRL)
In SQL we are having below type of commands.
DDL: (Data Definition Language)
If you want to perform any kind of operations on structure of the table you should have
to go for DDL commands. We can perform below kind of operations on structure of the
table.
 Define the structure of the table - CREATE
 Change the structure of the table - ALTER
 Remove the structure of the table - DROP

DML: Data manipulation language


If you want to perform any kind of operations on data of the table you should have to go for
DML commands. We can perform below kind of operations on Data of the table.
 Load/maintain data in to the table
 Change the data in to the table based on requirement
Note: Follow Han

 Remove data from the table.

QUALITY THOUGHT * www.facebook.com/qthought * www.qualitythought.in


PH NO: 9963486280, 040-40025423 EMAIL ID: [email protected]
Quality Thought ETL Testing Daily Handouts

DCL: Data Control language


If you want to perform any kind of operations on access related things in database you
should have to go for DCL commands.
We can perform below kind of operations on Access of the table.
 Provide access to DB objects
 Remove access to DB objects

DRL: Data Retrieval language


If you want to retrieve data from database you should have to go for DRL commands. To
retrieve data from table we need to use a command called SELECT

Whenever you want to define the structure of that table you should have to understand
below things.
1. Tablename 2.Columnname 3.Datatype 4.Datatype length 5.Constraints
In real time project all this information will be provided by Data Modeler. He will
take requirements from DA/BA and provide model of database in a document called as
Physical Data Model (PDM).
BA/DA (Requirement) -----Data Modeler--PDM Document

By using PDM document Developers can create the tables.


By using same PDM document as a tester we need to perform table properties validations.

Whenever we have defined the structure of the table in Teradata that structure will
be stored in to Data dictionary in the form of tables. We are having two different tables in
Teradata to store structure, those are 1. Dbc.Tables 2. Dbc.columns
DBC.Tables: Whenever we have created any new table that table information will be
stored in Dbc.Tables. For example srinivas created Emp table on 2012-01-01 in to samples
database. This information will be stored automatically in to DBC.tables in below format.
DBC.columns: Whenever we are creating a table, that table column names will be stored in
to DBC.columns in below format.

Scenario 1: If you want to create a new table first we need to cross whether that table is
available or not, to do this we need to write query as below.
Select * from dbc.tables where tablename=’emp’
This query should have to give output as 0 records if you want to create new Emp table
Scenario 2: If you want to find what all are the columns available in table we have to
prepare query as below.
Select * from dbc.columns where tablename=’emp’

QUALITY THOUGHT * www.facebook.com/qthought * www.qualitythought.in


PH NO: 9963486280, 040-40025423 EMAIL ID: [email protected]

You might also like