Exam Notes
Exam Notes
Exam Notes
RDBMS is the basis for SQL, and for all modern database systems such
as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.
If you want to create a table, you should name the table and define its column and each
column's data type.
The data type of the columns may vary from one database to another. For example,
NUMBER is supported in Oracle database for integer value whereas INT is supported
in MySQL.
Using Query Analyzer, you can execute queries and stored procedures and get a
visual display of the SQL Server execution plan.
Similar to Profiler, Query Analyzer is found in the SQL Server folder in the All
Program menu. It, too, requires that you complete the Connect to SQL Server dialog.
Once connected, you can type the following to switch to your database:
Copy
use [databasename]
Next, click the play button on the menu bar (or highlight the text and press F5).
Either option executes the highlighted SQL.
Analyzing a Query
To run the query in Query Analyzer, first paste the contents into Query Analyzer, then
go to the toolbar and select Query | Show Execution Plan. Next, highlight the SQL to
execute
Indexes are special lookup tables that the database search engine can use to speed
up data retrieval. Simply put, an index is a pointer to data in a table. An index in a
database is very similar to an index in the back of a book.
For example, if you want to reference all pages in a book that discusses a certain topic,
you first refer to the index, which lists all the topics alphabetically and are then referred
to one or more specific page numbers.
An index helps to speed up SELECT queries and WHERE clauses, but it slows down
data input, with the UPDATE and the INSERT statements. Indexes can be created or
dropped with no effect on the data.
Creating an index involves the CREATE INDEX statement, which allows you to name
the index, to specify the table and which column or columns to index, and to indicate
whether the index is in an ascending or descending order.
Indexes can also be unique, like the UNIQUE constraint, in that the index prevents
duplicate entries in the column or combination of columns on which there is an index.
String Functions
Function Description
ASCII Returns the ASCII code value for the leftmost character of a character expression.
CHAR Returns a character for an ASCII value.
CHARINDEX Searches for one character expression within another character expression and returns the starting
position of the first expression.
CONCAT Concatenates two or more string values in an end to end manner and returns a single string.
LEFT Returns a given number of characters from a character string starting from the left
LEN Returns a specified number of characters from a character string.
LOWER Converts a string to lower case.
LTRIM Removes all the leading blanks from a character string.
NCHAR Returns the Unicode character with the specified integer code, as defined by the Unicode standard.
PATINDEX Returns the starting position of the first occurrence of the pattern in a given string.
REPLACE Replaces all occurrences of a specified string with another string value.
RIGHT Returns the right part of a string with the specified number of characters.
RTRIM Returns a string after truncating all trailing spaces.
SPACE Returns a string of repeated spaces.
STR Returns character data converted from numeric data. The character data is right justified, with a specified
length and decimal precision.
STUFF Inserts a string into another string. It deletes a specified length of characters from the first string at the
start position and then inserts the second string into the first string at the start position.
SUBSTRING Returns part of a character, binary, text, or image expression
UPPER Converts a lowercase string to uppercase.
A data manipulation language (DML) is a computer programming language used for adding
(inserting), deleting, and modifying (updating) data in a database. A DML is often a
sublanguage of a broader database language such as SQL, with the DML comprising some
of the operators in the language. Read-only selecting of data is sometimes distinguished as
being part of a separate data query language (DQL), but it is closely related and sometimes
also considered a component of a DML; some operators may perform both selecting
(reading) and writing.
What is SQL?
Structured Query Language (SQL) is the standard language for data manipulation in a DBMS.
In simple words it’s used to talk to the data in a DBMS. Following are types of SQL Statements
Data Definition Language (DDL) allows you to create objects like Schemas, Tables in the
database
Data Control Language (DCL) allows you to manipulate and manage access rights on database
objects
Data Manipulation Language (DML) is used for searching, inserting, updating, and deleting
data, which will be partially covered in this programming tutorial.
What is Query?
A Query is a set of instructions given to the database management system. It tells any
database what information you would like to get from the database. For example, to
fetch the student name from the database table STUDENT, you can write the SQL
Query like this:
SELECT Student_name from STUDENT
SELECT: The select statement allows users to pull a selection from the database to
work with. You tell the computer what to SELECT and FROM where.
UPDATE: To change data that already exists, you will use the UPDATE statement. You
can tell the database to update certain sets of information and the new information
that should be input, either with single records or multiple records at a time.
INSERT: You can move data from one location to another by using the INSERT
statement.
DELETE: To get rid of existing records within a table, you use the DELETE statement.
You tell the system where to delete from and what files to get rid of.
Since SQL does not allow you to import or export data from outside sources, some
providers can store data and give you the tools to manipulate data for your business
needs.
A query execution/explain plan AKA execution plan is an ordered set of steps used to access
data in a SQL Server. It’s basically a map that SQL Server is drawing to the shortest ideally the
most efficient path to the data in our database. Such a plan is created when a query is
accepted by SQL Server and it’s coming from either an application or it’s coming from us
when testing query performance.
SQL Server’s query optimizer does an excellent job by generating a physical model of the
most efficient route to the data. If you’re a network guy like me, look at it as the number of
hops for packets through a network which data must pass between source and destination. It
shows how a query will be or was executed. You might be wondering why we need to know
all this internal stuff and the simple answer is that it gives us an insight into what’s
happening under the hood. More specifically, it tells us what part of a query costs the most
CPU time, reads/writes time AKA I/O and gives us the opportunity to fix slow performance
queries and to improve those times because, in the real world, we often need to manually
examine and tune the execution plans produced by the optimizer to get even better
performance.
Furthermore, these plans display helpful graphical information that shows how SQL Server is
accessing data; if it’s doing a full table scan vs full index scan vs index seek. This can be a
helpful performance optimization as index scans are generally performance-intensive
because they’re scanning the entire index. Full table scans are similar because they’re
scanning every single row in a table.
Statistics are an important part of the entire process as they help the query optimizer to
make the best guesses when accessing data. These statistics include information about
columns like: estimated number of rows, the density of pages on disk, available indexes to
use, etc. that the query optimizer uses to generate query plans. It’s essential to keep these
statistics up-to-date as the query optimizer will use them to enforce query plans. But this is
something that SQL Server does automatically and it also does an excellent job with default
settings too, so you don’t have to worry about this except to know that it’s an important
aspect.
The MDI applications act as the parent and child relationship in a form. A parent form
is a container that contains child forms, while child forms can be multiple to display
different modules in a parent form.
VB.NET has folowing rules for creating a form as an MDI form.
1. MidParent: The MidParent property is used to set a parent form to a child form.
2. ActiveMdiChild: The ActiveMdiChild property is used to get the reference of the
current child form.
3. IsMdiContainer: The IsMdiContainer property set a Boolean value to True that
represents the creation of a form as an MDI form.
4. LayoutMdi(): The LayoutMdi() method is used to arrange the child forms in the parent
or main form.
5. Controls: It is used to get the reference of control from the child form.
Let's create a program to display the multiple windows in the VB.NET Windows Forms.
An effective System Development Life Cycle (SDLC) should result in a high quality
system that meets customer expectations, reaches completion within time and cost
evaluations, and works effectively and efficiently in the current and planned
Information Technology infrastructure.
System Development Life Cycle (SDLC) is a conceptual model which includes policies
and procedures for developing or altering systems throughout their life cycles.
SDLC is used by analysts to develop an information system. SDLC includes the
following activities −
requirements
design
implementation
testing
deployment
operations
maintenance
Systems development is systematic process which includes phases such as planning,
analysis, design, deployment, and maintenance. Here, in this tutorial, we will primarily
focus on −
Systems analysis
Systems design
Systems Analysis
It is a process of collecting and interpreting facts, identifying the problems, and
decomposition of a system into its components.
System analysis is conducted for the purpose of studying a system or its parts in order
to identify its objectives. It is a problem solving technique that improves the system
and ensures that all the components of the system work efficiently to accomplish their
purpose.
Analysis specifies what the system should do.
Systems Design
It is a process of planning a new business system or replacing an existing system by
defining its components or modules to satisfy the specific requirements. Before
planning, you need to understand the old system thoroughly and determine how
computers can best be used in order to operate efficiently.
System Design focuses on how to accomplish the objective of the system.
System Analysis and Design (SAD) mainly focuses on −
Systems
Processes
Technology
What is a System?
The word System is derived from Greek word Systema, which means an organized
relationship between any set of components to achieve some common cause or
objective.
A system is “an orderly grouping of interdependent components linked together
according to a plan to achieve a specific goal.”
Text box controls allow entering text on a form at runtime. By default, it takes a single
line of text, however, you can make it accept multiple texts and even add scroll bars
to it.
Let's create a text box by dragging a Text Box control from the Toolbox and dropping
it on the form.
In this example, we create three text boxes and use the Click event of a button to
display the entered text using a message box. Take the following steps −
Drag and drop three Label controls and three TextBox controls on the form.
Change the texts on the labels to: Name, Organization and Comments,
respectively.
Change the names of the text boxes to txtName, txtOrg and txtComment,
respectively.
Drag and drop a button control on the form. Set its name to btnMessage and its
text property to 'Send Message'.
Click the button to add the Click event in the code window and add the following
code.
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) _
Handles MyBase.Load
' Set the caption bar text of the form.
Me.Text = "tutorialspont.com"
End Sub
You can populate the list box items either from the properties window or at runtime.
To add items to a ComboBox, select the ComboBox control and go to the properties
window for the properties of this control. Click the ellipses (...) button next to the Items
property. This opens the String Collection Editor dialog box, where you can enter the
values one at a line.
1
AllowSelection
Gets a value indicating whether the list enables selection of list items.
2
AutoCompleteCustomSource
Gets or sets a custom System.Collections .Specialized.StringCollection to use
when the AutoCompleteSourceproperty is set to CustomSource.
3
AutoCompleteMode
Gets or sets an option that controls how automatic completion works for the
ComboBox.
4
AutoCompleteSource
Gets or sets a value specifying the source of complete strings used for automatic
completion.
5
DataBindings
Gets the data bindings for the control.
6
DataManager
Gets the CurrencyManager associated with this control.
7
DataSource
Gets or sets the data source for this ComboBox.
8
DropDownHeight
Gets or sets the height in pixels of the drop-down portion of the ComboBox.
9
DropDownStyle
Gets or sets a value specifying the style of the combo box.
10
DropDownWidth
Gets or sets the width of the of the drop-down portion of a combo box.
11
DroppedDown
Gets or sets a value indicating whether the combo box is displaying its drop-
down portion.
12
FlatStyle
Gets or sets the appearance of the ComboBox.
13
ItemHeight
Gets or sets the height of an item in the combo box.
Forms have a built-in functionality that is always available without any programming
effort on your part. You can move a form around, resize it, and even cover it with
other forms. You do
ActiveX controls are COM components or objects you can insert into a Web page or
other application to reuse packaged functionality someone else has programmed.
You can use ActiveX controls developed for Visual Basic 6.0 and earlier versions to
add features to the Toolbox of Visual Studio.
The new control appears with the other tools in the Toolbox.
Note
You can use the Aximp utility to manually create an interop assembly for
ActiveX controls. For more information, see Aximp.exe (Windows Forms
ActiveX Control Importer).
See also
COM Interop
How to: Add ActiveX Controls to Windows Forms
Aximp.exe (Windows Forms ActiveX Control Importer)
Considerations When Hosting an ActiveX Control on a Windows Form
Troubleshooting Interoperability
Applications communicate with a database, firstly, to retrieve the data stored there and
present it in a user-friendly way, and secondly, to update the database by inserting,
modifying and deleting data.
Microsoft ActiveX Data Objects.Net (ADO.Net) is a model, a part of the .Net framework
that is used by the .Net applications for retrieving, accessing and updating data.
The data residing in a data store or database is retrieved through the data provider.
Various components of the data provider retrieve data for the application and update
data.
An application accesses data either through a dataset or a data reader.
Datasets store data in a disconnected cache and the application retrieves data
from it.
Data readers provide data to the application in a read-only and forward-only
mode.
Data Provider
A data provider is used for connecting to a database, executing commands and
retrieving data, storing it in a dataset, reading the retrieved data and updating the
database.
Why Everybody Is Discussing Customizing the environment vb help Customizing the environment
vb help Tips Customizing the environment vb help What You Should Do
Obtaining the most effective Customizing the environment vb help Customizing the environment
vb help Tips
Life is not meant to be mediocrity Customizing the environment vb help predictability. When you're
wondering what life is about, you're browsing for its Customizing the environment vb help. So lots
of people will certainly say that all their relationships are the specific same. Relationships with
people should be accumulated with time in order to construct trust Customizing the environment
vb help offer us time to find the reality about the individual.
You need to consistently sign in with your sensations to see whether you get on the appropriate
track. When it's handy for your mind, it's great for your company. Very easy, it just goes to say
that you haven't forgotten them! There's nothing else to it! Choose the space you will certainly use
Customizing the environment vb help begin to brainstorm Customizing the environment vb help.
The method you are able to send out the cash is dependent upon the facility. Maybe your objective
is paying attention Customizing the environment vb help recommending young people. You can
benefit from these Customizing the environment vb help to boost your photography.
To have the capability to reach your entire prospective demands a journey of self-discovery in your
inner-world to make understanding, knowledge Customizing the environment vb help strength to
help get rid of the barriers which may be obstructing you. If you believe you're not all set, it's
great. Most importantly, you deserve only the best! Bear in mind, everyone is different. There's
hope for everyone.
1
BackColor
Gets or sets the background color for the control.
2
BackgroundImage
Gets or set the background image for the TreeView control.
3
BackgroundImageLayout
Gets or sets the layout of the background image for the TreeView control.
4
BorderStyle
Gets or sets the border style of the tree view control.
5
CheckBoxes
Gets or sets a value indicating whether check boxes are displayed next to the
tree nodes in the tree view control.
6
DataBindings
Gets the data bindings for the control.
7
Font
Gets or sets the font of the text displayed by the control.
8
FontHeight
Gets or sets the height of the font of the control.
9
ForeColor
The current foreground color for this control, which is the color the control uses
to draw its text.
10
ItemHeight
Gets or sets the height of each tree node in the tree view control.
11
Nodes
Gets the collection of tree nodes that are assigned to the tree view control.
12
PathSeparator
Gets or sets the delimiter string that the tree node path uses.
13
RightToLeftLayout
Gets or sets a value that indicates whether the TreeView should be laid out from
right-to-left.
14
Scrollable
Gets or sets a value indicating whether the tree view control displays scroll bars
when they are needed.
15
SelectedImageIndex
Gets or sets the image list index value of the image that is displayed when a tree
node is selected.
16
SelectedImageKey
Gets or sets the key of the default image shown when a TreeNode is in a selected
state.
17
SelectedNode
Gets or sets the tree node that is currently selected in the tree view control.
18
ShowLines
Gets or sets a value indicating whether lines are drawn between tree nodes in
the tree view control.
19
ShowNodeToolTips
Gets or sets a value indicating ToolTips are shown when the mouse pointer
hovers over a TreeNode.
20
ShowPlusMinus
Gets or sets a value indicating whether plus-sign (+) and minus-sign (-) buttons
are displayed next to tree nodes that contain child tree nodes.
21
ShowRootLines
Gets or sets a value indicating whether lines are drawn between the tree nodes
that are at the root of the tree view.
22
Sorted
Gets or sets a value indicating whether the tree nodes in the tree view are sorted.
23
StateImageList
Gets or sets the image list that is used to indicat
A variable name:
Must begin with a letter
Can’t contain an embedded period or embedded type declaration character
Must not exceed 225 characters.
Must be unique within the same scope.
Explicit declaration
To declare variables and to allocate storage space the dim statement is used
as in the following:
Dim meters as Integer
Dim greetings as String
The first variable, meters will store as integer value such as 10 or 388, and
the second variable, greetings, will store a text such as “Happy Birthday”.
When the compiler finds as Dim statement, it creatures place holder by
reserving some space in memory and assigning a name to it. Each time this
name is used its subsequent statement, Visual Basic uses this area in
memory to read or set it value. For instance, when the following statement is
used.
Meters = 143
Visual Basic places the value 143 in the place holder reserved for the
variable meters. When the program asks for the value of this variable, Visual
Basic get it from the same area of memory.
Types of Variables
The type of a variable determines how to allocate storage space in the
computer’s memory to their values. All variables have that determines what
kind of data they can store.
Visual Basic recognizes the following types of variables:
Numeric
String
Variant
Date
Object
Elements of a System:
B provides three native toolbox controls for working with the file system:
the DriveListBox, DirListBox, and FileListBox. You can use these controls independently, or in
concert with one another to navigate the file system.
The DriveListBox control is a specialized drop-down list that displays a list of all the valid drives on
the user's system. The most important property of the DriveListBox is the Drive property, which is set
when the user selects an entry from the drop-down list or when you assign a drive string (such as
"C:") to the Drive property in code. You can also read the Drive property to see which drive has been
selected.
To make a DirListBox display the directories of the currently selected drive, you would set
the Path property of the DirListBox control to the Drive property of the DriveListBox control in
the Change event of the DriveListBox, as in the following statement:
Dir1.Path = Drive1.Drive
The DirListBox control displays a hierarchical list of the user's disk directories and subdirectories and
automatically reacts to mouse clicks to allow the user to navigate among them. To synchronize the
path selected in the DirListBox with a FileListBox, assign the Path property of the DirListBox to
the Path property of the FileListBox in the Change event of the DirListBox, as in the following
statement:
File1.Path = Dir1.Path
The FileListBox control lists files in the directory specified by its Path property. You can display all
the files in the current directory, or you can use the Pattern property to show only certain types of
files.
Similar to the standard ListBox and ComboBox controls, you can reference the List, ListCount,
and ListIndex properties to access items in a DriveListBox, DirListBox, or FileListBox control. In
addition, the FileListBox has a MultiSelect property which may be set to allow multiple file selection.
The sample program is a "Text File Viewer". The sample program uses the DriveListBox, DirListBox,
and FileListBox to allow the user to navigate his or her file system. When the user selects a file that
the program deems to be a "plain text" file, and that file is not "too large", the contents of that file is
displayed in a multi-line, scrollable textbox.
In the screen-shot below, the user has navigated to the directory "C:\Program Files\CesarFTP" and
selected the file "tests.txt" from that directory. The content of "tests.txt" is displayed in the multi-line
textbox: