You are on page 1of 88
> Flom comin ony one ow oot | A is one instance of all columns in a table. Feedback: Esl To review these topics, click Rows or Columns. 1.2 Exercise ‘Which one of the following statements is true? “A. A database is a two-dimensional array of rows and columns, B. A Primary Key must contain one, and only one, column, C. Foreign Keys have no relationship to existing Primary Key selections, D. Teradata is an ideal foundation for customer relationship management, e-commerce, and active data warehousing, applications, Feedback: | eee To review these topics, click How is Teradata Used?, What is a Relational Database?, Primary Key, or Foreign Key. 1.3 Bxercise Create a relationship between the two tables by clicking on: ‘The Foreign Key column in the Product table ©The Primary Key column in the Vendor table Feedback: Description Khaki slacks Cashmere sweater Gabardine slacks Pleated skirt Silk blouse ‘Vendor Vendor . Name. 1b. City. Country MensWare 43434 | New York USA, On The Town 11428 | London UK Claire Wes | 37459 | Patio FRC : Outback 13172 | Sydney | AUS Fashion NY 70088 _| New York USA, “To review these topics, click Foreign Key or Primary Key, 14 Exercise Click on the name ofthe customer who placed order 7324, Feedback: 1. To review this topic, click Primary Key or Foreign Key, [ORDERDETAIL ‘Ord | Part | Cust [ “Qty | Ship Date m i aC] aK mar [seop 3s | | a ras |e0)2| a | ine fu |u| 3 | | ana rag |3e1| 3 | wo | ine 2 | To] ans 3 Lio | ine CUSTOMER: Sasson Tiomo_[-Fhove vr ‘aor 2 [Tames [RET a5ctaPweer || 3 is Sant 2 tia Bort Peper |] 9 | biac | xe e5 fab | fo Pon 1 | Fico’ | sooo 15 Bercise How many calondars were shipped on 4/152 (These same tables were used inthe previous exercise) . 10 ° aa be 40 © 30 Feedback: [ORDER DETAIL, ‘Ord T Part ‘Ship Date Pe a Ta pao) 3 | a | ane ras | ana] 2] 0 | ane tou | 3a] 3 | | ana ram | ai} 3 | wo | ans qa | ara] 2] 10 | ans ras | 089 | 10 | ans PART: TES] (CUSTOMER) 5 Part [Oiyony Dosedpton | { Cust | Namo [Phone P| Hand PK 30S] 10. | Calder 2 [ames | SSEAIET 2500 | 225 | 8.504 Paper || 3 | Brown | 444-3339 3474 20 | Stocior 12 | Adamo | 111-9008 3345 | 75 | 86x11 Paper || 9 | Bleck | 460-5565 21 | 109 | we Penci 13 | Rice | senses “To review this topi, click Primary Key ot Foreign Key. 16 Exercise Which of the following is NOT a unique feature of Teradata? (Choose one.) A. Ability to model the bu iness, with data organized according to what it represents, B, Provides a mature, paalle-aware Optimizer that chooses the least expensive plan forthe SQI. request. . Provides linear scalability, so there is no performance degradation as you grow the system. D. Gives each department in the enterprise a self-contained, functional data store for their own assumptions and analysis. E, Provides automatic aid even data distribution for faster query proces Feedback: ‘To review these topics, click Single Data Store, Scalability, Unconditional Parallelism, Ability to Model he Business, and ‘Mature, Parallel-Aware Optimize. ‘unconditional parallel architecture. Objectives ‘© Identify the different types of enterprise data processing. Define a data warehouse, active data warehouse, and a data mart List and define the different types of data marts, Explain the advantages of detail data over summary data. Describe the overall Teradata parallel architecture. List and describe major Teradata hardware and software components and their functions. Explain how the architecture helps to maintain high availability and reliability for Teradata users Abitior ri: this module contains inks to important supplemental courte infomation, Please be sure to Data Warehouse Usage Evolution ‘There is an information evolution happening in the data warehouse environment today. Changing business requirements have placed demands on data warehousing technology to do more things faster. Data warehouses have moved from back room strategic decision support systems to operational, business-critcal components of the enterprise. As your company evolves in its use ofthe data warchouse, what you need from the data warehouse evolves, 100, STAGE1 STAGE2 STAGE 3 STAGE 4 STAGES REPORTING ANALYZING PREDICTING ~—OPERATIONALIZING | ACTIVE WAREHOUSING ‘WHAT why wit WHAT MAKING happened? —didit happen? will ithappen? IS Happening? ithappent | 1 5 Primarily Inereas Analytical Beene Mediiing Continuous Update & Event Gased faunce todeling Time Sensitive Queries. Triggering Become important Takes Hold Howey Wrstcc — Blaiice SetruowsUetMe eet used Tagetng Stage 1 Reporting: The initial stage typically focuses on reporting from a single source of truth to drive decision-making across functional and/or product boundaries. Questions are usuelly know in advance, such as a weekly sales report Stage 2. Analyzing: Focus on why something happened, such as why sales went down or discovering patterns in customer buying habits. Users perform ad-hoc analysis, slicing and dicing the data ata detail level, and questions are not known in advance, Stage 3 Predicting: Sophisticated analysts heavily utilize the system to leverage information to predict what will happen next in the business to proactively manage the organization's stratogy. This stage requires data 4 mining tools and building predictive models using historical detail. As an example, users can model customer |) demographics for target marketing, Stage 4 Operationalizing: Providing access to information for immediate decision-making in the field enters the realm of active data warehousing, Stages | to 3 focus on strategic decision-making within an organization. ‘Stage 4 focuses on tactical decision support.. Tactical decision support is not focused on developing corporate strategy, but rather on, supporting the people in the field who execute it. Examples: 1) Inventory management with just-in-time replenishment, 2) Scheduling and routing for package delivery. 3) Altering a campaign based fon current results, ‘Stage 5 Active Warehousing: The larger the role an ADW plays in the operational aspects of decision support, the more incentive the business has to automate the decision processes. You can automate decision- making when a customer interacts with a web site, Interactive customer relationship management (CRM) on a ‘Web sito or at an ATTM is about making decisions to optimize the customer relationship through individualized product offers, pricing, content delivery and so on. As technology evolves, more and more decisions become ‘executed with event-driven triggers to initiate fully automated decision processes, Example: determine the best offer for a specific customer based on a real-time event, such as a significant ATM deposit Active Data Warehouse Data warehouses are beginning o take on mission-critical roles supporting CRM, one-to-one marketing, and ‘minute-to-minute decision-making. Data warehousing requirements have evolved to demand a decision capability that is not just oriented toward corporate staff and upper management, but actionable on a day-to- day basis, Decisions such as when to replenish Barbie dolls a a particular retail outlet may not be strategie at the level of customer segmentation or long-term pricing strategies, but when executed properly, they make a big difference to the bottom line. We refer to this capability as "tactical" decision suppor. ‘Tactical devisions are the drivers for day-to-ay management of the business, Businesses today want more than just strategic insight from their data warehouse implementations-they want better execution in running the business through more effective use of information for the decisions thal get made thousands of times per day. ‘The origin of the active data warehouse is the timely, integrated store of detail data available for analytic ‘business decision-making, I is only from that source that the addtional traits needed by the active data ‘warehouse can evolve. These new "active" traits ae supplemental to data warehouse functionality. For example, the work mix in the database still includes complex decision support queries, but expands to take on short, tactical queries, background data feeds, and possibly event-driven updates all atthe same time, Data volumes and user concurrency levels may explode upward beyond expectation, Restraints may need to be placed on the longer, analytical queries in order to guarantee tactical work throughput. While accessing the detail data diectly remains an important opportunity for analytical work, tactical work may thrive on shortcuts and summaries, such as operational data store (ODS) level information. And for both strategie and tactical decisions to be useful to the business, today's data, this hour's data, even this minute's data has to be at hand, ‘Teradata is positioned exceptionally well for stepping up to the challenges reated to high availability, large multi-user workloads, and handling complex queries that are required for an active data warchouse implementation, Teradata technology supports the evolving business requitements by providing high performance and sealability for: + Mixed workloads (both tactical and strategic queries) for mission critical applications + Large amounts of detail data © Concurrent users ‘Teradata provides 7x24 availability and reliability, as well as continuous updating of information so data is always fresh and accurate, Evolution of Data Processing ‘Traditionally, data processing has been divided into two categories: on-line transaction processing (OLTP) and decision support systems (DSS). For either, requests are handled as transactions. A transaction is a logical lunit of work, such as a request to update an account ‘An RDBMS is used in the following main processing environments: * Dss + OLTP + OLAP Decision Support Systems (DSS) Ina decision support environment, users submit requests to a =) “The reaults are used to establish strategies, reveal trends, and make projections. A database used as a decision support system (DSS) usually receives fewer, very complex, ad-hoc queries and may involve numerous tables, Decision support systems include batch reports, which roll-up numbers to give business the big picture, and over time, have evolved: ‘© Instead! of pre-written scripts, users now require the ability todo ad-hoc queries, which are unpredictable in their processing and which allow "what if" types of questions. These types of questions are essential for long range planning. + DSS systoms are abe to read through huge volumes of dat teationally excelled with its parallel architecture, a aoe On-line Transaction Processing (OLTP) Unlike the DSS environment, an on-line transaction procossing (OL-TP) environment typically has users accessing current data fo update, insert, and delete rovrs inthe data tables. OLTP is typified by a small number ‘of rows (or records) or a few of many possible tables being accessed in a matter of seconds or Lss. Very little UO processing is required to complete the transaction. This type of transaction takes place when we take out ‘money at an ATM. Once our card is validated, a debit transaction takes place against our eurrent balance to reflect the amount of cash withdrawn. This type of transaction also takes place when we deposit money into a ‘checking account and the balance gots updated. We expect those transactions tobe performed quickly. They rust occur in real time Ea a & ‘On-line Analytical Processing (OLAP) COLAP is the kind of processing that takes place in many data warehouses or data marts. Here, the user may be looking for historical trends, sales rankings or seasonal inventory fluctuations for the entire corporation. ‘Usually, this involves a lat of detail data to bo retrieved, processed and analyzed. ‘Therofore, response time can be in seconds or minutes. In the most sophisticated OLAP systems, the systeis will make automated purchasing or inventory decisions without any human intervention, DSS is an area where Teradata has Type Exampres Number ofRaws | Response Recessed! Time ‘OLTP [Update eneverg accounltoretiect | Sra ‘orinds a deposit Debit transaction takes place against cutrent alaice to reflect arraunt of aney watarann at ATH [DSS [How mary chid ske bus panswere | Larne ‘Bevonds or SoM across alof ow Eade stra mines Inthe mont of eran? Wat were the rorthly sales of ‘hogs or otalar X? ‘OLAP | Showtho lop fer calinglieme acloes | Large of aatalroveor [evends oF al stores for 1997 rrpdera of surrany | minutos weekto last week. decision-makers must have four things: © The right da * Enough detail data Proper data structure there questions it eannot answer? is ‘Your Understanding ut i ER oa Yor © one once” a OLAP D4 © pss showa comearicon of eaes fromthe | rows ‘© Enough computer power to access and produce reports on the data Consider your own business and how it uses dala. Is that data detailed or summarized? If t's summarized, are Until recently, most business decisions were based on summary data, The problem is that summarized data is not as useful as deta data and cannot answer some questions with accuracy, With summarized data, peaks and valleys ae leveled when the peaks fall at the end of reporting period and are cut in alt. Here's another example, Think of your monthly bank statement that records checking account activity. It only told you the total amount of deposits and withdrawals, would you be able to tell ifa certain check had. cleared? To answer that question you need a list of every check received by your bank. You need detail data, Decision support-answering business questions-is the real purpose of databases. To answer business questions, Which pe of tanston processing sppats answering this pe Of question, "HOW any women’ dass ‘The Data Warehouse lo A data warehouse is a central, enterprise-wide database that contains information extracted ftom the ‘operational systems. Data warehouses have become more common in corporations where enterpis detail data may be used in on-line analytical processing to make strategic and tactical business decisions. Warehouses often carry many years worth of detail data so thet historical trends may be analyzed using the full power ofthe data, “Many data warchouses get their data dizectl from operational systems so thatthe deta is timely and! accurate. While data warehouses may begin somewhat small in scope and purpose, they often grow quite large as their uty becomes more fully exploited by the enterprise Data Warehousing is a process, not a product. Its a technique fo properly assemble and manage data from. various sourees to answer business questions not previously possible or known. | Operational Systems Data Warehouse ‘A data mattis a special purpose subsct of enterprise data used by a patticular department, function oF application, Data marts may have both summary and detail data for a particular use rather than for general use. Usually the data has been pre-aggregated or transformed in some way to better handle the particular type of requests ofa specific user community. Independent Data Marts Independent date marts are created directly from operational systems, just as isa data warehouse, In the data ‘mat, the data is usually transformed as part ofthe load process, Data might be aggregated, dimensionalized or summarized historically, as the requirements of the data mart dictate, Logieal Data Marts Logical data marts are not separate physical structures ora data load ftom a data warehouse, but rather are an existing part of the data warehouse. Because in theory the data warehouse contains the detail data of the enti enterprise, a logical view of the warehouse might provide the specific information fora given user communi :nuch as a physical data mart would. Without the proper technology, a logical data mart can be a slow and fistrating experience for end users. With the proper technology, it removes the need for massive deta loading ‘and transforming, making a single data store available for al user needs, Dependent Data Marts Dependent data maris are created from the detail data in the data warehouse. While having many ofthe advantages ofthe logical deta mart, this appronch still requires the movement and transformation of data but may provide a better vehicle for performance-critical user queries. Independent Data Marts Independent data mats are usually the easiest and festestto implement and their payback value can be almost immediate. Some corporations start with several data marts before deciding to build a true data warehouse, “This approach has several inherent problems: © While data marts have obvious value, they are nota true enterprise-wide solution and ean become very costly overtime as more and more are added. + A major problem with proliferating data marts is that, depending on where you look for answers, ‘there is often more than one version of the truth, ‘© They do not provide the historical depth ofa true data warehouse. ‘© Because data marts are designed to hendle specific types of queries from a specific type of user, thoy are often not good at "what if” queries like « data warehouse would be, Logical Data Marts Logical data marts overcome most of the limitations of independent data marts. They provide a single version of the ruth, There is no historical limit to the data and "whet if" querying is entirely feasible. The major drawback to logical data mart isthe lack of physical control over the data. Because data in the warehouse in not pre-aggregated or dimensionalized, performance against the logical mart will nt usually be as good as ‘against an independent mart. However, use of parallelism inthe logical mart can overcome some of the limitations of the non-transformed data Dependent Data Marts Dependent data marts provide all advantages ofa logical matt and also allow for physical control of the data as itis extracted from the data warehouse. Because dependent marts use the warehouse as their foundation, they are generally considered a better solution than independent mars, but they take longer and are more expensive to implement \\ Inllependent —* Easy to implement Data Mart + Cannothecome a DW. Lite amount of histerical data, + Datatransformations needed, Logleal + Single version ofthetruth. Less phystcal control ‘Data Mart + No historical data bmits, over data Alls dl dooms, trond analy, + Nowanstormatons needed. Dependent + Alladvantages of Logical DM + Data Mart + Allows for physical contol data may be over tata . ‘A Teradata system contains one or more nodes. A node is @ term for processing unit under the control of a single operating system. The node is where the processing occurs for the Teradata Database. There are two typos of Teradata systems: + Symmetric multiprocessing (SMB) - An SMP Teradata system has a single node thet contains multiple CPUs sharing a memory pool + Massively parallel processing (MpP) - Multiple SMP nodes working together ‘comprise a larger, MPP implementation of Teradata. The nodes are connected using the BYNET, which allows multiple virtual processors on multiple nodes to communicate with each other. SMP Syston MP Systema ‘To manage a Teradata system, you use: ‘© SMP system: System Console (keyboard and monitor) attached directly to the SMP node © MPP system: Administration Workstation (AWS) ‘To access a Teradata system, a user typically logs on through one of multiple client platforms (channel- attached mainframes or network-attached workstations). Client access is discussed in the next module, Node Components ‘A node is a basic building block of a Teradata system, and contains a large number of hardware and software components. A conceptual diagram ofa node and its major components is shown below. ardware ‘components are shown on the let side of the node and software components are shown on the right side, {p)_ Ti Teradata vprocs (which are the PBs and AMP) share the components of the nodes (meinoty and epu). The main component of the "shared-nothing” architecture is that each AMP manages its own dedicated portion cof the system's disk space (called the vdisk) and this space is not shared with other AMPs: Hach AMP uses system resources independently of the other AMPs so they can all work in parallel for high system performance overall Check Your Understanding B Which of the following statements is true? o PDE is an application that runs on the Teradata Database software. o gor AMPs manage system disks on the node, 2 ‘The host channel adapter card eonneets to "bus and tag" cables through a Teradata Gatoway. © _An\Ethort ear ss hardware component used in the eoanetionbeyieenaneworkeattachd clieut and the node. cS Feedback: } ~ oS ‘The BYNET (pronounced, "bye-net" is «high-speed interconnect (network) that enables multiple nodes in the system to communicate, It has several unique features: ‘+ Sealable: As you add mote nodes to the system, the overall network bandwidth scales linearly, ‘Phis linear scalability means you can increase system size without performance penalty - and sometimes even increase performance, High performance: An MPP system typically has two BYNBT networks (BYNET 0 and BYNET 1). Because both networks in a system are active, the system benefits from having full use of the 1S aggregate bandwidth of both the networks. ‘+ Fault folerant: Bach network has multiple connection paths, Ifthe BYNET detects an unusable path, in either network, it will automatically reconfigure that network so all messages avoid the unusable path. Additionally, inthe rare case that BYNET 0 cannot be reconfigured, hardware on BYNET 0 is disabled and messages are re-routed to BYNET 1, : Traffic is automatically and dynamically distributed between both BYNETs. BYNET Hardware and Software “The BYNET hardwere and software handle the communication between the yproes and the nodes, Hardware: The nodes of an MPP system are connected with the BYNET hardware, consisting of BBYNET boards and cables. ‘© Software: The BYNET software is installed on every node. This BYNET driver is an interface between the PDE software and the BYNET hardware, ‘SMP systems do not contain BYNET hardware. The PDE and BYNET software emulate BYNET. activity ina single-node environment. The SMP implementation is sometimes called "boardless BYNET: Communication Between Nodes ‘The BYNET hardware can carry the following types of messages bebween nodes: ‘+ Broadcast message to all nodes Point-to-point message from one node to another node Communication Between Vprocs (On an MPP system, BYNET hardware is used to first send the communication across nodes (using either the point-to-point or broadcast messaging described previously). ‘On an SMP system, this first step is unnecessary since there is only one node. ‘Once a node receives 2 communication, vproc communication within the node is done by the PDE and BYNET software using the following types of messaging: © Point-to-point © Multicast H+ Broadcast |) Point-to-Point Messages ‘With point-to-point messaging between vprocs, a vproc can send a message to another vproc on: ‘+ The same node (using PDE and BYNET software) ‘+ A different node using two stops: 1. Send a point-to-point message from the sending node.to the node containing the recipient proc. This is a communication between nodes using the BYNET hardware. 2. Within the recipient node, the message is sent to the recipient vproc. This is & point-to-point ‘communication between vprocs using the PDE and BYNET software. Point-to-Point Message on the Same Node Point-to-Point Message on a Different Node | Multicast Messages {A vproc can send « message to multiple vprocs using two steps: 1. "Senda broadeast messege from the sending node to all nodes. This is communication between nodes using the BYNET hardware. 2. Within the recipient nodes, the PDE and BYNBT software determine which, ifany, ofits yprocs should receive the message and delivers the message accordingly. This isa multicast communication between yproes within the nodo, using the PDE and BYNET sofware. ‘A vproc can send a message to all the vprocs in the system using two steps: 1. Send a broadcast message from the sending node to all nodes, This is @ communication between the BYNET hardware, 2. Within each recipient node, the message is sent to all vprocs. This is a broadcast communication between vprocs using the PDE and BYNET software \B Just for Fun... ‘Aviswor thi following two duiestions about the BYNET to'chéek your Understanding, © = 11 What types of messages is BYNET hardware capable eae between nodes on a system? (Check all ‘hat apply.) OA. Broadsast B, Multicast €. Poin-to-point ER Od D, Siomlcast fase ag nue We Seger ‘cation ‘ oS Oo ALA single vproe on a tiode wee 3 TAS ete B.A group of vproes on a node 3 TG All vproes ona node s = TF] D.None of the above © = 7 ee : aS Feedback! ban cS : A clique (pronounced, "kleck") is a group of nodes that share access fo the same disk arrays. Hach multi-node system has at least one clique. ‘The eabling determines which nodes are in which cliques -- the nodes of a a are connected to the disk array controllers of the same disk arrays Cliques Provide Resiliency Inthe rare event of a node failure, cliques provide for data access through vproc. resets, the following happens to the AMPs: 1. When the node fails, the Teradata Database restarts across all remaining nodes in the system. ration. When a node 2, The yproes fiom the failed node migrate tothe operational nodes in its clique, 3._Processing continues while the failed node is being repaired. ‘The diagram below shows three cliques. The nodes in each clique are cabled to the same disk arrays, The overall system is connected by the BYNET. If one node goes down in a clique the vproes will migrate to the | other nodes in the clique, so data remains available. However, system performance decreases due to the loss of ‘anode, System performance degradation is proportional to clique size.) For each node in the system, you need both of the following: © Operating system license (UNIX or Microsoft ‘© Teradata software license © UNIXMP-RAS © Microsoft Windows 2000 Parallel Database Extensions (PDE) ‘The Parallel Database Extensions (PDE) software layer was added to the operating system by NCR to support the parallel software environment. A Trusted Parallel Application (TPA) uses PDE plement virtual processors (yprocs). The Teradata Database is classified as a TPA. The four components of the Teradata TPA are: BEI AMBP (Top Right) PE (Bottom Right) Channel Driver (Top Left) Teradata Gateway (Bottom Left) ‘Teradata Software: PE. ‘A Parsing Engine (PE) isa vproc that manages the dialogue between a client application and the Teradata Database, once a valid session has been established. Each PE can support a maximum of 120 sessions. The PE handles an incoming request inthe following manner: 1. The Session Control component verifies the request for session authorization (usor names and passwords), and either allows or disallows the request. 2, Tho Parser does the following: © Interprets tho SQL statement received from the application. © Verifies SQL requests forthe proper syntax and evaluates them semantically. © Consult the Data Dictionary to ensure that all objects exist and thatthe user has authority to access them. 3. The Optimizer develops the least expensive plan (in terms of time) to return the requested response sot Processing alteraives ae evaluated andthe fastest alternative is chosen. This alternative is converted into executable steps, to be performed by the AMPs, which are then passed tothe + Dispatcher. ‘The Optimizer is "parallel aware," meaning that it has knowledge ofthe system components (how many nodes, vprocs, etc), which enables it fo determine the fastest way to process the query. In order to maximize throughput and minimize resource contention, the Optimzer must know about system configuration, availabe units of parallelism (AMPs and PEs), and data demographics. The Teradata Optimizer is robust and intelligent, and enables Teradata to handle multiple complex, ad-hoc queries efficiently, 4, The Dispatcher controls the sequenco in which the steps are executed and paises the steps om to the BYNET for execution by the AMPs. 5, Afler the AMPs process the steps, the PE receives thir responses over the BYNET. 6. The Dispatcher builds a response message and sends the message back o the use. Ao ro review the PE software, lick the buttons (rectangles) on the PE. ‘Click on the PE buttons. Teradata Software: AMP ‘The AMP isa vproc that controls its portion of the data on the system. The AMPs work in parallel, cach AMP ing the data rows stored on its vdisk, AMPs are involved in data distribution and data access different ways. Data Distribution ‘When data is loaded, inserted, and updated, the AMP: ‘© Receives incoming data from the PB. ‘+ Formats rows and distributes them om its vdisk. Data Access ‘When data is aecessed, the AMP retrioves the rows requested by the PE in the following manner: |. The database management subsystem receives the steps from the Dispatcher over tho BYNET. 2. The database management subsystem processes the steps. The subsystem on the AMP can: © Lock databases and tables ‘© Create, modify, or delete definitions of tables © Jointables ‘© Insert, delete, or modify rows within tables © Sort, aggregate, or format data (0 Retrieve information from definitions and rows from tables 3, The database management subsystem returns responses over the BYNET to the Dispatcher. Ahr reviow the AMP software, click the buttons (rectangles) on the AMP. ‘Click on the AMP buttons. Teradata Software: Channel Driver ‘Channe! Driver software is the means of communication between an application andthe PEs assigned to 7 channel-atached elients. There is one Channel Driver per node. {| nthe diagram below, the blue dots show the communication from the channel-attached client, to the host channel adapet in the node, tothe Channel Driver software, to the PE, and back tothe client. 1 Teradata Software: Teradata Gateway ‘Teradata Gateway software isthe means of communication between an application and the PEs assigned to network-attached clients, There is one Teradata Gateway per node. In the diagram below, the blue dots show tie communication from the network-attached client, to the Ethernet card in the node, to the Teradata Gateway software, to the PE, and back tothe client, ‘You can access these questions in several ways: ‘© Navigate to each question directly from ths page + Navigate from one question tothe next without returning to this page, * Click Question 2.1 below to begin. ‘Note: The questions are not scored, Their purpose is to provide a review of the material and give immediate 2.4 Bxercise Select the answers from the options given in the drop-down boxes that correctly complete the sentences. eee causes vprocs to migrate to other nodes. a Blleais the communication between nedo in a systom, Bs ou of nodes with access to the same disk arrays, si am installed on each node in the system, ‘o review these topics, lick Cliques Provide Resiliency, Using the BYNET, or Cliques. 2.2 Bxercise Which statements about the Teradata Database are true? (check all that apply): © 4, Runs on a foundation called a TPA. "9 b. ppw isa software layer that allows TPAs to run ina parallel software environment. 7 c.-thete are wo types of virtual processors: AMPs and PEs 7) p,Runs on UNIX MP-RAS and Windows 2000 Feedback: To review these topics, click Software Components, Parallel Database Extensions (PDE), A Teradata System, or Operating System. 23 Exercise Four of these components are contained in the TPA software. Click each of your choices and check the Feedback box ‘below each time to see if you are correct. ‘Toreview this topic, click Trusted Parallel Application 2.4 Exercise Select AMP, BYNET, or PE in the pull-down menu as the component responsible forthe following tasks 7 leas messages between nodes. Edsorts, aggregates, and formats data in the processing of requests TE accesses data on its assigned vdisk. chooses he east expensive plan for creating a response set I Hi Transports responses from the AMPs back to the PEs, facilitating AMP/PE communication. a ee eee eer ICan manage up to 120 sessions, Feedback: - eee u ‘To review these topics, click Node Components, Communication Between Nodes, Communication Between Vprocs, ‘Teradata Software: PE, and Teradata So 2.5 Bxercise From the drop-down box below, select the answer that correctly completes the sentence, In processing a request, the’ Tactrins te most effin plan for processing the requested response. Feedback: ! To review this topic, click Teradata Software: PE. 2.6 Exercise Select OLAP, OLTP, or DSS in the pull-down menu as the appropriate type of data processing for the following requests: Third cash fom ATM. —=<--LU show the top ten selling items for 1997 across all stores. IHow many blue jeans were sold actoss all of our Eastern stores in the month of March in child sizes? Feedback: Fv thoy ton Ast Da Mone From the drop-down box below, select the answer that correctly completes the sentence, An) ay contain detail or summary data and is a special purpose subset of eneterprise data fora particular function or application, rather than for general use. Feeabacks ‘To review this topic, click Data Marts, 2.8 Exercise “From the drop-down box below, select the answer that correctly completes the sentence, Ah Flas the coexistence of tactical and strategic queries. Feedback| ‘To review this topic, click Active Data Warehouse. (> Objectives ‘After completing this mociule, you should be able to: ‘+ Desoribe how the clients access the Teradata Database. ‘+ Illustrate how the Teradata Database processes a request. ‘© Describe the Teradata client utilities and their use. |OT TIP: This module contains links to important supplemental course information. Please be sure to ng content Users ean access data inthe Teradata Database through an application on both channel-attached and network- # attached clients. Additionally, the node itself can act as a client. Teradata client software is installed on each client (channel-attached, network-attached, or nod) end communicates with RDBMS software on the node. ‘You may occasionally hear either type of client refered to by the legacy term of "host," though this term is not ‘typically used in documentation or product literature. Channet-Attached Network Attached Client ¥ CChannet-attached clients are IBM-compatible mainframe systems supported by the Teradata Database, The | following sofware components installed onthe mainframe are responsible for communications between client applications and the Channel Driver on a Teradata node: 4+ Teradata Director Program (TDP) software to manage session traffic, installed onthe channel attached client, + Call-Level Interface (CLD, a library of routines that are the lowest-levelinterfice to Teradata, the Teradata System Communication from clint applications on the mainfiame goes through the mainframe channel, tothe lost ‘Channel Adapter on the node, to the Channel Driver software. Connection made via - HCA, Bus & Tag or ESCON, Cables, Channel Driver, and PE, The Teradata Database supports network-attached clients connected tothe node over & LAN. The following, software components installed on the network-attached clint are responsible for communication between client applications and the Teradata Gateway on a Teradata node: + opBe © Live ‘Communication with the Teradata System ‘Cominunication from applications on the network-attached client goes over the LAN, tothe Ethernet card on the node, to the Teradata Gateway software, ‘Connection made via Ethemet or LAN card, cables, Teradata Gateway, and PE (On the database side, the Teradata Gateway software and the PE provide the connection to Teradata, Teradata is configured with 2 LAN eonnections for redundancy. This ensures high availability. considered a network-attached client. If you install application software on a nods, it will be treated like an application on a network-attached client, In other words, communications from applications on ‘the node go through the Teradata Gateway. An application on a node can be executed through: System Console that manages an SMP system. ‘Remote login, such as over a network-attached client connection, | node? (Check al that apply) | 1p. ataintame terminal 0 B, Busterminal ye 0 no . System console D, Network-attached workstation Feedback: Request Processing _—_—— “How many widgets had more than 15% profit margin in the Eastern region last month? A request like the one above is processed a little differently, depending on whether the user is accessing ‘Teradata through a channel-attacined or network-attached client 1. SQL. request is sent from the client tothe appropriate component on the node: ‘© Channel-attached client: request is sent to Channel Driver (through the TDP). ‘© Network-attached client: request is sent to ‘Teradata Gateway (through CLIv2 or ODBC) Request is passed to the PE(S), IEs parse the request into AMP steps. E Dispatcher sends steps to the AMPs over the BYNET. AMPs perform operations on data on the vdisks. Response is sent back to PEs over the BYNET. PE Dispatcher receives response. Response is rotumed to the client (channel-attached or network-attached). Ah BE] ation Regu om Teradata Client Utilities ‘Teradata has a robust suite of eon utilities that enable users and system administrators to enjoy optimal response time and system manageability. Various client utlities are available for task from loading data to managing the system. ‘Teradata utiles leverage Teradata’s high performance capabilities and are fully parallel and scalable, The same utilities run on smaller entry-level systems, as well asthe largest MEP implementations. “Teradata client utilities include the following, described inthis section * Query Submitting Uiities ‘© BTEQ ‘0 Teradata SQI. Assistant # Load and Unload Utilities FastLoad MaltiLoad ‘TPump FasiExport © Teradata Warehouse Builder * © Administrative Utilities © Teradata Manager (© Teradata Dynamic Query Manager (TDQM) © Teradata Analyst Pack © Archive Utilities © ARC NetVault NetBackup ASE2 Query Submitting Util ‘Teradata provides a number of tools that are front-end interfaces for submitting SQL. queries. Two mentioned ction are BTEQ and Teradata SQL Assistant, occe e080 ities BTEQ (Basic Teradata Query) -- often pronounced “BEE-teek” -- is a Teradata tool used fot submi ‘queries on all platforms. BTEQ provides the following functionality: ‘© Standard report writing and formatting ‘+ Basic import and export of small amounts of data to and from the Teradata Database across all platforms, For tables more than a few thousand rows, the Teradata load utilities are recommended for more efficiency. ‘+ Ability to submit SQL requests in the following ways SQL ‘tone Pitre Mpa aedexpon — Ned(s) Teradata SQL Assistant ‘Teradata SQL Assistant (formerly known as Queryman) is an information discovery/quety tool that runs on Microsoft Windows. Teradata SQL Assistant enables you to access Teradata as well as other ODBC-based databases. Some ofits features include: Ability to save data in PC-based formats, such #s Microsoft Excel, Microsoft Access, and text files, History of submitted SQL syntax, to help you build scripts for data mining and knowledge discovery. ‘+ Help wit SQL syntax. ‘© Import and export of small amounts of data to and from ODBC-compliant databases. For tables more than a few thousand rows, the Teradata load utilities are recommenced for more efficiency. 19 Databases) Otter opec- Compliant ‘ata Ima dat warehouse environment, the database tables are populated from 2 variety of sources, such as mainframe applications operational data mart, or other distributed systems throughout a company. These systems are tho source of data such as daly transaction filo, ordor, usage records, ERP (enterprise resource planning) information, and Internet statistics. Teradata has a suite of data load and unload utilities optimized for use with the Teradata Database. They run on any ofthe supported cient platforms: © Channel-attached client # Notwork-attached elient + Node Using Teradata Load and Unload Utilities ‘Teradata load and unload utilities are fly parallel, Because the utilities are scalable, they accommodate the 1 size oft system. Performance is not limited by the capacity ofthe load and unload tools ‘Tho ulti have full restart capability. This feature means that fa load or unload job should be interrupted for some reason, it can bo restarted again from the last checkpoint, without having to start the job from the beginning. ‘The load and untoad utilities are: © FastLoad © MultiLoad * TPump «© FastBxport Teradata Warehouse Builder ‘By default, you can run up to 15 instances of FastLoad, MultiLoad, and FastExport in any combination. There is no limit to the number of concurrent TPump jobs. FastLoad Use the FastLoad utility to load data into empty tables. FastLoad can only work on one table at atime, FastLoed loads date into an empty table in parallel, using multiple sessions to transfer blocks of data, FestLoed achieves high performance by fully exploiting the resources ofthe system. After the data load is complete, the table can be made available to users fomenal, 1, 598, bea, 2, 428, eabiage, 1, 63, ib, 2, 249, candy bax, 10, 05, syplo, 4, 49, ‘mtoken, 1, 198, carrot, 12, 26 an Cnt Tabs nT RDBMS MultiLoad Use the MultiLoad utility to maintain tables by: ‘© Inserting rows into a populated or empty table * Updating rows in a table 1g multiple rows from a table Toad multiple input files concurrently and work on up to five tables ata time, using multiple is optimized to apply multiple rows in block-level operations. MultiLoad usually is run sessions. Multi during a batch window, and places @ lock on on the destination table(s) to prevent user queries from getting consistent results before the data losd or update is complete, Use TPump to: © Constantly load data into a table © Continuously load, update, or delete data in tables ‘© Update lower volumes of data using fewer system resources than other load utilities Vary the resource consumption and speed of the data loading activity overtime ‘The TPump utility complements MultiLoad as a data loading utility. A major difference is that ‘Pump uses 7} row hash locks, which eliminates the need for table locks and "balch windows" typical with MultiLoad. Users can continue to run queries during TPump data loads. In addition, TPump is designed for smaller volumes of data than MuitiLoad, and maintains up to 60 tables ata time. ‘TPump has a dynamic throttle that operators can set to specify the percentage of system resources to be used for an operation, This enables operators to set when TPump should run at full capacity during low system ¢, ot within limits when TPump may affect other business users of Teradata. FastExport FSGS TBE a Use the FastExport utility o export data from 2 Grows, necking, cithor of the following to a file on a client ofotner | come 404s, naveee, platform wortgage, 4233, Lely xed oma, Sie rabl 986, Saoxt¥, savings, + View 22%, gu, kom, Fastlxport is data extract utility. It ae amen Te transfers large amounts of data using block sean take seca, asex, tansfers over muliple sessions to a host file rene Jon the network-attached or channel-attached Tan rasea soos weil ‘client. Typically, FastExport is run during a batch window, and the tables being exported are locked. ‘Teradata Warehouse Builder (TWB) isa data warehouse loading tool that enables data extraction, transformation and loading processes comrion to all data warehouses. Using built-in operators, Teradata Warehouse Builder combines the functionality ofthe Teradata utilities (Festl oad, MultiLoad, FastExport, and TPump) in a single parallel environment. Its extensible environment supports FastL.oad INMODs, FastExport OUTMODs, and Access Modules to provide access to all the data sources you use today, There isa set of open APIs (Application Progammer Interface) to add third party ot custom data transformation to Teradata Warehouse Builder scripts. Using multiple, parallel tasks, a single |] Teradata Warehouse Builder script can load data from disparate sources into the Teradata Database in the same job. 20 “Teradata Watchouse Builder is scalable and enables end-to-end parallelism, The previous versions of utilities, (like FastLoad) allow you to load data into Teradata in parallel, but with a single input stream, Teradata ‘Warchouse Builder allows you to run multiple instances ofthe extract, optional transformation, and load ‘operators. You can have as many loads as you have sourees in the samme job. With multiple sources of data ‘coming ftom multiple platforms integration is important in a paralfelenvironinent, © Teradata Warehouse Builder climinates the need for persistent storage. It stores data into data buffers so you no longer need to write data into flatfile. Since you don't need fat files, there is no longer @ 2GB file iit. ‘Tetadata Warehouse Builder provides a single, SQL-like scripting language, as well as a GUL to make soripting faster and easier. You can do the extract, some transformation, and loads all in one SQL-ike scripting language. Once the dynamics ofthe language are learned, you can perform multiple tasks with a single script, You can use script converters to convert scripts on existing systems for utilities (astl.oad, MultiLoad, FastExport, and TPump) to Teradata Warchouse Builder scripts. “aac @ “Brel Tyr oman ‘A single Teradata Warohouse Builder job can load data from multipt disparate souress into tho Teradata Database, es indicated by the green atrow. ‘Teradata Warchouse Builder Operators ‘The operators are components that "plug" ito the TWB infrastructure and actually perform the functions, ‘©The FastLoad INMOD and FasiBixport OUTMOD operators support the current FastLoad and Fasilixport INMODIOUTMOD featutes. +The Data Conneetor operator is an adapter forthe Access Module or non-Teradata files, ‘The SQL Select and Insert operators submit the Teradata SELECT and INSERT commands. “The Load, Update, Export and Stream operators are similar to the current FastLoad, MutiLoad, Fastixport and TPump utilities, but built forthe TWB parallel environment. ‘The INMOD and OUTMOD adapters, Data Connector operator, and the SQL Selee/nsert operator are _| included when you purchase the Infrastructure. The Load, Update, Export and Stream operators are purchased separately. To simplify these new concepts, let's compare the Teradata Warchouse Builder Operators with the classic titties that we just covered. Description [A consumer-iype operator that ues the Teradata lFastLoad protocol. Supports Error limits and Icheckpoint/ Resta. Both support Multi-Value |Compression and PPI [Gilizas the Teradata MulliLoad protocol o enable Muitttoad (H0® based tble updates. This allows highly salable! fond parallel inserts and updates toa pre-existing be producer operator that emulates the FestFxport bttty map __ [Uses multiple sessions to perform DML [STREAM [fFume _|fvansactons in near real-time, lexPoRT. [FastExport [This operator emulates the Data Connector API. | an IReads external data files, writes data to external lata files, reads an unspecified numberof data files. |DataConnector lopsc Administeative u “Teradata system, ‘The administrative utilities re: © Teradata Manager * Teradata Dynamic Query Manager (TDQM) © Teradata Analyst Pack ‘Teradata Manager is « production and performance monitoring system that helps a DBA or system manager to monitor, eontrol, and administer one or more Teradata systems through a GUI. Running on LAN-attached clionts, Teradata Manager has a variety of tools and applications to gather, manipulate, and analyze. information about each Teradata Database being administered, For examples of Teradata Manager functions, click here: Teradata Manager Examples ‘Teradata Dynamic Query Manager (TDQM), formerly known as Database Query Manager (DBQM), is a query workload management tool that dynamically tunes the Teradata Database. TDQM ean run, suspend, rected a jst query based on cure worMond and set ths For example, with TDQM a request can be scheduled to run periotfeally of during a specified time period ‘without an active system connection. Results can be retrieved any time after the request has been submitted by TDQM and executed, ‘TDQM can restrict querios-based on factors such as: © Analysis control thresholds ‘© Object control threshotds + Environmental factors Qr ‘Teradata Analyst Pack is a suite ofthe following products. Teradata Visual Explain ‘Teradata Visual Explain makes query plan analysis easier by providing the ability to capture and graphically represent the steps of the plan and perform comparisons of two or more plans. Itis intended for application developers, database administiators and database support personnel to better understand why the ‘Teradata Optimizer chooses a particular plan fora given SQL. query. All information required for query plan analysis such as database object definitions, data demographics and cost and cardinality estimates is available through the Teradata Visual Explain interface. The too! is very helpful in identifying the performance implications of data skew and bad or missing statistics. Visual Explain uses a Query Capture Database to store query plans which can then be visualized or manipulated with other Teradata Analyst Pack tools ‘Teradata System Emulation Tool (Teradata SET) ‘Teradata SET simplifies the task of emulating a target system by providing the ability o export and import all information necessary to fake out the optimizer in atest environment. This information can be used along, with Teradata's Target Level Emulation feeture to generate query plans onthe test system as if they were run con the target system, This feature is useful for verifying queries and reproducing optimizer related issues in a test environment ‘Teradata SET allows the user to capture the following by database, query, or workload: ‘© System cost parameters + Object definitions ‘© Random AMP samples Statistics Query execution plans ‘© Demographics This too! does not export user data, ‘Teradata Index Wizard ‘Teradata Index Wizard automates the process of manual index design by recommending secondary indexes for a particular workload: Teradata Index Wizard provides a simple, easy-to-use graphical user interface (GUI) that guides the user how to go about analyzing a database workload and provides recommendation for improving performance through the use of indexes. ‘Teradata Statisties Wizard ‘Teradata Statistics Wizard is a graphical tool that has been designed to automate the collection and re- collection of statisties, resulting in better query plans and helping the DBA to efficiently manage statistics. ‘The Statistics Wizard enables the DBA to: ‘© Specify a workload to be analyzed for recommenclations specific to improving the performance of the ‘queries in a workload. © Select an arbitrary database or selection of tables, indexes, or columns for analysis, collection, or re- collection of statistics. ‘As changes are mado within a database, the Statistics Wizard identifies those changes and recommends which tables should have statistics collected, based on age of data and table growth, and what columns/indexes ‘would benefit from having statistics defined and collected for a specific workload. The DBA is then given the |) opportunity to acceptor reject the recommendations, Archival Utilities ‘Teradata has utilities specifically designed for data archive and recovery purposes. There are diferent utilities for channel-attached clients and network-attached clients. Ina channel-attached (mainframe) client environment, the Archive Recovery (ARC) utility is used to back up data, It supports commands written in Job Control Language (ICL). The ARC utility archives and restores database objects, allowing recovery of data that may have been damaged or lost “There are several scenarios where restoring objects from external media may be necessaty: ‘© Restoring non-Fallback tables after a disk failure, ‘+ Restoring table that have been corrupted by batch processes that may have left the data in an ‘uncertain state 4 Restoring tables, views, oF macros that have been accidentally dropped by the user. «Miscellaneous user errors resulting in damaged or lost database objects. With the ARC utility you can copy a table and restore it to another Teradata Database. It is scalable and parallel, and can run on a channel-attached client (or network-attached client) or a node, Client (alntrame) OR In anetwork-attached client environment, the Archive Recovery (ARC) utility is used to back up data, along with ether ofthe following tape storage subsystems: + NetVault (Grom BakBone Software In.) + _ NetBackup (ftom VERITAS Software Corporetion) NetVault and NetBackup have modules created for Teradata systems for use in a scalable, parale, enterprise environment, They run on network-attached clients or a node (Microsoft Windows or UNIX MP-RAS). Data is backed up into the NetVault or NetBackup tape storage subsystems using the ARC utility 22 CBG OB rsa 6B OG) oe ian LD Data on Toradala ROBMS. ‘You can aceess these questions in several ways: ‘© Navigate to cach question direetly from this page. ‘© Navigate from one question to the next without returning to this page. Click Question 3.1 below to begin. ‘Note: The questions are not scored. Their purpose is to provide a review of the material and give immediate feedback to reinforce your learning, SL Exercise 3.2 Exercise 3.3 Bxoreise 3d Exercise 3.5 Exersise 3.6 Kxoreise 3.1 Exercise Processing a Request: Drag an icon from the group on the right to its correct position in the empty boxes on. the left. Correctly placed icons will stay where you put them. ‘To review this topic, click Request Processing. 3.2 Exercise Select the appropriate Teradata load or unload utility from the pull-down menus. TEs nabes constant loading (streaming of data into a table to keep data sh 7 {Edpata extract ality that exports data from a Teradata table and writes it toa host file. Flpaaes, inser, or deletes empty or populated tables (block level operation. loses paras processing to fond an empty abl “Eb eorms te ame function asthe UPDATE TWB oper. _-Mbperforms the same function as the STREAM TWB operator. Feedback: el To review these topics, lick FastLoad, MultiLoad, TPump, and EastExpon 3.3 Bxercise Move the software components requited for a channel connection into the appropriate blue squares. Correctly placed ‘components will stay where you put them, To review this topic, click Channel Atached Client 3.4 Exercise Which of the following statements are truc? (Choose three.) n a n o 5 B, NetVault and NetBackup are ullities used for network management. Feedback: e ‘To review these topics, click BTRO, Teradata SOL Assistant, Teradata Manager, TDOM, Archiving on Channel-Attached Clients, and Archiving on Network-Attached Clients. 3.5 Raercise ‘A. Teradata SQL Assistant and TDQM ate the two utilities used for Teradata system management B. TDQM ean reject a query based on current workload and set thresholds. ©, BTEQ suns on all elient platforms to access the Teradata Databese, 1D, Archive Recovery is used to copy and restore a table o another Teradata Database. Select the correct type of connection (network-attached client or channel-attached client) from the drop-down boxes below that corresponds othe listed software and hardware components. Breda Gteway nee oallertate Dieta Program TE csanrel Driver : sas lllenernet cus - “Bhnsintanc tos Feedback: eee To review this topic, Channel Attached Client or Network Attached 3.6 Exercise Select the correct Teradata Analyst Pack too! from the drop-down menus below. : Tl erites queries nd reproduces opine elated (uery plan) sues in atest environment, ar Brccommend one or noe Secondary Indexes fora table, pies a Quory Capture Database to store query plans. Baccommends and auomtes th States Collecson process. ‘To review this topic, click Teradata Analyst Pack, [Asay Objectives After completing this module, you should be able to: '¢ Define the role of SQL in accessing a relational database. List the types of SQL commands. © Describe the use of the SELECT and EXPLAIN statements, thitor rp. This module contains links to important supplemental course information. Please be sure to click on eah hotword link o cape alo the ting conten. ‘Teradata is accessed using SQL. (Structured Query Language). SQL is the industry standard access language for communicating with a relational database. SQL is a set-oriented language for relational database management. A user or application can use SQL. statements to perform operations on the data and define how fn answer set should be returned frora an RDBMS. Teradata supports two types of SQL: © ANSI SQL: Teradata SQL is compliant with ANSI standards (an industry standard), © Teradata SQL Extensions: NCR has added Teradata SQL extensions above and beyond standard SQL capabilities, including one-step SQL statements for complex administrative operations. Teradata SQL Benefits ‘Teradata SQL is the set of SQL commands used with the Teradata Database, Some benefits of Teradata SQL ‘© Parallel Execution - The Optimizer breaks up an SQL statement into tasks that can be executed in parallel to minimize resource contention. The design of the Teradata Database, along with its ‘automatic data distribution, balances the workload and reduces bottlenecks. ‘+ ANSI Compliant - Teradata SQL. is compliant with ANSI standards. If you have programs already ‘written with ANSI-compliant SQL. for a different relational database, you ean run them with ‘Teradata, as well, © High-Performance Extensions - NCR has added Teradata SQL extensions that are above and beyond the standard SQL capabilities, including one-step SQL statements for complex administrative ‘operations. | ‘Types of SQL Statements 5 SOL statements commosily are categorized as follows: + Data Definition Language (DDL) + Date Manipulation Language (DML) + Data Control Language (DCL) Data Definition Language (DDL) an Data Definition Language (DDL) is used to define and create Users, Databases, and the objects they contain ables, views, macros, triggers, and stored procedures). Examples: CREATE - Define a new Database, User, database object, or index. DROP - Remove an existing Database, User, database object, index, or statistics. ALTER - Change table structure and protection definition, or enable and disable triggers. ‘Data Manipulation Language (DML) is used to work with dat, including tasks such as inserting data into a table, updating an existing record, or performing queries, Examples: SELECT - Perform relational query functions (Select, Project, Intersect, Minus). INSERT - Place a new row into 8 table, UPDATE - Modify values in an existing row. DELETE - Remove a row from a table. 1 Union, Data Control Language (DCL) is used for administrative tasks such as granting and revoking pri | database objects or controlling ownership of those objects. GRANT - Give user privileges. REVOKE - Remove user privileges. GIVE - Transfer database ownership. The SELECT Statement ‘The sezecr statement isthe most commonly used SQL statement. It isa DML statment that allows you to retrieve data fiom one or more tables. In its most common form, you specify certain rows to be returned as shown, SELECT * FROM employee WHERE department number = 401; ‘The asterisk, "**, isa "wild card’ character. In this example, it specifies that wen the result is displayed, we ‘want to sc all the columns of the rows where the department number is 401. The rnow clause specifies from ‘which table in our database to retrieve the rows. The witae, clause acts as a filter that passes only rows :eeting the specified condition -- inthis case, rows of employees in department 401. NOTE: SQL does not require a trailing semicolon to end a statement, but the Basic Teradata Query (BTEQ) utility that can be used to enter SQL statements does, The semicolon is used in the examples, asi it were centered in BTEQ. s Ifyou do not specify a mune clause, the query would return all columns and all rows from the employee table, for example: SELRCT * FROM employee: MANAGER. ewpLover, MANAGER. peparTMENT. JOB LAST FIRST_ HIRE BIRTH SALARY_ NUMBER” PMELOVEE. NUMBER CODE NAME NAME DATE DATE” AMOUNT 1006 1019 301 312101 Stein John 761015 s3H015 2945000 1008 1018 301 312102 Kanleskd Carol. 770201 80517 2925000 100s oot 403431100 Ryan Loretia 761015 550910 3120000 04 ros 401 412101 Johnson Darlene 761015 4¢0423 3630000 1007 eos: 403 4003 801 401 Returning a Subset of Columns Instead of using the asterisk symbol to specify all columns, we could name speci comma: ‘SELECT 4432101 Villegas Amando 70102 370131 4970000 481100 ‘Trader James 760731 470619 3785000 columins separated by a employee_number shite_ date + last_name + fitst_name FROM — cmployee WHERE department number = 401; ‘Unsorted Results Results include the columns named in the SQL statement, The results are unsorted unless you specify that you ‘want them sorted ina certain way. How to retrieve ordered results is covered in the following section. ‘employee_number hire date tast_name firstname 1004 76NO/1S Johnson Darlene 1003 76/07/31 Trader James 1013, ‘77104101 Phillips Charles 1010 77103101 Rogers Frank 1022 79/03/01 Machado Albert 1001 T6106/18 Hoover William 1002 76107/31 Brown Alan ‘The ORDER BY Clause ‘To have your results displayed in a sorted order, use the oRoEH wy clause, for example: ‘ORDER BY hire_date; Sort Onder Using this example, results are returned in ascending order. Ifa sort order isnot specified, we get results in ascending order by default. To specify ascending or descending order, add asc ot nesc to the end of your ‘onoax sy clause, The following is an example of specifying the results in ascending order, SELECT — employee_number slast_name sfirst_name shire_date FROM employee WHERE — dopartment_number = 401 ORDER BY hite_date AS‘ © output 1001 1003 1002 1004 1010 1013 cemployee_pumber hire_ date 76106118 76107/31 76107131 76hOns TINIOL Tiara 79)03/01 lastname Hoover ‘Trader Brown Johnson Rogers Phillips Machado first_name Alan Darlene Frank Charles Albert as

You might also like