Tuesday, June 16, 2015

logical operators and range operators in sql

Retrieving Records that Match One or More Conditions Logical operators are used in the SELECT statement to retrieve records based on one or more conditions. While querying data, you can combine more than one logical operator to apply multiple search conditions. In a SELECT statement, the conditions specified in the WHERE clause is connected by using the logical operators.

The syntax for using logical operators in the SELECT statement is: 

SELECT column_list FROM table_name WHERE conditional_expression1 {AND/OR} [NOT] conditional_expression2 where, conditional_expression1 and conditional_expression2 are any conditional expressions.
 The three types of logical operators are:

OR :
 Returns a true value when at least one condition is satisfied. For example, the following SQL query retrieves records from the Department table when the GroupName is either Manufacturing or Quality Assurance:
 SELECT * FROM HumanResources.Department WHERE GroupName = 'Manufacturing' OR GroupName = 'Quality Assurance'

AND :

 Is used to join two conditions and returns a true value when both the conditions are satisfied. To view the details of all the employees of AdventureWorks who are married and working as a Production Technician –WC60, you can use the AND logical operator, as shown in the following query:
SELECT * FROM HumanResources.Employee WHERE Title = 'Production Technician - WC60' AND MaritalStatus = 'M'

NOT: 

Reverses the result of the search condition.
The following SQL query retrieves records from the Department table when the GroupName is not Quality Assurance:
SELECT * FROM HumanResources.Department WHERE NOT GroupName = 'Quality Assurance' The preceding query retrieves all the rows except the rows that match the condition specified after the NOT conditional expression.`


Retrieving Records That Contain Values in a Given Range Range operators retrieve data based on a range.

The syntax for using range operators in the SELECT statement is:

 SELECT column_list FROM table_name WHERE expression1 range_operator expression2 AND expression3
where,
expression1 , expression2 , and expression3 are any valid combination of constants, variables, functions, or column
- based expressions. range_operator is any valid range operator. Range operators are of the following types:


BETWEEN :

 Specifies an inclusive range to search. The following SQL query retrieves records from the Employee table where the number of hours that the employees can avail to go on a vacation is between 20 and 50:
 SELECT EmployeeID, VacationHours FROM HumanResources.Employee WHERE VacationHours BETWEEN 20 AND 50

NOT BETWEEN :

 Excludes the specified range from the result set. The following SQL query retrieves records from the Employee table where the number of hours that the employees can avail to go on a vacation is not between 40 and 50:
SELECT EmployeeID,VacationHours FROM HumanResources.Employee WHERE VacationHours NOT BETWEEN 40 AND 50





sql in where

WHERE

To retrieve selected rows based on a specific condition, you need to use the WHERE clause in the SELECT statement. Using the WHERE clause selects the rows that satisfy the condition. The following SQL query retrieves the department details from the Department table, where the group name is Research and Development:
 SELECT * FROM HumanResources.Department WHERE GroupName = 'Research and Development'

The syntax for using comparison operators in the SELECT statement is:

 SELECT column_list FROM table_name WHERE expression1 comparison_operator expression2
where, expression1 and expression2

SELECT EmployeeID, NationalIDNumber, Title, VacationHours FROM HumanResources.Employee WHERE VacationHours < 5


sql in arithmetic operations

Sometimes, you might also need to show calculated values for the columns. For example, the Orders table stores the order details such as OrderID, ProductID, OrderDate, UnitPrice, and Units. To find the total amount of an order, you need to multiply the UnitPrice of the product with the Units. In such cases, you can apply arithmetic operators . Arithmetic operators are used to perform mathematical operations, such as addition, subtraction, division, and multiplication, on numeric columns or on numeric constants . SQL Server supports the following arithmetic operations:





+ (for addition)
-(for subtraction)
 / (for division)
* (for multiplication)
 % (for modulo
-
the modulo arithmetic operator is used to obtain the remainder of two divisible numeric integer values) All arithmetic operators can be used in the SELECT statement with column names and numeric constants in any combination .

SELECT EmployeeID, Rate, Per_Day_Rate = 8 * Rate FROM HumanResources.EmployeePayHistory


SQL in select

SELECT statement.

The SELECT statement is used to access and retrieve data from a database.
The syntax of the SELECT statement is:
 SELECT [ALL | DISTINCT] select_column_list [INTO [new_table_name]] FROM {table_name | view_name} [WHERE search_condition] where , ALL is represented with an (*) asterisk symbol and displays all the columns of the table. DISTINCT specifies that only the unique rows should appear in the result set.
select_column_list is the list of columns or aggregate columns for which the data is to be listed. INTO creates a new table and inserts the resulting rows from the query into it. new_table_name is the name of the new table to be created. FROM table_name is the name of the table from which the data is to be retrieved. WHERE specifies the search condition for the rows returned by the query. search_condition specifies the condition to be satisfied to return the selected rows.

EX.

SELECT * FROM HumanResources.Employee 

Customizing the Display

 Sometimes, you may want to change the way data is displayed. For example, if the names of columns are not descriptive, you might need to change the default column headings by creating user
- defined headings.


 following ways:
 .
  1. SELECT 'Department Number'= DepartmentID, ' Department Name'= Name FROM HumanResources.Department 
  2. SELECT DepartmentID 'Department Number', Name ' Department Name' FROM HumanResources.Department 
  3. SELECT DepartmentID AS 'Department Number', Name AS ' Department Name' FROM HumanResources.Department 

you can use the concatenation operator 

. The concatenation operator is used to concatenate string expressions. It is represented by the + sign. To concatenate two strings, you can use the following query: SELECT 'snow ' + 'ball' The preceding query will display snowball as the output. 
The following SQL query concatenates the data of the Name and GroupName columns of the Department table into a single column: 
SELECT Name + ' department comes under ' + GroupName + ' group' AS Department FROM HumanResources.Department 











Saturday, June 13, 2015

Record-Based Logical Model

Record-Based Logical Model

Now that you are familiar with the ER model, which is an example of an object- based logical model, we will look at
other data models. The three types of record- based logical models are:




Hierarchical model : 

In this model, data is represented in the form of a tree, and relationships between the data are represented by links.

Network model : 

In this model, the data and relationships among them are represented in the form of records and links. It is similar to a hierarchical model. However, records in a database are represented graphically.

Relational model :

 In this model, the table in a database has a fixed length record with fixed number of attributes or fields. Of these three models, the relational model is the most popular

Subtypes and Supertypes

Subtypes and Supertypes

 A subtype is a subset of another entity.

For example, 

consider the entity COURSE. There are two types of COURSEs, semester and standalone. The entity, COURSE is the supertype, and SEMESTER and STANDALONE are the subtypes. There are some attributes that are common to both the subtypes, for example: “course code”, “name”, and “content”. STANDALONE courses have some attributes such as “duration” that do not belong to the subtype, SEMESTER. The SEMESTER subtype has some attributes such as “semester_no” that do not belong to the STANDALONE subtype

Types of Relationships

Types of Relationships 

There are the following types of relationships:




  1. One- to- One
  2. One- to- Many (or Many-to-One)
  3. Many-to-Many 

Object-Based Logical Model

Object- Based Logical Model


There are various object-based logical models, such as
Entity-Relationship (ER) model, object- oriented model, and binary model. The most widely used is the ER model. It is accepted as an ideal data model for the database design. Peter Chen introduced this model in 1976, and since then several people have added value to it.

The ER Model

 The ER model views the real world as a collection of objects or entities and the relationship among them. Chen introduced not only the ER model, but also a corresponding diagramming technique.

Entities 

Chen defined an entity as “a thing, which can be easily identified”. An entity is any object, place, person, or activity about which data is recorded. An entity can be categorized as entity type and entity instance. An entity type is a set of things that share common properties.

Relationships

 Chen defined a relationship as “an association among entities”. For example, there is a relationship between students and teachers. This relationship represents the fact that a teacher teaches several students and a student is taught by several teachers. This relationship could be named TEACH. 

RDBMS INTO

A Database Management System (DBMS) is software used to store and manage data. A DBMS stores data in databases and uses data models to show the various ways of managing data. A Relational Database Management System (RDBMS) is an advanced version of a DBMS that also defines the relationship between the various data values. This feature helps in managing and using data more efficiently than DBMS. This chapter introduces DBMS and describes the various types of data models. It explains the most widely used entity relationship model and discusses the various types of relationships among the entities. In addition, the chapter describes the various ways of accessing data by using relational operators and joins.

Database Management System

A database is a collection of logically related data. Data means known facts, which are meaningful and can be recorded. For example, names, telephone numbers, and addresses.

    DATA MODEL

A data model is a description of the data in a database. In addition, the data model describes the relationship among data, and any constraints that have to be defined on the
data. Data models can broadly be classified into the following categories:


Object- based logical model : Focuses on describing the data, the relationship among the data, and any constraints defined.
 Record- based logical model : Focuses on specifying the logical structuring of the database in the form of tables.

Thursday, April 16, 2015

c++

When we consider a C++ program, it can be defined as a collection of objects that communicate via invoking each other's methods. Let us now briefly look into what do class, object, methods and instant variables mean.
Object - Objects have states and behaviors.
Example: A dog has states - color, name, breed as well as behaviors - wagging, barking, eating. An object is an instance of a class.
Class - A class can be defined as a template/blueprint that describes the behaviors/states that object of its type support.
Methods - A method is basically a behavior. A class can contain many methods. It is in methods where the logics are written, data is manipulated and all the actions are executed.
Instant Variables - Each object has its unique set of instant variables. An object's state is created by the values assigned to these instant variables.
C++ Program Structure:
Let us look at a simple code that would print the words Hello World.
#include <iostream> 
using namespace std;
// main() is where program execution begins.
int main()
 {   cout << "Hello World";
 // prints Hello World 
  return 0;
 }
Let us look various parts of the above program:
The C++ language defines several headers, which contain information that is either necessary or useful to your program. For this program, the header <iostream> is needed.
The line using namespace std; tells the compiler to use the std namespace. Namespaces are a relatively recent addition to C++.
The next line // main() is where program execution begins. is a single-line comment available in C++. Single-line comments begin with // and stop at the end of the line.
The line int main() is the main function where program execution begins.
The next line cout << "This is my first C++ program."; causes the message "This is my first C++ program" to be displayed on the screen.
The next line return 0; terminates main( )function and causes it to return the value 0 to the calling process.

Wednesday, March 18, 2015

sql interview

What is DBMS ?
The database management system is a collection of programs that enables user to store, retrieve, update and delete information from a database.
 What is RDBMS ?
Relational Database Management system (RDBMS) is a database management system (DBMS) that is based on the relational model. Data from relational database can be accessed or reassembled in many different ways without having to reorganize the database tables. Data from relational database can be accessed using an API , Structured Query Language (SQL).
What is SQL ?
Structured Query Language(SQL) is a language designed specifically for communicating with databases. SQL is an ANSI (American National Standards Institute) standard.

What is SQL ?
Structured Query Language(SQL) is a language designed specifically for communicating with databases. SQL is an ANSI (American National Standards Institute) standard.
What is SQL ?
Structured Query Language(SQL) is a language designed specifically for communicating with databases. SQL is an ANSI (American National Standards Institute) standard.
 What are the different type of SQL's statements ?
This is one of the frequently asked SQL Interview Questions to freshers. SQL statements are broadly classified into three. They are
1.DDL – Data Definition Language
DDL is used to define the structure that holds the data. For example, Create, Alter, Drop and Truncate table.

2. DML– Data Manipulation Language
DML is used for manipulation of the data itself. Typical operations are Insert, Delete, Update and retrieving the data from the table. Select statement is considered as a limited version of DML, since it can't change data in the database. But it can perform operations on data retrieved from DBMS, before the results are returned to the calling function.

3. DCL– Data Control Language 
DCL is used to control the visibility of data like granting database access and set privileges to create tables etc. Example - Grant, Revoke access permission to the user to access data in database.







Tuesday, February 17, 2015

Tally Software is developed with a core proprietary engine with a SDK wrapper. Most of Tally's Interaction Forms and Reports are developed using Tally Definition Language (TDL).
Tally.ERP 9 has advanced integration capabilities in the form of Application programming interfaces to make the software extensible. Tally interacts with Software application using XMLODBC and DLL technologies.

Monday, February 16, 2015

EDUCATION
AUTOMOBILE
EVACUATION
REMUNERATION
REGULATION
MISBEHAVIOUR
AUTHORITIES
AUTHORIZE
AUTHENTICATION
PRECAUTION
MIRACULOUSNESS
MISDEMEANOUR
PREAMBULATION
AURIFEROUS
MENSURATION
TAMBOURINE
UNOSTENTATIOUS
UNOBJECTIONABLE
MULTIMILLIONAIRE
CONSEQUENTIAL
PRECARIOUS
WITH LOT OF LOVE
PIYUSHDADRIWALA
    


in word all vowels 

Monday, February 9, 2015

sql

SQL is a standard language for accessing and manipulating databases.

What is SQL?

  • SQL stands for Structured Query Language
  • SQL lets you access and manipulate databases
  • SQL is an ANSI (American National Standards Institute) standard

What Can SQL do?

  • SQL can execute queries against a database
  • SQL can retrieve data from a database
  • SQL can insert records in a database
  • SQL can update records in a database
  • SQL can delete records from a database
  • SQL can create new databases
  • SQL can create new tables in a database
  • SQL can create stored procedures in a database
  • SQL can create views in a database
  • SQL can set permissions on tables, procedures, and views

SQL is a Standard - BUT....

Although SQL is an ANSI (American National Standards Institute) standard, there are different versions of the SQL language.
However, to be compliant with the ANSI standard, they all support at least the major commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE) in a similar manner.
NoteNote: Most of the SQL database programs also have their own proprietary extensions in addition to the SQL standard!

Using SQL in Your Web Site

To build a web site that shows data from a database, you will need:
  • An RDBMS database program (i.e. MS Access, SQL Server, MySQL)
  • To use a server-side scripting language, like PHP or ASP
  • To use SQL to get the data you want
  • To use HTML / CSS

RDBMS

RDBMS stands for Relational Database Management System.
RDBMS is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.
The data in RDBMS is stored in database objects called tables.
A table is a collection of related data entries and it consists of columns and rows.

Sunday, January 25, 2015

internet

ques1. what is internet?
ans 1.   global computer network providing a variety of information and communication facilities, consisting of interconnected networks using standardized communication protocols.



year                                         
                                             
2003january 7, 2003 cren's members decided to dissolve the organization.
2003On June 30, 2003 the Safar browser is released.
2004On November 9, 2004 Mozilla releases the Mozilla Firefox browser.
2008On December 11, 2008 the Google Chrome. 

Thursday, January 8, 2015

ques

1.Eileen is planning a special birthday dinner for her husband's 35th birthday. She wants the evening to be memorable, but her husband is a simple man who would rather be in jeans at a baseball game than in a suit at a fancy restaurant. Which restaurant below should Eileen choose?
A.Alfredo's offers fine Italian cuisine and an elegant Tuscan decor. Patrons will feel as though they've spent the evening in a luxurious Italian villa.
B.Pancho's Mexican Buffet is an all-you-can-eat family style smorgasbord with the best tacos in town.
C.The Parisian Bistro is a four-star French restaurant where guests are treated like royalty. Chef Dilbert Olay is famous for his beef bourguignon.
D.Marty's serves delicious, hearty meals in a charming setting reminiscent of a baseball clubhouse in honor of the owner,Marty Lester, a former major league baseball all-star.