Wednesday, July 31, 2019

Informatic Practile Grade 11 Cbse .

A Text Book on INFORMATICS PRACTICES CLASS XI Shiksha Kendra, 2, Community Centre, Preet Vihar, Delhi-110 092 India A text book on Informatics Practices, Class XI. PRICE : Rs. FIRST EDITION 2010 CBSE, India COPIES: â€Å"This book or part thereof may not be reproduced by any person or agency in any manner. † PUBLISHED BY : The Secretary, Central Board of Secondary Education, Shiksha Kendra, 2, Community Centre, Preet Vihar, Delhi-110092 DESIGN, LAYOUT : Multi Graphics, 5745/81, Reghar Pura, Karol Bagh, New Delhi-110005, Phone : 25783846 PRINTED BY : ii Foreword Information and Communication Technology has permeated in every walk of life affecting the technology fields such as launching satellites, managing businesses across the globe and also enabling social networking. The convergence of computer, communication and content technologies, being known as ICT, have attracted attention of academia, business, government and communities to use it for innovative profitable propositions. Year by year it is becoming simpler to use devices such as desktop, palm top, iPod, etc. 21st century is characterized with the emergence of knowledge based society wherein ICT plays a pivotal role. In its vision, the National Policy on ICT in School Education by MHRD, Govt. of India, states â€Å"The ICT policy in School Education aims at preparing youth to participate creatively in the establishment, sustenance and growth of a knowledge society leading to all around socio economic development of the nation and global competitiveness†. The policy envisages three stages of ICT implementations at school level – ICT literacy and Competency Enhancement, ICT enabled teachinglearning, and introduction of ICT related elective subjects at Senior Secondary level. With this backdrop a major paradigm shift is imperative in imparting ICT-enabled instructions, collaborative learning, multidisciplinary problem-solving and promoting critical thinking skills as envisaged in the National curriculum framework 2005. Foundation of these skills is laid at school level. Armed with such skills it is expected that a student will transform knowledge into easy to use systems to the ultimate benefit of the society at large. Syllabus of Informatics Practices has been revisited accordingly with a focus on generic concepts with domain specific practical experiments and projects to ensure conceptual knowledge with practical skills. The societal impact of ICT have been discussed. A new Unit on IT Applications has been added to enhance understanding of the above tools and techniques to solve real life problems by designing both front end and back end with proper data connectivity. Introduction of Open Standards and Open Source to promote Vendor Neutrality of tools. Creativity and Collaborative Learning/Programming is also an added feature. Specifically, a Unit on Networking and Open Standards is introduced in place of Business Computing. For IDE based programming, Java is introduced in place of VB. Relational Database Management System is dealt with using My SQL in place of SQL & PL/SQL using Oracle. The CBSE had been recommending different books in the past. With a total overhauling of the course on Informatics Practices it has ventured to bring out a comprehensive text book for all units for the first time. I am happy to release Part-1 of Informatics Practices for Class – XI. I would like to express my deep appreciation to the text book development team for their contribution and to the convener of the team, Prof. Om Vikas who aptly steered this activity. Appreciation is also due to Mrs. C Gurumurthy, Director (Academic) and Dr. (Smt) Srijata Das, Education Officer, for planning, coordinating and executing this initiative and bringing out this publication. It is hoped that all students and teachers will benefit by making best use of this publication. Their feedback will be highly appreciated for further improvement. VINEET JOSHI CHAIRMAN H l d d H d d x , H d H l lt l h d T d x l x d d l L d l td d d t p D l H l d h L l d h l d , d, l D d d h x d h , d l p d h 100 || ASkills>100 || GK>100) JOptionPane. showMessageDialog(this,†Re-Enter Marks (Out of 100)†); v if the marks input by the user for any of the subjects are greater than 100 Check or not an if they are then display the message â€Å"Re-Enter Marks (Out of 100). Since we have to display the error message if the marks of even one subject are out of limit so we have used the || operator which means OR. So in simple english it means if marks of English are >100 or marks of ASkills >100 or marks of GK > 100, then display the error message. So the message will be displayed even if only one condition evaluates to true. if (ASkills>=90 && GK>=90 ) { JOptionPane. showMessageDialog(this,†** Selected for Achiever's Award **†); jTextField6. setText(â€Å"*†); } 158 INFORMATICS PRACTICES Chapter-6 Control Structures v if the marks of ASkills and GK are both >= 90 or not. If they are then Check display the message â€Å"** Selected for Achiever's Award **† and also display a â€Å"*† in the text field. Since we have to check that both the marks should be greater than 90 so we have use the && operator which in simple English means AND. So the condition will evaluate to true only if both the conditions are satisfied. Let us now write the code for the Grade calculator application as shown in Figure 6. 38 private void jButton1ActionPerformed(java. awt. event. ActionEvent evt) { // Variable Declaration and assignment operations int Total,English,ASkills,GK; English=Integer. parseInt(jTextField1. getText()); ASkills=Integer. parseInt(jTextField2. getText()); GK=Integer. arseInt(jTextField3. getText()); //Validation of Entered Marks if (English>100 || ASkills>100 || GK>100) JOptionPane. showMessageDialog (this,†Re-Enter Marks (Out of 100)†); else { Total=English+ASkills+GK; jTextField4. setText(Integer. toString(Total)); jButton2. setEnabled(true); } } private void jButton2ActionPerformed(java. awt. event. ActionEvent evt) { // Variable Declaration and assignment operations ch ar Grade; int ASkills,GK,Total; ASkills=Integer. parseInt(jTextField2. getText()); GK=Integer. parseInt(jTextField3. getText()); Total=Integer. arseInt(jTextField1. getText()); INFORMATICS PRACTICES 159 Chapter-6 Control Structures //Decision for Achiever's Award if (ASkills;=90 && GK;=90 ) { JOptionPane. showMessageDialog (this,†** Selected for Achiever's Award **†); jTextField6. setText(â€Å"*†); } //Finding Grade if (Total;=80) jTextField5. setText(â€Å"A†); else if (Total;=70) jTextField5. setText(â€Å"B†); else if (Total;=60) jTextField5. setText(â€Å"C†); else if (Total;=50) jTextField5. setText(â€Å"D†); else jTextField5. setText(â€Å"E†); } private void jButton3ActionPerformed(java. awt. event. ActionEvent evt) { // To Exit from application System. exit(0); } Figure 6. 38 Code for the Grade Calculator Application Since in this application we had to test for multiple conditions in a if statement, so we had to join the conditions using some operators. Such conditions that are formed by joining simple conditions are called complex conditions and they are usually joined using the logical operators. Logical Operator A logical operator denotes a logical operation. Logical operators and relational operators are used together to form a complex condition. Logical operators are: 160 INFORMATICS PRACTICES Chapter-6 Control Structures Operator && || ! Use a;10 && b10 || bMySQL Command Line Client OR Goto the folder C:Program FilesMySQLMySQL Server 5. 1in as the drive having MySQL] And Click on the file MySQL. EXE MySQL will prompt a message to provide password (it requires the same password which was entered during the installation) Enter Password:**** Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 4 Server version: (GPL) 5. 0. 51a-community-nt MySQL Community Edition [Assuming C: drive Type ‘help;' or ‘h' for help. Type ‘c' to clear the buffer. Mysql; To exit from MySQL, type QUIT or EXIT Mysql;QUIT The above steps ensure successful installation and configuration of MySQL database server. Next time in the MySQL prompt, one can create and use databases, create tables and execute SQL queries. Downloading MySQL [Linux Environment]: Installation of the binary version of MySQL, release 4. 0. 20, to run on Linux is as follows: Installation file for MySQL may be downloaded from the link: INFORMATICS PRACTICES 203 Chapter-8 Introduction to MySQL http://dev. mysql. com/downloads/mysql/5. 1. tml#downloads (Choose appropriate download link as per the desired operating system) Create MySQL User Account: # cd /usr/local # groupadd mysql # useradd -c â€Å"MySQL Software Owner† -g mysql mysql # passwd mysql Changing password for user mysql. password: all authentication tokens updated successfully. Installing Binary Version: Unzip the files and change the directory to mysql # cd mysql # scripts/m ysql_install_db –user=mysql Preparing db table Preparing host table Preparing user table Preparing func table †¦ †¦ †¦ The latest information about MySQL is available on the web at http://www. ysql. com Support MySQL by buying support/licenses at https://order. mysql. com 204 INFORMATICS PRACTICES Chapter-8 Introduction to MySQL Start and Stop The Database Software: Starting the MySQL Database # su # cd /usr/local/mysql # bin/mysqld_safe –user=mysql & Starting mysqld daemon with databases from /usr/local/mysql/data Stopping the MySQL Database # su # cd /usr/local/mysql # bin/mysqladmin -u root shutdown 040803 23:36:27 mysqld ended [1]+ Done Know more Visit the following website to find a vast list of free and open source softwares available: http://en. wikipedia. rg/wiki/List_of_free_and_open_source_software_packages bin/mysqld_safe –user=mysql Summary A database is an organised collection of data. v Data vis stored in a relational database in one or more tables. A group v of rows and columns forms a Table. The horizontal subset of a Table is known as a Row/Tuple. v The vertical subset of a Table is known as a Column/Attribute. v A Candidate key is an attribute (or a set of attributes) that uniquely identifies a v row. A Primary Key is one of the candidate keys. Only v one of the Candidate keys is selected as the primary key of a table. All other candidate keys are called Alternate keys. INFORMATICS PRACTICES 205 Chapter-8 Introduction to MySQL Multiple Choice Questions 1. A relation can have only one ________ key and may have more than one _______ keys. a) b) c) d) 2. Primary, Candidate Candidate, Alternate Candidate, Primary Alternate, Candidate The vertical subset of a table is known as: a) b) c) d) Tuple Row Attribute Relation 3. If software is released under open source, it means: a) b) c) d) It is expensive. Its source code is available to the user. It belongs to a company. It is a DBMS. 4. Which of the following columns in a Student table can be used as the primary key? ) b) c) d) Class Section First Name Admission No 5. A tuple is also known as a ___________________________ . a) b) c) d) table relation row field INFORMATICS PRACTICES 206 Chapter-8 Introduction to MySQL 6. An attribute is also known as a_________________________. a) b) c) d) table relation row column 7. A field or a combination of fields in a table that has a unique value for each row is calle d: a) b) c) d) Candidate key. Foreign key. Main key. Alternate key. Exercises 1. Answer the following questions: a) Define the following terms: i) ii) Database Table iii) Primary key iv) v) b) c) d) e) f) 2. Candidate key Alternate key What is the relationship between a Database and a Table? What is DBMS? Write names of any two DBMSs. How is data organized in a table? What is a Primary key? What is its purpose in a table? What is MySQL? Distinguish between the following pairs a) b) Row and Column Primary key and Candidate key. INFORMATICS PRACTICES 207 9 Learning Objectives After studying this lesson the students will be able to: State vcategories of SQL statements. Create v a database Create v a table. Add rows to a table. v MySQL Retrieve v data in various ways from table using SELECT statement. Display v data in a sorted way using ORDER BY clause. Modify v data stored in a table. View v structure of a table Modify v structure of table Delete v rows from a table In the previous lesson, you have learnt that Relational Databases use tables to store data. A table simply refers to a two dimensional representation of data using columns and rows. MySQL lets us manipulate and manage these tables in an efficient way. We have learnt that MySQL is a Relational Database Management System. In this lesson we will learn about SQL (Structured Query Language). It is a Standard language used for accessing and manipulating relational databases. Ms. Sujata is a Class teacher of Class XI. She wants to store data of her students i. e. Names and marks secured, in a database. A database is used to house data in the form of tables. She uses a CREATE DATABASE statement to create a new database named School. 208 INFORMATICS PRACTICES Chapter-9 MySQL mysql; CREATE DATABASE School; Once the above mentioned statement gets executed, a database with the name School is created on her system. Now she has to open the database to work on it. For this USE statement is required. She opens the School database: Statement entered by user mysql; USE School; Database Changed Display by system Now, MySQL prompt can accept any query related to the database School. ! Semicolon is standard way to end SQL statement. Creating a table After creating a database, the next step is creation of tables in the database. For this CREATE TABLE statement is used. Syntax: CREATE TABLE ( , ,†¦ , ); Since Ms. Sujata is just learning, she initially creates a simple table named Learner with only two columns RollNo and Name in the School database. To do this, she enters the following statement: mysql; CREATE TABLE Learner ( RollNo INTEGER, Name VARCHAR(25) ); INFORMATICS PRACTICES 209 Chapter-9 MySQL v Give meaningful name to a table. If a table will store information about students, name it STUDENTS, not Abc or Person. vnames and column names are not case sensitive. For example, Table STUDENTS is treated the same as STuDents or students. We will study about the CREATE TABLE statement in detail later in this lesson. What if Ms. Sujata wants to see the names of all the tab les in the database? At any point of time, she can view names of all the tables contained in the current database by using SHOW TABLES statement as shown below: mysql; SHOW TABLES; +——————+ | Tables_in_school | +——————+ | Learner | ——————+ 1 row in set (0. 00 sec) Once the table named Learner is created, Ms. Sujata would like to add data of students in the table, which is also known as populating table with rows. To add row(s) in the table she uses the INSERT INTO statement: Syntax: INSERT INTO VALUES (,,†¦ ,); 210 INFORMATICS PRACTICES Chapter-9 MySQL She inserts 4 rows : mysql> INSERT INTO Learner VALUES (14,'Aruna Asaf Ali'); mysql> INSERT INTO Learner VALUES (12,'Tarun Sinha'); mysql> INSERT INTO Learner VALUES (16,'John Fedrick'); mysql> INSERT INTO Learner VALUES (10,'Yogi Raj Desai'); ! In INSERT statement: Character, date and Time data should be enclosed in Quotes. Numeric values should not be enclosed in quotes. Now that she has added 4 rows in the table, she wants to view the contents of the table. How can she do that? To view the contents of the table, she uses the following SELECT statement. In the simplest way, SELECT statement is used like this: Syntax: SELECT * FROM ; So, she types the statement: mysql; SELECT * FROM Learner; +—————————+ |RollNo | Name | +—————————+ | 14 | 12 | 16 | 10 | Aruna Asaf Ali | Tarun Sinha | John Fedrick | Yogi Raj Desai | | | | —————————+ In the above statement, FROM clause states which table to look in for data. Any time to know the database currently in use, the SELECT DATABASE() statement can be used. INFORMATICS PRACTICES 211 Chapter-9 MySQL mysql> SELECT DATABASE(); DATABASE() school 1 row in set (0. 0 sec) ! Statements in MySQL are not case sensitive. It means select DATABASE(); or SELECT DATABASE(); or SELECT database(); would all work the same way. Some Terminologies Keyword: A keyword refers to a special word that has a special meaning to SQL. For example, SELECT and FROM are keywords. Clause : A clause is a portion of an SQL statement. Each clause is identified by a keyword. For example, consider the statement SELECT name FROM Learner; Here SELECT name is a clause. SELECT is a statement as well as a clause. SELECT clause is everything from keyword SELECT until keyword FROM. SELECT statement is the entire command. FROM Learner is a FROM clause, which specifies the table from which data has to be selected. Statement : A statement is a combination of two or more clauses. For example, SELECT name FROM Learner; is a statement. 212 INFORMATICS PRACTICES Chapter-9 MySQL MySQL Data Types Well, before we learn more about making a table, there is one thing we need to understand first: Data Types. They indicate the type of data that you are storing in a given table column. So, what are the different Data Types available in MySQL? Here is a list of some of the most common ones and what type of values they hold: Class Text Data Type CHAR(size) Description A fixed-length string from 1 to 255 characters in length right-padded with spaces to the specified length when stored. Values must be enclosed in single quotes or double quotes. Example ‘Maths' â€Å"TexT† VARCHAR(size) A variable-length string from 1 to 255 characters in length; for example VARCHAR(25). Values must be enclosed in single quotes or double quotes. ‘Computer' â€Å"Me and u† Numeric DECIMAL(size,d) It can represent number with or without the fractional part. The maximum number of digits may be specified in the size parameter. The maximum number of digits to the right of the decimal point is specified in the d parameter INT Or INTEGER It is used for storing integer values. You can specify a width upto 11 digits. 17. 32 345 76 INFORMATICS PRACTICES 213 Chapter-9 MySQL Date DATE It represents the date including day, month and year It represents time. Format: HH:MM:SS Note: The supported range is from ‘-838:59:59' to ‘838:59:59' ‘2009-0702' TIME() TIME Categories of SQL Commands SQL commands can be classified into the following categories: 1. Data Definition Language (DDL) Commands The DDL part of SQL permits database tables to be created or deleted. It also defines indices (keys), specifies links between tables, and imposes constraints on tables. Examples of DDL commands in SQL are: v CREATE DATABASE – creates a new database v CREATE TABLE – creates a new table v TABLE – modifies a table ALTER v TABLE – deletes a table DROP 2. The Data Manipulation Language (DML) Commands The query and update commands form the DML part of SQL: Examples of DDL commands are: v SELECT – extracts data from a table v UPDATE – updates data in a table v DELETE – deletes data from a table v INSERT INTO – inserts new data into a table CREATE TABLE Ms. Sujata feels good that she has successfully created a table named Learner with 2 columns using CREATE TABLE statement. She now creates a table named Student with 214 INFORMATICS PRACTICES Chapter-9 MySQL four columns. When tables are created its columns are named, data types and sizes are supplied for each column. While creating a table at least one column must be specified. Syntax: CREATE TABLE (; column name; [ ], (; column name; [ ], †¦); Example: mysql; USE school; Database changed mysql; CREATE TABLE Student( Rollno INTEGER, Name VARCHAR(25), Gender CHAR(1), Marks1 DECIMAL(4,1)); Query OK, 0 rows affected (0. 16 sec) ! If table Student already exists in database school, then the error message â€Å"Table Student already exists† is displayed. Each column in the table is given a unique name. In the example above the column names are Rollno, Name etc. This doesn't mean each column that is named has to be unique within the entire database. It only has to be unique within the table where it exists. Also notice that the names do not use any spaces. !When naming tables and columns be sure to keep it simple with letters and numbers. Spaces and symbols are invalid characters except for underscore(_). Column names like first_name,last_name,email are valid column names. Viewing Structure of Table The DESCRIBE statement can be used to see the structure of a table as indicated in the Create Statement. It displays the Column names, their data types, whether Column must contain data ,whether the Column is a Primary key etc. INFORMATICS PRACTICES 215 Chapter-9 MySQL Syntax: DESCRIBE ; OR DESC ; mysql> DESCRIBE Student; Statement entered by user +——–+————–+——+—–+———+——-+ | Field | Type | Null | Key | Default | Extra | +——–+————–+——+—–+———+——-+ | Rollno | int(11) | Name | varchar(25) | YES | YES | YES | | | | | NULL | NULL | NULL | NULL | | | | | | | | Output shown by system | Gender | char(1) | Marks1 | decimal(4,1) | YES +——–+————–+——+—–+———+——-+ 4 rows in set (0. 01 sec) Ms. Sujata adds some rows in the Student table using the INSERT INTO statement: INSERT INTO Student VALUES (1,'Siddharth Sehgal','M',93); INSERT INTO Student VALUES (2,'Gurpreet Kaur','F',91); INSERT INTO Student VALUES (3,'Monica Rana','F',93); INSERT INTO Student VALUES (4,'Jatinder Sen','M',78); INSERT INTO Student VALUES (5,'George Jacob','M',76); INSERT INTO Student VALUES (6,'Deepa Bhandari','F',77); INSERT INTO Student VALUES (7,'Akshay Nath','M',65); Changing Structure of table When we create a table we define its structure. We can also change its structure i. e. add, remove or change its column(s) using the ALTER TABLE statement. Syntax: ALTER TABLE ADD/DROP [datatype]; ALTER TABLE MODIFY ; 216 INFORMATICS PRACTICES Chapter-9 MySQL Example: Ms. Sujata adds a column named Games. mysql> ALTER TABLE Student ADD Games VARCHAR(20); Now she wants to check the structure of the table to see that the new column Games is added. mysql> DESCRIBE Student; +——–+————–+——+—–+———+——-+ | Field | Type | Null | Key | Default | Extra | +——–+————–+——+—–+———+——-+ | Rollno | int(11) | Name | varchar(25) | YES | YES | YES | | | | | | NULL | NULL | NULL | NULL | NULL | | | | | | | | | | Gender | char(1) | Marks1 | decimal(4,1) | YES | Games | varchar(20) | YES +——–+————–+——+—–+———+——- + 5 rows in set (0. 00 sec) After execution of the above ALTER TABLE statement, the Games column is added and a NULL value is assigned to all the rows in this column. mysql> SELECT * FROM Student; +——–+——————+——–+——–+——-+ | Rollno | Name | | | | | | | 1 | Siddharth Sehgal 2 | Gurpreet Kaur 3 | Monica Rana 4 | Jatinder Sen 5 | George Jacob 6 | Deepa Bhandari 7 | Akshay Nath | Gender | Marks1 |M |F |F |M |M |F |M | | | | | | | 93. 91. 0 93. 0 78. 0 76. 0 77. 0 65. 0 | Games | | NULL | NULL | NULL | NULL | NULL | NULL | NULL | | | | | | | +——–+——————+——–+——–+——-+ +——–+——————+——–+——–+——-+ INFORMATICS PRACTICES 217 Chapter-9 MySQL Now, s uppose we want to change the newly added Games column to hold integers(in place of character data) using ALTER TABLE statement: mysql> ALTER TABLE Student MODIFY games INTEGER; To delete a column of a table the ALTER TABLE statement is used with Drop clause. Ms. Sujata deletes the Games column using the ALTER TABLE statement: mysql> ALTER TABLE Student DROP Games; mysql> DESC student; +——–+————–+——+—–+———+——-+ | Field | Type | Null | Key | Default | Extra | +——–+————–+——+—–+———+——-+ | Rollno | int(11) | Name | varchar(25) | YES | YES | YES | | | | | NULL | NULL | NULL | NULL | | | | | | | | | Gender | char(1) | Marks1 | decimal(4,1) | YES +——–+————–+——+—–+———+——-+ 4 rows in set (0. 00 sec) The above display shows that Games column is removed from the table. The word â€Å"DESC† can also be used in place of â€Å"DESCRIBE† Retrieving Information with SELECT Statement The SELECT statement is used to fetch data from one or more database tables. Retrieving Single Column Here is the syntax of SELECT statement to retrieve a single column from a table: Syntax: SELECT FROM ; 218 INFORMATICS PRACTICES Chapter-9 MySQL Example: Ms. Sujata wants to display Roll numbers of all her students. She uses the following statement: mysql> SELECT Rollno FROM Student; +———- + | Rollno | +———- + | | | | | | | 1 2 3 4 5 6 7 | | | | | | | ———- + 7 rows in set (0. 00 sec) Retrieving Multiple Columns We can display more than one column(s) from a table using SELECT statement: Syntax: SELECT , FROM ; Example: Now, Ms. Sujata displays two columns :Roll numbers and names of all the students. mysql> SELECT Rollno, Name FROM Student; +———- +——————+ | Rollno | Name | +———- +——————+ | | 1 2 | Siddharth Se hgal | Gurpreet Kaur | | 219 INFORMATICS PRACTICES Chapter-9 MySQL | | | | | 3 4 5 6 7 | Monica Rana | Jatinder Sen | George Jacob | Deepa Bhandari | Akshay Nath | | | | +———- +——————+ 7 rows in set (0. 00 sec) Changing the order of display of Columns We can display columns in any order by specifying the columns in that order in SELECT statement . The following statement displays Names first and then Roll numbers from the table Student. mysql> SELECT Name,Rollno FROM Student; +——————+——–+ | Name | Rollno | +——————+——–+ | Siddharth Sehgal | Gurpreet Kaur | Monica Rana | Jatinder Sen | George Jacob | Deepa Bhandari | Akshay Nath | | | | | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | ——————+——–+ 7 rows in set (0. 00 sec) In the Output, notice that the first column displaying names is left-justified and the second column displaying roll numbers is right justified. The format of output follows the pattern that character data is left justified and numeric data is right justified. 220 INFORMATICS PRACTICES Chapter-9 MySQL Retrieving all Columns To see all the columns of the table, we can write * in place of names of all the columns. The columns are displayed in the order in which they are stored in the table. Ms. Sujata uses the following statement to see all the columns of her table: mysql> SELECT * FROM Student; +——–+——————+——–+——–+ | Rollno | Name | Gender | Marks1 | +——–+——————+——–+——–+ | | | | | | | 1 2 3 4 5 6 7 | Siddharth Sehgal | Gurpreet Kaur | Monica Rana | Jatinder Sen | George Jacob | Deepa Bhandari | Akshay Nath |M |F |F |M |M |F |M | | | | | | | 93. 0 | 91. 0 | 93. 0 | 78. 0 | 76. 0 | 77. 0 | 65. 0 | +——–+——————+——–+——–+ 7 rows in set (0. 00 sec) ! The asterisk (*) means â€Å"All†. SELECT * means display all columns Eliminating duplicate values By default data is displayed from all the rows of the table, even if the data in the result is duplicated. Using the keyword DISTINCT, the duplicate values can be eliminated in the result. When DISTINCT keyword is specified, only one instance of the duplicated data is shown. The following query without the DISTINCT keyword shows 7 rows while the same query with DISTINCT keyword shows 6 rows as duplicate data 93 is displayed only once. INFORMATICS PRACTICES 221 Chapter-9 MySQL mysql> SELECT Marks1 FROM Student; +——–+ | Marks1 | +——–+ | | | | | | | 93. | 91. 0 | 93. 0 | 78. 0 | 76. 0 | 77. 0 | 65. 0 | 93 displayed twice +——–+ 7 rows in set (0. 00 sec) mysql> SELECT DISTINCT Marks1 FROM Student; +——–+ | Marks1 | +——–+ | | | | | | 93. 0 | 91. 0 | 78. 0 | 76. 0 | 77. 0 | 65. 0 | +——–+ 6 rows in set (0. 00 sec) 222 INFORMATICS PRACTICES Chapter-9 MySQL Retrieving Data From All Rows If we write the keyword ALL in place of DISTINCT, then the result of SELECT query displays all the values including duplicate values. The output is the same as what we get when we do not write DISTINCT keyword in the SELECT query. Using Arithmetic Operators with SELECT Arithmetic operators perform mathematical calculations. In SQL the following arithmetic operators are used: Operator + * / % What it does Addition Subtraction Multiplication Division Modulus (or remainder) Modulus operator (%) returns the remainder of a division. We can perform simple arithmetic computations on data using SELECT statement. Ms. Sujata thinks what if all my students had secured 5 marks more. She enters the following statement to display marks of all students increased by 5. mysql> SELECT Marks1+5 FROM Student; +———-+ | Marks1+5 | +———-+ | | | | | | | 98. 96. 0 98. 0 83. 0 81. 0 82. 0 70. 0 | | | | | | | +———-+ 7 rows in set (0. 02 sec) INFORMATICS PRACTICES 223 Chapter-9 MySQL Marks1 column is displayed increased by 5. The actual values are not increased in the table. Here are some more examples: mysql> SELECT Name,Marks1+0. 05*Marks1 FROM Student ; mysql> SELECT Name, Marks1-10 FROM Student ; mysql> SELECT Name,Marks1/2 FROM Student ; ! Using these operators on tables does not create new columns in the tables or change the actual data values. The results of the calculations appear only in the output. In the above examples, arithmetic calculations were based on Student table. Arithmetic calculations may not always be based on tables. For example when we want to compute 7*3+1, there is no table to be referenced. In such queries no FROM clause is used : mysql> SELECT 7*3+1; +——-+ | 7*3+1 | +——-+ | 22 | +——-+ 1 row in set (0. 09 sec) mysql> SELECT 71+34; +——-+ | 71+34 | +——-+ | 105 | +——-+ 1 row in set (0. 00 sec) 224 INFORMATICS PRACTICES Chapter-9 MySQL Using Column Alias Till now, we have seen that when the result of an SQL statement is displayed, the heading displayed at the top of column is same s the column name in the table or the arithmetic operation being done on the Column. While displaying marks from the table Student, Ms. Sujata wants the output to display a column heading (for Marks) that is easier to understand and is more meaningful and presentable like â€Å"Marks Secured† inste ad of Marks1. Column alias lets different name (heading) to appear for a column than the actual one in the output. She enters the statement like this: mysql> SELECT Marks1 AS â€Å"Marks Secured† FROM Student; +—————+ | Marks Secured | +—————+ | | | | | | | 93. | 91. 0 | 93. 0 | 78. 0 | 76. 0 | 77. 0 | 65. 0 | +—————+ 7 rows in set (0. 00 sec) Notice that the column Marks1 has been given the column heading â€Å"Marks Secured† . If a column alias consists of more than one word ,then it should be enclosed in quotes as in â€Å"Marks Secured†,otherwise error message is displayed. ! Using Column Alias does not rename a column. It simply displays a different column name in the output. The AS keyword between the column name and alias is optional. We can also write SELECT Marks1 â€Å"Marks Secured† FROM Student; INFORMATICS PRACTICES 225 Chapter-9 MySQL Putting text in Query output Can Ms. Sujata make the query output more presentable by inserting items such as symbols or text in the query output ? Yes. She can. She uses the following statement. mysql> SELECT Rollno,Name,'has secured marks',marks1 FROM student; +——–+——————+——————-+——–+ | Rollno | Name | has secured marks | marks1 | +——–+——————+——————-+——–+ | | | | | | | 1 | Siddharth Sehgal | has secured marks 2 | Gurpreet Kaur 3 | Monica Rana 4 | Jatinder Sen 5 | George Jacob 6 | Deepa Bhandari 7 | Akshay Nath | has secured marks | has secured marks | has secured marks | has secured marks | has secured marks | has secured marks | | | | | | | 93. 0 | 91. 0 | 93. 0 | 78. 0 | 76. 0 | 77. 0 | 65. 0 | +——–+——————+——————-+——–+ 7 rows in set (0. 00 sec) The text ‘has secured marks' is displayed with every row of the table. Retrieving specific rows – WHERE clause Tables usually contain many rows. Mostly, we do not want to display all the rows of a table. Certain rows can be displayed based on the criteria for selection of rows using the keyword WHERE. The WHERE clause is used to filter records. It is used to extract only those records that fulfill a specified criterion. Syntax: SELECT [, ,†¦. ] FROM WHERE ; Ms. Sujata wants to display the names and marks of all those students who have secured marks above 80, she enters: 226 INFORMATICS PRACTICES Chapter-9 MySQL mysql> SELECT Name,Marks1 FROM Student WHERE Marks1 > 80; +——————+———-+ | Name | Marks1 | +——————+———-+ | Siddharth Sehgal | Gurpreet Kaur | Monica Rana | | | 93. 91. 0 93. 0 | | | +——————+———-+ 3 rows in set (0. 00 sec) She thinks â€Å"What would be the marks of my students if they were increased by 5 for all those students who secured marks below 80? † She enters the statement : mysql> SELECT Name,Marks1+5 FROM Student WHERE marks1 < >= SELECT * FROM Student WHERE Marks1>=93; +——–+——————+——–+——–+ | Rollno | Name | Gender | Marks1 | +——–+——————+——–+——–+ | | 1 3 | Siddharth Sehgal | Monica Rana |M |F | | 93. 0 93. 0 | | +——–+——————+——–+——–+ 2 rows in set (0. 6 sec) ! When we use relational operators with character data type, < means earlier in the alphabet and > means later in the alphabet. ‘Aman' < ‘Ayan' as ‘m' comes before ‘y' in alphabet. Some more examples of queries involving relational expressions: mysql> SELECT Name,Marks1 FROM Student WHERE Marks1 SELECT * FROM Student WHERE Name = ‘Gurpreet Kaur'; mysql> SELE CT RollNo,Marks1 FROM Student WHERE Rollno SELECT RollNo,Marks1 FROM Student WHERE Rollno 3; mysql> SELECT RollNo,Marks1 FROM Student WHERE Name ‘Mani Kumar'; 228 INFORMATICS PRACTICES Chapter-9 MySQL Logical Operators OR, AND, NOT logical operators are used in SQL. Logical operators OR and AND are used to connect relational expressions in the WHERE clause. If any of the comparisons are true, OR returns TRUE. AND requires both conditions to be true in order to return TRUE. NOT negates a condition. If a condition returns a True value, adding NOT causes the condition to return a False value and vice versa. The symbol || can be used in place of OR, && can be used in place of AND, ! can be used in place of NOT operator. Ms. Sujata uses the following statement (with Logical operator AND) to display Roll numbers and names of students who have secured marks above 70 but below 80. mysql> SELECT Rollno, Name,Marks1 FROM Student WHERE Marks1 > 70 AND Marks1 < 80; +——–+—————-+——–+ | Rollno | Name | Marks1 | +——–+—————-+——–+ | | | 4 5 6 | Jatinder Sen | George Jacob | Deepa Bhandari | | | 78. 0 | 76. 0 | 77. 0 | +——–+—————-+——–+ 3 rows in set (0. 01 sec) Some example of SQL statements with Logical operators are shown below. ysql> SELECT Empnumber, EmpName FROM Employee WHERE Department = ‘Accoumts' OR Department = ‘Personnel'; mysql> SELECT Empnumber, EmpName FROM Employee WHERE Department = ‘Accoumts' AND Designation = ‘Manager'; mysql> SELECT Empnumber, EmpNa me FROM Employee WHERE NOT(Designation = ‘Manager'); mysql> SELECT Name,TotalMarks FROM Candidate WHERE writtenmarks>80 || Interviewmarks>10; SELECT Name,TotalMarks FROM Candidate WHERE writtenmarks>80 && Interviewmarks>10; INFORMATICS PRACTICES 229 Chapter-9 MySQL Using Parenthesis in WHERE clause Sometimes we have to write a criterion using a combination of AND and OR. The parentheses not only help us visually see how things are grouped together but they also let the DBMS know exactly what to do. SELECT * FROM Emp WHERE first_name='Amit' AND (last_name='Sharma' OR last_name='Verma'); So, how does that work? It simply states that we are looking for anyone with the first name as Amit and the last name as Sharma or Verma. They must have the first name as Amit but can have the last name as either Sharma or Verma. Condition based on Range The BETWEEN operator defines the range of values within which the column values must fall into to make the condition true. The range includes both the upper and lower values. Ms. Sujata uses the following statement to display roll numbers and marks of students who have secured marks in the range 70 to 80 (including 70 and 80). mysql> SELECT Rollno,Name,Marks1 FROM Student WHERE Marks1 BETWEEN 70 AND 80; +——–+—————-+——–+ | Rollno | Name | Marks1 | +——–+—————-+——–+ | | | 4 5 6 | Jatinder Sen | George Jacob | Deepa Bhandari | | | 78. 0 | 76. 0 | 77. 0 | +——–+—————-+——–+ 3 rows in set (0. 06 sec) The following statement displays roll numbers and marks of students who have secured marks other than the ones in the range 70 to 80(including 70 and 80). 30 INFORMATICS PRACTICES Chapter-9 MySQL mysql> SELECT Rollno,Name,Marks1 FROM Student WHERE Marks1 NOT BETWEEN 70 AND 80; ! BETWEEN displays all values between the lower and the upper va lues including the lower and the upper values. To display marks in the range 70 to 80, Ms. Sujata could have used the following statement to give the same output as the one using BETWEEN operator. mysql> SELECT Rollno,Name,Marks1 FROM Student WHERE Marks1>=70 AND Marks1 SELECT Rollno, Name, Marks1 FROM Student WHERE Marks1 IN (68,76,78); +————-+———————+————–+ | Rollno | Name | Marks1 | ————-+———————+————–+ | | 4 5 | Jatinder Sen | 78. 0 76. 0 | | | George Jacob | +————-+———————+————–+ 2 rows in set (0. 00 sec) In an Employee table, to display rows where State is ‘DELHI' or ‘MUMBAI' or ‘UP', we write the query like this: SELECT * FROM E mployee WHERE State IN (‘DELHI','MUMBAI','UP'); In an Employee table, to display all rows except those that have State as ‘DELHI' or ‘MUMBAI' or ‘UP', we write the query like this: INFORMATICS PRACTICES 231 Chapter-9 MySQL SELECT * FROM Employee WHERE State NOT IN (‘DELHI','MUMBAI','UP'); Till now Ms. Sujata's table Student has 7 rows. She wants to populate it with some more rows. She uses the following INSERT INTO statement. INSERT INTO Student VALUES (8,'Samdisha Sen','F',76); INSERT INTO Student VALUES (9,'Geeta Sen Sharma','F',91); INSERT INTO Student VALUES (10,'Geet Kadamb','M',66); INSERT INTO Student VALUES (11,'Aman Ali','M',92); INSERT INTO Student VALUES (12,'Ayan Ali','M',87); She checks that the table has the new rows inserted by using the following SELECT statement: SELECT * FROM Student; +——–+——————+——–+——–+ | Rollno | name | Gender | Marks1 | ——–+——————+——–+——–+ | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 | Siddharth Sehgal | | Gurpreet Kaur | Monica Rana | Jatinder Sen | George Jacob | Deepa Bhandari | Akshay Nath | Samdisha Sen | Geeta Sen Sharma | G eet Kadamb | Aman Ali | Ayan Ali | | | | | | | | | | | M F F M M F M F F M M M | | | | | | | | | | | | 93 91 93 78 76 77 65 76 91 66 92 87 | | | | | | | | | | | | +——–+——————+——–+——–+ 12 rows in set (0. 00 sec) 232 INFORMATICS PRACTICES Chapter-9 MySQL Condition based on pattern matches Sometimes while trying to remember somebody's name, you remember a part of his/her name but not the exact name. In such cases, MySQL has wildcards to help you out. % and _ are two wild card characters. The percent (%) symbol is used to represent any sequence of zero or more characters. The underscore (_) symbol is used to represent a single character. LIKE clause is used to fetch data which matches the specified pattern from a table. The LIKE clause tells the DBMS that we won't be doing a strict comparison like = or ; or ; but we will be using wildcards in our comparison. Syntax: SELECT , [†¦] WHERE LIKE Pattern [AND [OR]] ; For example, Ms. Sujata wants to display details of students who have their names ending with ‘Sen', she enters: mysql; SELECT * FROM Student WHERE Name LIKE ‘%Sen'; +——–+————–+——–+———-+ | Rollno | Name | Gender | Marks1 | +——–+————–+——–+———-+ | | 4 | Jatinder Sen | M 8 | Samdisha Sen | F | | 78. | 76. 0 | +——–+————–+——–+———-+ 2 rows in set (0. 00 sec) To display rows from the table Student with names starting with ‘G', she enters: mysql> SELECT * FROM Student WHERE Name LIKE †˜G%'; +——–+——————+——–+———-+ | Rollno | name | Gender | Marks1 | +——–+——————+——–+———-+ | 2 | Gurpreet Kaur |F | 91. 0 | 233 INFORMATICS PRACTICES Chapter-9 MySQL | | | 5 | George Jacob 9 | Geeta Sen Sharma 10 | Geet Kadamb |M |F |M | | | 76. 0 | 91. | 66. 0 | +——–+——————+——–+———-+ 4 rows in set (0. 02 sec) To display rows that have names starting with ‘G' and ending with ‘b', she enters: mysql> SELECT * FROM Student WHERE Name LIKE ‘G%b'; +———-+——————+————-+———–+ | Rollno | name | Gender | Marks1 | +———-+—â€⠀Ã¢â‚¬â€Ã¢â‚¬â€Ã¢â‚¬â€Ã¢â‚¬â€+————-+———–+ | | 5 10 | George Jacob | Geet Kadamb |M |M | | 76. 0 66. 0 | | +———-+——————+————-+———–+ 2 rows in set (0. 0 sec) To display rows from the table Student that have ‘Sen' anywhere in their names, she enters: mysql> SELECT * FROM Student WHERE Name LIKE ‘%Sen%'; +———-+——————+————-+———–+ | Rollno | name | Gender | Marks1 | +———-+——————+————-+———–+ | | | 4 8 9 | Jatinder Sen | Samdisha Sen | Geeta Sen Sharma |M |F |F | | | 78 76 91 | | | +———-+——————+—â₠¬â€Ã¢â‚¬â€Ã¢â‚¬â€-+———–+ 3 rows in set (0. 00 sec) 234 INFORMATICS PRACTICES Chapter-9 MySQL To display rows that have names starting with ‘A' and then having any 4 characters and ending with ‘Ali', she uses underscore wild card like this: mysql; SELECT * FROM Student WHERE Name LIKE ‘A_ _ _ _ Ali'; +———-+——————+————-+———–+ | Rollno | name | Gender | Marks1 | +———-+——————+————-+———–+ | | 11 12 | Aman Ali | Ayan Ali |M |M | | 92. 0 87. 0 | | +———-+——————+————-+———–+ 2 rows in set (0. 00 sec) Some more examples ‘Am%' matches any string starting with Am. %Singh%' matches any string containing ‘Singh' ‘%a' matches any string ending with ‘a' ‘_ _ _' matches any string that is exactl y 3 characters long. ‘_ _ %' matches any string that has at least 2 characters. ‘_ _ _ g' matches any string that is 4 characters long with any 3 characters in the beginning but ‘g' as the 4th character. The keyword NOT LIKE is used to select the rows that do not match the specified pattern. To display rows from the table Student that have names not starting with ‘G', she enters: mysql> SELECT * FROM Student WHERE Name NOT LIKE ‘G%'; Precedence of Operators All the operators have precedence. Precedence is the order in which different operators are evaluated in the same expression. When evaluating an expression containing INFORMATICS PRACTICES 235 Chapter-9 MySQL multiple operators, operators with higher precedence are evaluated before evaluating those with lower precedence. Operators with equal precedence are evaluated from left to right within the expression. Parenthesis can be used to change the preference of an operator. Various operators in descending order of precedence (top to bottom) are listed below: ! (unary minus) ^ *, /, DIV, %, MOD -, + =, , ;=, ;, INSERT INTO Student(Rollno,Marks1) VALUES (14,45); Query OK, 1 row affected (0. 05 sec) Since values are provided only for Roll number and marks, Ms. Sujata uses the SELECT statement and notices the word NULL displayed for Name and Gender for Roll number 14 : mysql; SELECT * FROM Student WHERE Rollno =14; +——–+——+——–+———-+ | Rollno | name | Gender | Marks1 | +——–+——+——–+———-+ | 14 | NULL | NULL | 45. 0 | +——–+——+——–+———-+ 1 row in set (0. 0 sec) Explicitly Inserting NULL Values We have learnt that if a column can hold NULL values, it can be omitted from the INSERT INTO statement. INSERT INTO statement will automatically insert a null value in that column. This is called Implicitly inserting a NULL value. mysql> INSERT INTO Student(Rollno,Name,Gender) Values(15,'Charvi Chanana','F'); Query OK, 1 row affected (0. 11 sec) In the above INSERT INTO statement Marks1 column is omitted, therefore NULL value will be inserted for it. We can also explicitly add NULL value by using the NULL keyword in the VALUES list for those columns that can hold null values. ysql> INSERT INTO Student Values(14,'Siddharth Sehgal','M',NULL); Query OK, 1 row affected (0. 11 sec) 242 INFORMATICS PRACTICES Chapter-9 MySQL ! A NULL value means no value has been entered for that column i. e. the value for that column is not known. Inserting Date Values The default way to store a date in MySQL is with the type DATE. Below is the format of a DATE. YYYY-MM-DD To insert the current date into a table, MySQL's built-in function CURDATE() can be used in the query. Following are some examples of inserting date values. ysql> INSERT INTO my_table (idate) VALUES (19970505); mysql> INSERT INTO my_table (idate) VALUES ('97-05-05†²); mysql> INSERT INTO my_table (idate) VALUES (‘1997. 05. 05'); mysql> INSERT INTO my_table (idate) VALUES (‘0000-00-00'); ! While Inserting data: v Text values must be enclosed in quotes. v Standard date format is â€Å"yyyy-mm-dd†. v Standard time format is â€Å"hh:mm:ss†. v are required around the standard date and time formats. Quotes UPDATE STATEMENT In the table student, Ms. Sujata entered a student's marks as 93. Suppose, that student found out that one of her answers was unchecked and got her marks increased by 1. How would Ms. Sujata change it in the table? She can use the UPDATE statement to modify existing data in the table. (a) Syntax: UPDATE SET = , [ = , †¦] [WHERE ]; INFORMATICS PRACTICES 243 Chapter-9 MySQL The statement can be used to update one or more columns together. WHERE clause helps in updation of particular rows in a table. The following statement sets the marks(Mark1) of all the rows to 94. UPDATE Student SET Marks1 = 94; The following statement sets the marks(Mark1) of the row with name as ‘Monica Rana' to 94. ysql; UPDATE Student SET Marks1 = 94 WHERE name = ‘Monica Rana'; Query OK, 1 row affected (0. 03 sec) Rows matched: 1 Changed: 1 Warnings: 0 The marks displayed from the table shows 94 marks now: mysql; SELECT Name,Marks1 FROM Student WHERE Name = ‘Monica Rana'; Output: +—————+——–+ | Name | Marks1 | +—————+——–+ | Monica Rana | 94 | +—————+——–+ 1 row in set (0. 00 sec) What if Ms. Sujata wants to change the name and marks both at the same time? Multiple columns can also be updated at one time. The following statement changes the name to â€Å"Chhavi Chanana† and Marks to 90 for the roll number 15. mysql; UPDATE Student SET name = ‘Chhavi Marks1= 90 WHERE Rollno = 15; Output: Query OK , 1 row affected (0. 8 sec) 244 INFORMATICS PRACTICES Chanana', Chapter-9 MySQL DELETE STATEMENT Sometimes students leave school or an employee leaves an organization. Their rows have to be deleted from the table. Deleting data from a table is very simple. DELETE statement is used to delete rows from a table. DELETE removes the entire row, not the individual column values. Care must be taken while using this statement as accidentally important data may get deleted. Syntax: mysql; DELETE FROM ; tablename; [ Where ; condn;]; One of the students with Roll number 14 has left the school and Ms. Sujata wants to delete his/her row. She uses the following statement to delete the row with roll number 14. mysql; DELETE FROM Student WHERE Rollno = 14; Query OK, 1 row affected (0. 03 sec) DELETE statement can be used to delete all rows of the table also . The following statement can be used to delete all the rows from Student table. ysql; DELETE from Student; mysql ; Select * FROM Student; +——–+———+——–+——-+ |Rollno | | Name | | Gender |Marks1 | | | | +——–+———+——–+——-+ +——–+———+——–+——-+ 0 row in set (0. 01 sec) Know more The MySQL databas e management system contains an enormous amount of functionality and power. Using a simple set of statements for inserting, retrieving, deleting and updating data, we can develop quite a useful set of databases and tables. To learn more about MySQL you may visit the website: http://www. mysqltutorial. org INFORMATICS PRACTICES 245 Chapter-9 MySQL Summary 1. 2. 3. 4. 5. 6. 7. 8. CREATE DATABASE statement is used to create a new database. CREATE TABLE statement is used to create a new table. INSERT INTO statement is used to insert a new row in a table. The SELECT statement is used to fetch data from one or more database tables. SELECT * means display all columns. The WHERE clause is used to select specific rows. The DESCRIBE statement is used to see the structure of a table. We can change the structure of a table ie. add, remove or change its column(s) using the ALTER TABLE statement. The keyword DISTINCT is used to eliminate redundant data from display. a) Logical operators OR and AND are used to connect relational expressions in the WHERE clause. Logical operator NOT is used to negate a condition. 9. 10. (b) 11. The BETWEEN operator defines the range of values that the column values must fall into to make the condition true. The IN operator selects values that match any value in the given list of values. % and _ are two wild card characters. The percent (%) symbol is used to represent any sequence of zero or more characters. The underscore (_) symbol is used to represent a single character. NULL represents a value that is unavailable, unassigned, unknown or inapplicable. The results of the SELECT statement can be displayed in the ascending or descending order of a single column or columns using ORDER BY clause. UPDATE statement is used to modify existing data in a table. DELETE statement is used to delete rows from a table. 12. 13. 14. 15. 16. 17. 246 INFORMATICS PRACTICES Chapter-9 MySQL Multiple Choice questions 1. Which statement is used to extract data from a table? A. B. C. D. 2. SELECT DISPLAY READ EXTRACT How do you select all the columns from a table named â€Å"Employee†? A. B. C. D. SELECT [all] FROM Employee; SELECT Employee; SELECT * BY Employee; SELECT * FROM Employee ; . How do you select a column named â€Å"IName† from a table named â€Å"Inventory†? A. B. C. D. SELECT Inventory FROM Iname; DISPLAY Iname SELECT Iname FROM Inventory; FROM Inventory; SELECT Iname, Inventory FROM Iname; 4. Which of the following are valid column names? A. B. C. D. Marks Eng 66_Marks Marks_Eng #Eng_Marks 5. SELECT statement can be use d to perform these functions. A. B. C. D. Insert rows into a table. Choose and display columns from a table. Modify data in a table. Select and display structure of a table INFORMATICS PRACTICES 247 Chapter-9 MySQL 6. Which statement is used to insert new data in a table? A. B. C. D. ADD RECORD INSERT RECORD INSERT INTO INSERT ROW 7. How would you display all those rows from a table named â€Å"Friends† where the value of the column â€Å"Hobbies† is â€Å"SWIMMING† A. B. C. D. SELECT ALL FROM Friends WHERE Hobbies IS ‘SWIMMING'; SELECT * FROM Friends WHERE Hobbies='SWIMMING'; SELECT * FROM Friends WHERE Hobbies = ‘Swimming† ; SELECT ALL FROM Friends WHERE Hobbies ‘SWIMMING' ; 8. Which statement is used to modify data in a table? A. B. C. D. CHANGE MODIFY UPDATE SAVE AS 9. Which SQL statement is used to delete data from a table? A. B. C. D. DELETE DROP TRUNCATE REMOVE 10. How do you select all the rows from a table named â€Å"Student† where the value of the column â€Å"FName† starts with â€Å"G†? A. B. C. D. SELECT * FROM Student WHERE FName LIKE ‘G_' ; SELECT * FROM Student WHERE FName='G'; SELECT * FROM Student WHERE FName LIKE ‘G%' ; SELECT * WHERE Student WHERE FName='%G%' ; INFORMATICS PRACTICES 248 Chapter-9 MySQL 11. The OR operator displays a record if ANY of the conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true A. B. False True 12. Which keyword is used to return only different values in a column? A. B. C. D. DIFFERENT EXCLUSIVE DISTINCT UNIQUE 3. Which SQL keyword(s) is/are used to sort the rows in the output: A. B. C. D. SORTED ORDER SORT SORT BY ORDER BY 14. How would you return all the rows from a table named â€Å"Item† sorted in descending order on the column â€Å"IName†? A. B. C. D. SELECT * FROM Item SORT ‘IName' DESC; SELECT * FROM Item ORDER BY IName DESC ; SELECT * FROM Item ORDER IName DESC ; SELECT * FROM Item SORT BY ‘IName' DESC ; 15. How can you insert a new row into the â€Å"Store† table? A. B. C. D. INSERT (1,'Abc Rice') INTO Store; INSERT VALUES (1,'Abc Rice') INTO Store ; INSERT INTO Store VALUES (1,'Abc Rice'); ADD ROW Store values(1,'Abc Rice'); INFORMATICS PRACTICES 249 Chapter-9 MySQL 16. Which statement is appropriate to change the first name â€Å"Madhur† to â€Å"Mridul† in the â€Å"FName† column in the ‘Student' table? A. B. C. D. UPDATE Student SET FName='Mridul' WHERE FName='Madhur' ; MODIFY Student SET FName='Madhur' INTO FName='Mridul ; UPDATE Student SET FName='Madhur' INTO FName='Mridul' ; UPDATE Student SET FName='Madhur' WHERE FName='Mridul' ; 17. How can you delete the rows with marks below 33 in the ‘Student' Table? A. B. C. D. DELETE FROM Student WHERE marks

Tuesday, July 30, 2019

Presence of Symbolism Imagery in Who’s Afraid of Virginia Woolf Essay

The Presence of Baby Symbolism in Who’s Afraid of Virginia Woolf? Who’s Afraid of Virginia Woolf? by Edward Albee is packed with baby imagery. Albee seems to add an image of a baby to almost every page of the play. The reason for this type of imagery is to symbolize babies, which has great importance throughout the course of the play because it connects with the characters and themes in the novel. The direct repetition of the word â€Å"baby† becomes very apparent at the beginning of the play and stays consistent throughout. George and Martha call each other â€Å"baby† numerous times. â€Å"Let me tell you a secret, baby† (p.29) is just one of the many instances where George calls Martha â€Å"baby† and vice versa. Martha tends to use baby talk when speaking with George, especially when she’s begging him for a drink. In addition, Martha and George also like to refer to Nick and Honey as children. They treat them with an attitude as if they were little kids in their house. An example of this is when George greets Nick and Honey with â€Å"you must be our little guests† (p.20) while Martha directly says â€Å"c’mon in, kids† (p.20) to the couple. George continues to use baby imagery towards the guests, especially when he’s describing Honey on the bathroom floor. â€Å"Peaceful†¦so peaceful. Sound asleep†¦and she’s actually†¦sucking her thumb†¦.rolled up like a fetus, suckling away† (p.184) demonstrates how George uses a baby-like diction when describing Honey. Honey is even described as â€Å"slim-hipped† (p.44) a few times in the play, suggesting that she can’t bear children, giving the reader an imagery of pregnancy. Babies are one of the most dominant symbols in the play. Both couples have had pretend children in their lives. Honey had a hysterical pregnancy, giving Nick the sense of being forced into marrying her. However, Honey’s pregnancy was just made up in her mind, and the reason for that is because she truly wants a child of her own. This becomes apparent when she cries â€Å"I want a child, I want a baby!† (p.236). George and Martha’s child is made up as well, because they’re incapable of having children but most importantly, to fill the void in their lives. They’re covering up their marriage with the illusion of this child of theirs because they can’t handle to face the solitude that overcomes their pathetic lives. Then George decides to â€Å"kill† their son, and Martha is completely devastated. The last few lines of the play reveal that Martha is truly afraid of living without illusion, which was her son. The symbolism of babies parallels a few themes in the play. The â€Å"Visions of America† theme is present since the reason why both couples want a baby is so that the child can bring meaning to their lives as well as finalize the missing piece of the puzzle to the American Dream. The baby imagery also connects with the theme of â€Å"Marriage† by suggesting that a baby will create a successful marriage for both the couples. Nick married Honey because of her hysterical pregnancy, and now it’s almost as if they’re stuck with each other with no passion present. George and Martha have been married for a long time now, and their marriage started out with love but now they seem bitter and unhappy, and the reason for that could be because they have no child present in their lives. Nevertheless, the symbol of babies connects greatly with the theme of â€Å"Illusion vs. Reality.† The son was just an illusion for George and Martha because they were incapable of having a child and facing the reality of their lonely lives. Babies symbolize a various amount of things in Who’s Afraid of Virginia Woolf?, such as truth, illusion, happiness and even the American Dream. The lives of both couples have changed drastically over the illusion of babies, even when they don’t have any yet. Honey’s hysterical pregnancy landed her in a marriage with Nick that didn’t start out with love and passion. George and Martha have been masking the truth of their lives with their son for a long period of time. This has caused damage to their lives, and now they’re going to have to make some changes in order to face the hard desolate lives that they’ve been trying so hard to escape from. The message that Edward Albee is trying greatly to convey is that human beings must learn to live life without illusion obstructing the view, that way human beings can live their lives with full honesty.

Monday, July 29, 2019

Technology Management Term Paper Example | Topics and Well Written Essays - 1250 words

Technology Management - Term Paper Example In this paper, the impacts of technology on; cost of business, human resources and customer satisfaction will be examined with the intention of establishing its import in the aforementioned sectors. Many organizations are to a large extent dependent on computers to handle their administrative tasks such as inventories bookkeeping and other clerical tasks which were traditionally handled exclusively by personnel. The advent of the internet as well as growth in the diversity and capacity of computing hard and soft ware has significantly reduced the cost of doing business; computer are increasingly becoming more powerful and cheaper to run due to the exponential growth in innovation. In addition, business owners and other entrepreneurs are better able to understand the cash flow and manage their storage and other running costs better ultimately saving time and money. For instance, today with only a laptop, one can open a business or even run a company without requiring to rent office sp ace or hiring employees, the computer can store all the information they need and they can use it to communicate with customers, suppliers as well as carrying out product promotion. The availability of online marketing and sales means one can order and ship goods from point A to point B in the comfort of their home. Furthermore, technology reduces the need for human resource since a computer can carry out tasks that were traditionally done by employees thus further reducing the cost of starting and running a business. The use of bookkeeping software such as QuickBooks and automated sales functions such as sales force allows business owners and managers to focus of strategy by cutting down the running costs and labour expenses. Technology also provides means through which to cut indirect costs, these include cost of commuting which can be scaled down since with the option of telecommuting , one can work from home. Ergo, they will not only save on fuel costs but also reduce the amount of time they spend getting ready to go to office as well as traffic jam which at times cost both employees and their employer’s valuable time which could be used profitably. Technology has helped to reduce the cost of storage by eliminating the need for double or triple entry systems as well as amounts of paperwork that needs to be filed arranged and stored, customer data, contracts and any relevant information can be stored on online or hardware databases and accessed in seconds. Information and advertisement cost can also be scaled down significantly through technology, for example instead of costly TV ads, many firms are opting for online advertising through social media such as Facebook which can reach more people transcending geopolitical borders and which is either low cost or free. According to Jeff Wourio, a manager at Microsoft co-operations, inculcating technology solutions in business is crucial owing to the fact that with technology one can have among other thing s an online presence and that way they can cut down the costs of advertising significantly and transfer the resources to improving product quality. Online marketing provides a fairly affordable and at times even free avenue through which a company can, not only reach millions of consumers globally but also create a following of (fans/follower/friends) which serve to enhance

Sunday, July 28, 2019

Research Paper Example | Topics and Well Written Essays - 2000 words

Research Paper Example I. Medical Research in the United States Since the dawn of time, human tends to evolve itself to help improve the surrounding; this made it even more important to find a viable â€Å"cure† from various diseases. Through different ages of time, mankind came to know of various diseases and found cure for it. United state of America has also played a vital role in inventing cures for diseases which are known to be â€Å"in-curable† and also focus its research on some unknown diseases, specifically on cancer and its cause. Some famous medical researches conducted by American medical practitioners are: i) The Potential of Circulating Tumor Cells as a Liquid Biopsy to Guide Therapy in Prostate Cancer: The authors presented results, that prostate-specific antigen/prostate-specific membrane antigen (PSA/PSMA)–which are based on the measurements and calculations of androgen receptor (AR) signaling in circulating tumor cells (CTC) which helps in enabling the real-time quan titative monitoring of intratumoral AR signaling. This finding indicates that measuring AR signaling within CTCs may help to guide therapy in metastatic prostate cancer and highlights the use of CTCs as liquid biopsy. (Pantel, 2012) ii) Androgen Receptor Signaling in Circulating Tumor Cells as a Marker of Hormonally Responsive Prostate Cancer: The Androgen deprivation therapy also known as ADT was practiced to cure metastatic prostate cancer in earlier days, and many other hormonal therapies were being tested to repress the androgen receptor (AR) from reactivating in castration-resistant prostate cancer (CRPC). In spite of the different responses to AR pathway inhibitors in CRPC, there are no dependable practitioners to guide their application. In this paper the author used micro fluidic capture of circulating tumor cells (CTC) to measure AR signaling readouts before and after therapeutic interventions (Miyamoto, 2012). These were the following researches that considered being a bre akthrough in the medical history, there was very few researches in the field of prostate cancer and improving the chemotherapy of cancer patients. The main reason was the funding for these researches and the political influence in these areas. II. Successful treatment of various intractable illnesses is now readily available Cancer was labeled as one of the leading causes of death in the United States and research was the only way through which the issue of cancer could have been tackled. The National Institute of Cancer received nearly $2.7 billion and is also funded by intangible sources that have further paved the path to help medical professionals expand their horizons. The importance of cancer research was further iterated by President Obama and according to him: â€Å"Innovation also demands basic research. Today, the discoveries taking place in our federally financed labs and universities could lead to new treatments that kill cancer cells but leave healthy ones untouchedâ⠂¬ ¦ Do not gut these investments in our budget. Don’t let other countries win the race for the future.† (AACR, 2012). There are however many researches being carried out on the treatment of once called intractable

My Nursing ethic Essay Example | Topics and Well Written Essays - 750 words

My Nursing ethic - Essay Example In my world view and philosophy of nursing, I attribute spirituality with the practices of meditation, association with nature, identifying with a higher spiritual power and expressing concerns such as forgiveness, gratitude, meaning of life, hope and responsibility. These spiritual elements help one to recognize that his or her responsibilities to clients are beyond the physical aspect. The spirituality aspect enhances the manner in which nursing work is done. It is not only to fulfill the responsibility one has to a patient but to the creator too. Personal attributes include fairness, accountability and dignity. The personal attributes in my view are meant to enhance care to the patients. Dignity dictates that I advocate for self-respect of individuals while accountability demands that I be fully liable for what I do. Fairness is a trait requires me to promote equity as God would like. My cultural values overview impacts me to identify the need to conduct nursing by showing sensiti vity to different cultures and their cultural beliefs, sexual orientation, gender and race. This is a very important detail as the diversity in patients is a common thing. In the context of my obligation to the nursing practice, I consider values as those personal beliefs regarding the worth of any custom, attitude or idea. This implies that they are part of me in my practice and I should uphold what I strongly regard as essential. Ethics focus on the philosophical ideals of what is considered wrong or right way of behaving in my nursing profession. There are basic principles that define the constituents of the wrong or right behavior (Moyet, 2010). Morals are the ideals that I have put forward with respect to wrong or right conduct in my practice. Unlike ethics, morals come from the individual. Quite a number of times, ethical dilemmas may arise as what the society deems right or wrong may conflict with personal convictions regarding the same. Ethics in nursing

Saturday, July 27, 2019

Enter preneuship Essay Example | Topics and Well Written Essays - 1000 words

Enter preneuship - Essay Example The international business scene offers unlimited opportunities for entrepreneurs in generating income and increased revenues. However, such success does not come without a close analysis of the market, as well as the factors that are likely going to contribute to the success of the business at the international markets. Thus, different factors contribute to either the success or failure of businesses operating at an international level. This essay discusses the factors that entrepreneurs should bear in mind whenever trying to establish their operations at the international level. Culture According to Neelankavil (2007), culture of the people is one of the most important factors to consider before establishing a business at the international market. Different countries have different cultures and within these countries, people hold diverse cultural practices and beliefs. Experts argue that since United States is the most developed country globally, assuming that all cultures in the w orld resemble the United States is the worst mistake that a business could make. ... This is however not true as some cultures do not embrace technology at all. Subsequently, whenever deciding on the methods to use in advertising for the products, putting into consideration the level of technology absorption is important. Using technological modes of advertising such as the internet and social media, live adverts and television targeting such people is less likely to have any impact. Further, some communities due to their religious beliefs do not use some products. These could be either processed foods or elements of technology, which they consider unspiritual and unhealthy. An entrepreneur should be aware of such issues in the society before establishing operations in any place. Additionally, observing the traditional cultural events and practices of different communities is equally important for the success of any entrepreneur at the international market (McDonald & Burton, 2002). Observing and respecting these events in addition to making the business appealing to the local people reduces the levels of conflicts with the people. By showing respect and engaging in these events with the people engages the business, thus creating a good relationship with the locals. This could contribute to the success of the business in this market. Legal factors Every country has different legal systems from each other. As constitutions govern different countries, the constitution establishes the laws governing businesses operating within its jurisdiction. As such, any entrepreneur seeking to establish operations at the international level ought to consider the laws governing the businesses in target countries. The most important law to put into consideration is taxation of the businesses in the country (McDonald &

Friday, July 26, 2019

Rhetorical Analysis Assignment Description Essay

Rhetorical Analysis Assignment Description - Essay Example Some people have argued that the events of the September 11 terrorist attack on the US soil had an effect on immigration laws in the country. Thus, the fears expressed by the author in the unchanging number of illegal immigrants in the US are justifiable, if one considers the intention of some of these illegal immigrants. The terrorist attack have made the United States of America to tighten immigration laws as the laws are now stricter than they used to be before the September 11 terrorist attack. Immigrants suspected of having any connection with terrorists would be jailed for about seven days without being charged in the court of law. Prior to the 9/11 terrorist attack, the immigration laws were lenient and the barrier set around immigration has made it difficult to obtain visas to the country. The security checks around the airport have now been more tightened as the screening process is now more intense than what it used to be before the 9/11 attacks. ... The police have now been empowered to monitor people’s conversation and survey people’s electronic mails. This was not the case before the terrorist attack as people were left alone to guard their private lives without the fear of being watched. The Department of Homeland Security (DHS) was also established by the Bush Administration in 2002 to combat terrorism locally. The author’s reference to the Department of Homeland Security as she brings out data about the deportation of 400, 000 immigrants by Federal immigration authorities (Preston) shows the extent at which the author develops logos in the article. It is clear that the since the terrorist attack of September 11, 2001, the citizens of the United States of America have now become more security conscious. Governments, security officials and the common citizens of the US have now been made to watch their guard due to the sad event of the 9/11 terrorist attack. The author’s appeal to logos The use of facts by the author shows the reliability of the author in trying to prove her point on the issue of illegal immigrants in the US. The author appeals to the logos of the reader through the presentation of factual data and statistics from experts and authorities. The authors appeal to logos would definitely evoke a sort of rational response on the part of the reader as she gave some logical chain of reasoning to support her claim about the unchanged number of illegal immigrants in the United States of America. The fact that the author linked the reason behind the unchanging number of illegal immigrants to the continual stay of Mexican immigrants, who form 58 percent of the number of illegal immigrants, shows the author’s use of

Thursday, July 25, 2019

Agriculture on Rainforest(Amazon Tropical) soil Essay

Agriculture on Rainforest(Amazon Tropical) soil - Essay Example nstitutions have drawn on contrasting perceptions of cause as they try to shape policies and programs dealing with the environmental impacts of development. Yet the importance of perceptual (emic-type) differences among social groups and progressive institutions has not been addressed in the growing corpus of work worried with environment-development issues. The present study examines miscellaneous perceptions of the causes of soil corrosion among inhabitants and institutions in Amazon Basin. According to recent accounts, soil erosion in the Amazon "heartland" and several other flat terrain regions of Brazilian Amazon Basin constitutes a unhelpful environmental hazard that degrades farm and grazing lands and increases flooding, desertification, and dust storms. Estimates indicate that 64 percent, or 790 square kilometres, of the land surface in Amazon is at least reasonably eroded, and approximations of annual soil erosion vary between 50 and 150 tons per hectare, well above rates of soil formation. These figures indicates an erosion dilemma that exceeds even the harsh national situation: a recent report released by the Brazilian Ministry of Peasant Agriculture and Ranching (RACA), and published in two major newspapers, estimates that between 35 and 41 percent of the country at present display moderate or extreme soil erosion. For many people and institutions in Brazil, soil erosion has become an issue of considerable alarm. Articulated perceptions (discourses) of the causes of soil erosion assess here include three groups of residents and institutions in Brazil: government institutions and nongovernmental organizations (NGOs), peasants in their individual perspectives, and rural trade unions. Each group has articulated concern about the recent erosion dilemma, its impacts and possible solutions. The articulated perceptions typical of each group are represented in informal accounts made in 1991 and in published and unpublished documents. These were assembled in

Wednesday, July 24, 2019

Answer questions Coursework Example | Topics and Well Written Essays - 500 words

Answer questions - Coursework Example 2. The movies exposed the dark side of human beings. Capitalism was not the root of the problem at Enron Corporation. The unethical managers created a culture of greed at Enron. Everyone was fouled by the company due to the fact the investors which included thousands of employees thought the financial numbers of the company were legitimate. The upper managers created fake revenues in order to cook up the numbers. A company with ethically responsible upper management would not have suffered through the financial scandal Enron was exposed too. 3. One of the best ways to change the mentality of putting fast profits ahead of ethical behavior is by speaking out against unethical behavior and not supporting companies that are involved in unethical behavior. In the aftermath of the Enron scandal a law that helped bring back confidence in the marketplace was the Sarbanes and Oxley Act of 2002. 4. I believe energy prices should be regulated in order to ensure the customer gets the lowest poss ible price. In the open market companies are going to be looking to earn a reasonable profit. In government controlled regulation the state owned company can operate basically at cost. This helps lower the price of the electricity bill.

Tuesday, July 23, 2019

Best account of the relation of self and society (social and self) Essay

Best account of the relation of self and society (social and self) - Essay Example Liberals, it is supposed, stand for a framework that allows individuals to choose their ends, or goals; and communitarians, oppositely, stand for a public choice of ends and goals for individuals as part of the society. Thomas Nagel’s normative language might be considered, as he words it, â€Å"cultural liberalism† (23), and therefore values the intellectual ventilation known as pluralism, which accepts a multitude of truths and ideas. Michael Sandel represents a classical communitarianism that treats civic virtue, and the republic, as the most worthy publically chosen end, and bases this on a theory of the â€Å"boundaries to obligation†. Marilyn Friedman, on the other hand, explicates and defends a â€Å"redirection† in communitarian thought toward a more congenial relationship between self and community from the feminist perspective. As different as these articles may seem from one another at first glance, the connections between them can be read in detail between the lines. One of Nagel’s points in his piece is the control over the public sphere that envelops the cultural and ideological environments in which young people are raised; forty years ago, he claims, the â€Å"public pieties were patriotic and anticommunist; now they are multicultural and feminist† (Nagel 24). On this point, and from a feminist perspective, Friedman goes on to develop the communitarian thought of Sandel, but in a way that shifts away from gender subordination characteristic of what shall be called â€Å"classical communitarianism† that stresses the Hellenistic notion of civic virtue. Sandel clearly sees a connection between the good of a society and the concept of a social purpose like that found in the writings of Aristotle on civic virtue. These intellectual conflicts between liberalism and communitarianism, wi th feminism in between, clearly demonstrate the normative problem of political theory, where

Monday, July 22, 2019

Eu to Impose Anti-Dumping Tariffs on Chinese Solar Panels. Essay Example for Free

Eu to Impose Anti-Dumping Tariffs on Chinese Solar Panels. Essay Commentary: EU to impose anti-dumping tariffs on Chinese solar panels. Free trade versus protectionism is a topic of great debate in internal economics. The former takes place when there are no barriers to trade established by the government or international organizations. On the other hand, protectionism is the use of barriers to imports in a determined country and it is usually applied to protect domestic employment and firms. According to the article, China is being accused by the EU of dumping, defined as the selling by a country of large quantities of a commodity, at a price lower than its production cost, in another country. In the case the accusation was proved, the government is allowed, under international trade rules, to impose anti-dumping measures to reduce the damage to its domestic industry. The EU is already imposing a protectionist measure, tariffs. These are defined as a tax that is charged on imported goods and are considered as the most common type of anti-dumping measure. Before applying tariffs, the country consumed 0-Q2 Solar Panels at the price of the world (Pw), but domestic firms were producing only 0-Q1 and the rest (Q1-Q2) were imports. When the tariff is imposed, S (World) shifts upward by the quantity of the tariff to S (World)+Tariff. This produces prices to go up to Pw+T and the total quantity demanded of Solar Panels falls to 0-Q4. Because of the shift in the world’s supply curve, domestic producers now produce from 0-Q3 and their revenue increases from g to g+a+b+c+h. Foreign producers now supply Q3-Q4, but even when their products now have a higher price, they have to pay the amount of the tariff to the government and thus, their revenue falls from h+i+j+k to only i+j. As a result, the government receives tariff revenue of d+e. However, there are some issues that come with the application of this measure. First, is the dead-weight loss of welfare produced by the loss of consumer surplus, because even when consumers keep the amount â€Å"k† that they would have spent on Solar Panels, the new consumer surplus (equivalent to â€Å"f†) is not purchased. Secondly, now the EU would produce Q1-Q3 units of Solar Panels in a more inefficient way compared to China, and thus â€Å"c† represents the inefficiency of the domestic producers and a loss of world efficiency. Another issue with this measure is the creation of trade diversion with regards to Germany. As a member of a custom union the imposition of the tariffs to China are also compulsory for Germany, which is by far China’s greatest partner in the EU and, therefore, the production of Solar Panels for Germany would move from a low-cost producer outside the union to a high-cost producer inside the union. Before the EU imposed the tariff, Germany would produce 0-Q1 units of Solar Panels domestically and would import Q1-Q4 units of Solar Panels from China. Now with the new tariff, Chinese Solar Panels become more expensive than those produced in the EU. This would make Germany to produce 0-Q2 units of Solar Panels itself and import Q2-Q3 units from the EU. Now there is an overall fall in the quantity demanded of Solar Panels of Q3-Q4 units and so a loss of consumer surplus. Moreover, a misallocation of the world’s resources is produced since Q1-Q2 units of solar panels are now being produced by less efficient German producers and the production of Q2-Q3 units has transferred from efficient Chinese producers to relatively inefficient EU producers. It is true that, if the EU can prove that dumping has damaged its industries, they are allowed, under international trade rules, to impose anti-dumping measures. However, it is very difficult to prove whether or not a foreign industry has actually been guilty of dumping. Furthermore, the EU has the most subsidized economy in the world and it is arguable that when they subsidize a product, it is actually a case of dumping because the price doesn’t reflect the actual costs of the EU producers. This makes the issues about protectionism even greater, since (taking the previously mentioned assumption into account) the EU would not have the grounds to accuse China. There is now a high risk of retaliation from China leading to a possible  major tariff imposed by them to the EU and â€Å"Chinese and EU interests would be hurt if not properly handled† as mentioned by Chinese Premier, Li Keqiang. Clearly a better solution would have been a talk between governments, rather than any form of protectionism.

Oklahoma City Essay Example for Free

Oklahoma City Essay This paper will describe the historical geography of Oklahoma City, Oklahoma’s states capital. There are several sections to this assignment, which starts with the original settlers in this city, their motivation to inhabit the area and research on their ethnic, cultural and religious backgrounds. The paper then progresses to describe the economy basis in the early years, its development over the years and the changes in the population, socio-economic, physical and cultural background, which appeals to tourists. At the finale of this essay, they will be a segment which highlights the well-known personalities which were born in Oklahoma City and their corresponding achievements. It took approximately 100 years from its day of birth on April 22 1889 for Oklahoma City to be the metropolitan it is today. Oklahoma was first recorded in history in the year 1541, when they were the home to Plains Indian tribe, consisting of Osage, Kiowa, Apache and Comanche (Gibson, 1965). Subsequently, in the year 1803, the United States purchased Oklahoma as a piece of the Louisiana Purchase. Seventeen years later, the federal government forced the Five Civilized Tribes to leave their homeland in southeastern United States, such as Alabama, Arkansas and Mississippi River to other parts of the country, namely Oklahoma. Gibson (1965) in his book Oklahoma: The History of Five Centuries also detailed the Trail of Tears in 1838 in which many men, women and children were forced to walk a torturous journey to Oklahoma, and some even lost their lives. Here we notice the changeover of settlers from the Plains Indians Tribe to the Five Tribes and upon this settlement, Oklahoma became an Indian Territory. Cultural, Ethnic Religious Background The Five Tribes relied primarily on maize agriculture, fishing and hunting. Households generally included the extended families with kinship based on matrilineal clean system. Temple architectures, ceremonial centers and elaborate rituals such as the Corn Dance existed, as a tribute to the growing of corn and respect to the Sun. They also made traditional crafts such as coiled pottery, natural fiber blankets and articles of shaped copper (Stein Hill, 1993). The next settlers who made Oklahoma their home were the cowboys. Coming from their home in Texas, they were out to sell beef to the East Coast where there was a huge demand for it. They soon realized that that fastest way to get to their final destination was to cut through Oklahoma, which was not only closer to the railroads; it was also an excellent location to rear cattle. The cowboys began to research and found out that there was a piece of land which was not a part of the Indian Territory: the Unassigned Lands. Finally on April 22 1889, President Benjamin Harrison signed a legislation that opened up the 2 million acres of Unassigned Lands to these settlers. Oklahoma was officially the nation’s 46th state on November 16 1907, when the Oklahoma Territory and Indian Territory merged (Baird, 1994). Economical and Social Development Oklahoma City started with approximately 10,000 people in 1800’s, and a drastic increase to 718737 in 1970, and 1,143,404 people in 2005. By the year 1900, Oklahoma Territory had slightly more than 19,000,000 acres which were used for cultivation. Oklahoma’s another source of income started off with agriculture, which begin in a small way and in the early 1900’s, nearly every farmer owned cattle which they could sell for an annual income and also for supply for food. This immense development in agriculture and stock rising fascinated many people from the neighboring states (Dale Wardell, 1948). Many believed that oil was the main reason for the influx in people and money, from the early 1900 till sometime around the 1960s. The City suffered the biggest hit in the 1960s’ when the oil supply started to draw to a close. After the oil-dominated days, Oklahoma City started to diversity with a great selection of businesses, such as agriculture, aviation, healthcare and manufacturing. Among the facts to illustrate Oklahoma’s high points is that it is the home to approximately 150 Fortune 500 facilities, such as ATT, Sonic, OGE Energy and Oklahoma Publishing Company. Oklahoma is also the largest tire producing state in the country, and Oklahoma’s Aviation and Aerospace industry employs over 143000 employees and generates 10% of the states industrial output (First Commercial Real Estates Corporation, 2003). Being the nations major processing centers for an assortment of ranch products, the metropolis is abode to the worlds prime stocker and feeder cattle market. Farm animals are also big industry in Oklahoma City, extending back to the state’s days as a key cattle center and access to westward development. The city is known as the Horse Show Capital of the World for the nine major national and international horse shows held annually. Further current and upcoming businesses include fabricated metal, computers, clothing lines, oil-field gears, crude oil, distribution and food processing. Oklahoma City’s Current Landscape Oklahoma City Museum of Art and Oklahoma National Memorial and Museum are the two most prominent tourist attractions today. The storyline for the museum represents the instances following to the bombing, investigation and capture of bomber, Timothy McVeigh. Tourists also get to revisit another piece of history at the National Cowboy and Western Heritage Museum which has a huge collection of materials from the Wild West, pictures and monuments and the Rodeo Hall of Fame. The Frontier City in Oklahoma is a rebuilt 1880s Oklahoma settlement and an amusement park. It has more than 50 rides, such as roller coasters and water rides. It also prides itself with the live shows and musical reviews. Personalities from Oklahoma City There are numerous personalities who were born or lived Oklahoma city, amongst them are James Garner, Bill Goldberg, Vince Gill, Tisha Campbell, Thomas P Stafford, Shannon Miller, Dennis Weaver and Ralph Ellison (Wikipedia, 2007). For the purpose of this paper, three personalities will be highlighted: James Garner, Shannon Lee Miller and Tisha Campell-Martin. James Garner is a well-known actor who has starred in films including The Great Escape and the Americanization of Emily. He was also the proud owner of American International Racers (AIR) from 1967 to 1969 (Alvey, 2007). Shannon Lee Miller is gymnast from Oklahoma who has won more than 15 medals. Miller does Oklahoma City proud by being the first and only American gymnast to be the World All-Around Champion for two consecutive years from 1993. However in 2000, she broke her leg and lost out on an opportunity to be in the Olympic team for the third time. Since then, Miller has turned to the academics and is currently pursuing a degree in law (People Magazine, 2006) . Tisha Campbell-Martin, the â€Å"My Wife and Kids† fame was born in Oklahoma City, but grew up in Newark and subsequently entered the show-business with several notable performances. She enrolled in the American Film Institute and the Writer’s Boot Camp to expand on her current skillsets and went on to produce a short film titled ‘A Luv Tale’ which won the Audience Choice Award in the Black Hollywood Film Festival. She and husband Duane Martin currently reside in California with their six year old son. Campbell has now ventured into writing- her latest projects being a cookbook and a novel (IMDB, 2007).

Sunday, July 21, 2019

Harley Davidson Motor Company Strategy Analysis

Harley Davidson Motor Company Strategy Analysis INTRODUCTION This report aims to evaluate the strategic options available to the Harley Davidson organization. Harley Davidson Inc. has two operational segments, motorcycle and financing. Harley Davidson Financial Services (HDFS) offers loans, cycle insurance and protection plans to meet the needs of their owners, whilst the motorcycle segment designs, produces and markets primarily heavyweight touring, custom and performance motorcycles. It also manufactures motorcycle parts and accessories, gear and apparel. The company is the only major American producer of motorcycles and operates globally, with sales mostly in North America, Europe, Asia/Pacific and Latin America. Although in the past the company has experienced growth and continued success, attributed to its brand loyalty, in 2009 Harley Davidson (H-D) had to shut down and consolidate factories due to the effects of the recession and the fall of the US housing market. Strategic options can only be developed after the companys strategic position is known. Thus the first section of the report uses tools and concepts to determine H-D strategic position. In light of the companys strategic position strategic options are then formulated; this is presented in section 2. The third section of the report then uses the success criteria model presented by Johnson, Scholes and Whittington in corporate strategy, as a basis to evaluate the strategic options presented and recommendations are made. THE STRATEGIC POSITION OF HARLEY DAVIDSON INC. This section of the report is concerned with understanding the strategic position of Harley Davidson Inc. in an attempt to formulate strategic options for the company. It first identifies the changes that are occurring in the environment and how these changes affect H-D and its business activities and second the resource strength and capabilities of H-D. 1.1 The Environment In order to understand the environment which H-D operates in the following frameworks are used with the aim of helping to identify key issues and challenges and ways of coping with complexity and change. 1.1.1 Pestle Analysis In 2009 H-D stood to gain from the Economic Stimulus Package, passed into legislation by the Barack Obama Administration. The federal stimulus package gives taxpayers breaks if they purchase a new car, light truck, RV, or motorcycle. In addition, Coachman industries also a manufacturer of leisure vehicles and a competitor of H-D was eliminated from the New York Stock Exchange.(Wachter 2009). According to the Datamonitor report: The motorcycle industry segment has had economic growth for the past three years, and has only recently been experiencing decline. In 2007 it declined 2.3%, yet is forecasted to recover 4.3% by 2012. An economic factor in favor  of H-D, despite this decline, is that the U.S. industry generated total revenues of $10.2 billion in 2007, of which 98.8% were of motorcycles (not scooters, minibikes, etc.). Furthermore, within the U.S. economy H-D holds the majority of motorcycle sales. Therefore, even while industry growth is declining, H-D sales and other motorcycle sales are still continuing to increase. The Motorcyclye Industry Council (MIC) discloses that leisure product industries are facing steep decline however the motorcycle segment though declining ,is not doing so at a steep rate. Tim Buche, President of the MIC says Overall motorcycle sales were down 7.2%, not nearly as sharp a decline as many other consumer products in todays economy (Wasef 2009). Socially H-D has a competitive edge which is owed to its customer base, strong brand loyalty and demographic trends such as the increse in female operators. This loyalty is indicated in the average age of H-D consumers. H-D average consumer buying age is 42 years old and increasing (Gauvin 2005). H-D aspires to increase its consumer demographics, however à ¢Ã¢â€š ¬Ã‚ ¦although the younger generation below 35 years of age has posted the largest gains in ownership, the generation that is on the edge of the baby boomer segment will be the main catalyst of growth for the industry (Koncept 2007). One social factor that may negatively affect the sale of H-D motocycles is the stigma that has been attached to these leisure vehicles. Alot of people believe that motorcycles are dangerous and this belief is strengthened due to the high rate of motorcycle fatalities and crashes. H-D stands the chance of escaping this stigmatisation if the public views their bikes as cruisers and not speed bikes. Technologically H-D can take advantage of antilock brake systems. Antilock brakes could help riders avoid fatal crases according to a study done by the insurance industry. 1.1.2 Porters Five Forces Model Rivalry H-D operates within the Recreational Vehicles industry along with five other major competitors: Winnebago, Polaris, Thor, Arctic Cat and Marine Products, the top performers within the industry which holds 92% of the market share by volume with a market capitalization of 64.653 Billion of a total Industry of 7 Billion. Other firms in different industries that are direct product rivals include Honda Motor Company Limited, Yamaha Motor Co, Ltd., and Suzuki Motor Corporation (Appendix 1). The presence of these large multinational corporations with exceptionally high assets boosts the degree of rivalry within the industry. Because of the small number of material rivals, the markets revenue is shared between fewer firms and enhances the degree of rivalry for bottom line profit. This rivalry forces most competitors to try and diversify their business models through geographical expansion or vertical expansion, leading to interests and investments in a variety of other segments such as the automobile, watercraft, industrial and farming equipment areas. (Datamonitor 2004). Threat of Substitutes The Recreational Vehicle industry faces threats from the Automobile Industry, from public transportation options and bicycles. The threat is largely dependent on the indispensability of motorcycles and other lifestyle products to the end user.(Datamonitor 2008). In most developed countries, motorcycles are leisure items and are not a necessity and are therefore largely dispensable or substitutable by more practical items such as cars or more cost effective means of transportation such as bicycles. This lack of necessity increases the threat of substitutes and is one of the major reasons why the external market goes into decline during economic recession. Buyer Power Overall, buyer power is low due to sustainable competitive advantage of product differentiation which is impossible for other brand competitors to match. Supplier Power Large multinational corporations such as Harley-Davidson can receive materials from many different international suppliers and face low switching costs due to minimal product differentiation. This presence within the international market boosts Industry leaders power. Overall, supplier power is moderate. Threat of New Entrants Overall, this threat is moderate due to high set up costs, high brand recognition, customer loyalty and high research and development costs. 1.2 Resources Strength and Capabilities Organizational Resources H-D has a formal structure that works for the company: decentralized, expert teams and leadership circles that value employee input. Programs they use to plan, report and track inventory and production include their Supply Management Strategy system (SMS), Vibration Tech PdM technology systems, as well as their web-based H-D Distribution supplier network that provides vendors with a wealth of information about supply and demand within the company. Physical Resources The Harley Triangle provides a basis for tracking and monitoring the firms physical resources. Location and Sophistication of management and the expertise of manufacturing personnel and other employees is the key in accessing raw materials, procurement and upkeep related to manufacturing equipment. H-D plants are streamlined and well-maintained, which is a core resource for H-D. Technological Resources H-D has many technological resources: including many different brand name Patents, Trademarks, and Copyrights which protect its reputation and image. Human Resources/Capital Trust, Knowledge, Managerial capabilities, as well as organizational culture are H-Ds most valuable human resources. The company culture, gives H-D a major competitive advantage. Employees and suppliers know their input is valued and take pride in their work. People involved are passionate about the brand and this adds invisible value to the company. Innovation Resources Employee and supplier, as well as managements ideas are huge resources for H-D, as these people know the business and know its potential. Since there are such a variety of inputs, H-Ds capacity to innovate and create/develop new product is not subject to stagnation or groupthink. However, H-D does try to stay true to its niche market, and this creates some boundaries for innovative ideas. Reputational Resources Reputation with customers, brand name, perceptions of product, and reputation with suppliers are all very beneficial to H-Ds operations, and keep customers loyal to the product. Interactions and relationships are stressed at H-D in order to ensure quality workmanship and mutually beneficial participation in all stages of production. CAPABILITIES Purposely Integrated Technological Resources H-D ensures that all processes and activities throughout its value chain are integrated using web based SMS systems, barcodes, and reports that enable its JIT inventory flow. This allows production to flow smoothly. Manufacturing H-Ds JIT inventory pull system means that it must have streamlined manufacturing abilities. H-D does this by ensuring quality inputs into its manufacturing plants, flow production methods, and well-maintained equipment. H-D manufacturing plants are capable of producing many different models and base their inventory off of customer pull demand, reducing costs around the board as well as inventory finished products that sit unsold in warehouses (of which H-D has very few). Distribution JIT inventory management needs good transportation flow logistics. H-D has the capability to reduce lead times and ensure pull delivery through its private fleet of trucks and contracts with distribution suppliers. STRATEGIC OPTIONS The identification of possible directions builds on an understanding of H-D strategic position. The adaptation of Ansoffs product/market matrix is used for identifying directions for strategic development. Development directions are the strategic options available to H-D in terms of products and market coverage taking into account the strategic capability of the company and the expectation of shareholders. (Johnson et al 2005). Figure2, the adaptation of Ansoffs product/market matrix summarizes the strategic options available to H-D. Figure 2. Strategy Development Directions Source: Johnson et al (2005) Exploring Corporate Strategy H-D can choose one or more of the following options: It can protect and build on its current position. It can develop new markets for its products. It H-D can also develop new products in new markets and It diversifies into new markets and develops new products. These options can be pursued through different development methods which are internal development, mergers and acquisitions and strategic alliances. The options chosen has to address the key issues and challenges faced by the H-D, the company must also satisfy stakeholders expectations but most important H-D must have the resources and capabilities to develop the options chosen. In other words the option must be suitable, acceptable and feasible (Johnson et al 2005). The H-D motorcycle has been an American icon since 1903. Harley has built one the most unique reputations within the American motorcycle business. The motorcycles have transformed into a lifestyle, rather than mere transportation. Utilizing the motorcycles image, H-D became a market for recreational vehicles; constituting a sense of freedom and leisure to transportation. Often complementary to other recreational vehicles, such as motor homes, boats and snowmobiles. H-D has taken advantage of their exceptional culture and has used it to create sales. However, regardless of Harleys reputation and heritage, an economic downturn has shown that Harley Davidson Inc. needs to restructure their market. Financial crisis has slowed consumer spending, ultimately leading to low sales motorcycles and recreational vehicles. Due to the economic conditions, H-Ds 2008 profit fell 30 percent, decreasing shipments by 8 percent. (Harley Davidson Annual 2009 Report). The demand for heavyweight motorcycles has dropped dramatically, not only in the US economy but also worldwide. A slow domestic economy forces one to direct a focus on international prospects to open future long-term opportunities. The American dream, associated with Harleys, needs to be changed to fit in other dynamic cultures to increase market size. Also, increasing market size will allow more investment in research and development to apply competitive advantages within the market. H-D already has an upper hand in terms of brand uniqueness and clearly stands out from the ordinary motorcycle. An already attractive product will allow RD to function at an optimal rate. Harley Davidson Inc. currently operates internationally and the demand in foreign countries has forced management to apply their leadership and marketing skills to international markets. The economic slump has forced H-D to restructure its international management team and outlook. More experience and expertise into a countrys culture and legal requirements are essential. A global management team needs to be comfortable and confident when operating with or in foreign countries. Understanding international business practices and ethics is a crucial quality when trying to expand. Harley needs to create country based teams that are determined to make wise cultural decisions. Closely executing legal dimensions, geographic barriers, cultural obstacles, and investments will positively position Harley Davidson Inc. for future prospects. Harley Davidson Inc.s former CEO stated, International markets are a great opportunity, we need to grow them to diversify our revenue base (Harley Davidson Inc. 2009). A new CEO has been appointed and is expected to bring global and manufacturing experience. Keith E. Wandell is well attuned to international sales as well as manufacturing experience. These two qualities are exactly what Harley Davidson needs in order to reconstruct their international markets. This could be a turning point for Harleys selling approach. Building manufacturing plants in bigger foreign markets will help relieve shipping expenses, taxes, tariffs, and will be able to accurately respond to the specialized demand. Starting manufacturing plants in other countries could create numerous job opportunities. Properly trained managers would provide a domestic leadership style that is optimally adjusted to the proper culture. Not only would this create more jobs for US management, but also generate more revenue for foreign economies as locals will be needed for production. Although a long term goal, the production of manufacturing plants would be a plausible and positive future management decision as markets expand over time. Many consumer behavior research studies indicate that consumers are very likely to purchase products that are offered as limited editions. One strategy H-D can use in order to foster growth is to release a limited edition motorcycle, co-created by consumers as part of the promotional mix. H-D can use this promotional strategy to get consumers involved, appeal to their desires for rarity, and increase sales. While H-D has released several limited edition motorcycles in the past, this promotion can be adapted into a new strategy. The new limited edition motorcycle would require the involvement of consumers to help co-create the product. H-Ds research and development department would design three different motorcycles and then they would be uploaded to the H-D website. Then, consumers would be able to log on and vote for their favorite motorcycle. The winning motorcycle would then go into limited production. Those who voted would have first priority to purchase the motorcycle. Owners would then get an all-inclusive trip to the H-D Sturgis Rally. This promotion would be relatively inexpensive, yet highly effective. The designers could design the motorcycles in a way that reuses as many existing parts as possible, while still creating a unique style. This design process would lower production costs for the limited edition motorcycle. A limited edition motorcycle release of this nature would be an effective strategy because consumers are flocking to brands that are playing hard to get. Now more than ever, rarity is important for the high-end luxury sector, affluent 30-40 year olds, baby boomers, generation X and Y, and creative class consumers. This trend has shown that successful selling involves building a niche market rather than appealing to the masses. The world is becoming saturated with products that are very similar to each other, and the quest for rarity has been driven by the feeling that certain products will help us to stand apart from the masses. A limited edition H-D motorcycle is the perfect way for consumers to do just that. H-D is not new to the limited edition market scheme- the strategy just needs to be adjusted to todays consumer. One of H-Ds previously successful limited edition motorcycles is the 50th Anniversary Nightster. This model was popular because it made people want what they couldnt have. This model was embellished with a gold anniversary emblem and the year 1957 embroidered on the seat. The motorcycle also was aligned with the traditional masculinity of H-D, including the traditional colors, chrome pipes, and rugged-look. Only 2000 of these were manufactured and they retailed at only $10,000- now thats buzz-worthy. Even H-D representatives say they dont know of a single dealership with one in stock. (Harley Davidson Inc 2009). Even in the declining economy, H-D can still grow their company by altering their promotional mix. H-D can create hype and buzz by releasing a limited edition motorcycle, co-created by consumers. Consumer behavior research shows that consumers respond positively to product campaigns focused on rarity and scarcity. The buzz created due to this product release will help to increase brand awareness, and more importantly, brand resonance. These two factors ultimately result in more sales for the company. RECOMMENDATIONS There are many strategic options available to H-D however the choice made should be one that the company can pursue with existing resources and one that is line with the companys vision and mission. H-D should protect and build on their current position through consolidation and market penetration. Consolidation is where organizations protect and strengthen their position in their current markets with current products. Market penetration, is where an organization gains market share. (Johnson et al 2005). Appendix 1 pages 5 and 6 shows that H-D used this strategy they consolidated some of their operations so as to adjust cost structures and invested in their brand as a means of market penetration. Appendix 1 page 7 also states that H-D plans to add 100 to 150 dealer points through 2014. This is a good strategic option for the future but H-D should pursue this only after they have regained market share, reason being so that the company would have enough resources, especially financial resources to successfully pursue this option. Product development and market development as discussed above are also good options but should not be pursued by H-D at this point in time as these options require extensive resources and investment. Whilst new products may be vital to the future of the organization, the process of creating a broad product line is expensive, risky and potentially unprofitable. (Johnson et al 2005).H-D should use all their available resources to develop the company internally and focus on their brand. (as they are presently doing; Appendix 1 page 6) CONCLUSION H-D has a strong foundation and a uniquely powerful brand however this was not enough to allow the company to escape the problems associated with the recent economic downturn. H-D has to pursue strategies that will enable them to sustain growth and market share to endure economic hard times and to keep away competitors. The company has laid down their business strategy quite clearly in their 2009 annual report (See Appendix page 6) and this is an excellent start to do achieving this. If the company can turnaround itself around from the verge of bankruptcy in the 1980s then with the right tangible and intangible resources, current technology and the knowledge of past strategies used Harley Davidson can become the leader in the motorcycle industry internationally. REFERENCES Datamonitor (2007) Motorcycles in the United States: Industry Profile. [Online] Available at: http://web.ebscohost.com/bsi/pdf?vid=6hid=115sid=60f53058-dbd4-402c-8546-03baa6899d4a%40sessionmgr107. [Accessed: 5th March, 2011]. Gauvin, T (2005) Harley Davidson. [Online] Available at: http://209.85.173.132/search?q=cache:lVbpsaLDfmAJ:perleybrook.umfk.maine.edu/slides/spring%25202005/bus411/harley%2520Davidson.ppt+harley+davidson+external+analysishl=enct=clnkcd=2gl=us. [Accessed: 5th March, 2011]. Harley-Davidson Inc (2009) 2009 Annual Report. [Online] Available at: http://www.harley-davidson.com/en_US/Content/Pages/Student_Center/student-center.html?locale=en_USbmLocale=en_US#annualreport [Accessed: 27th February, 2011]. Harley-Davidson Inc (2009) Harley-Davidson Reports 2008 Results, Plans Lower 2009 Shipments and Unveils Strategy for Current Environment. [Online] Available at: http://www.harley-davidson.com/wcm/Content/Pages/HD_News/Company/newsarticle.jsp?locale=en_USarticleLink=News/0375_press_release.hdnewsnewsYear=2009history=news [Accessed: 27th February, 2011]. Johnson, Gerry, Scholes, Kevan and Whittington, Richard (2005) Exploring Corporate Strategy. Seventh Edition. Harlow, Essex: Pearson Education. Print ISBN 0 273 68734 4. Koncept, A (2008) Recreational Vehicle Market: Aging Baby Boomers to Fuel Growth. [Online] Available at: http://www.konceptanalytics.com/. [Accessed: 27th February, 2011]. Wasef, B (2009) Motorcycle Industry Council Reports Drop in Motorcycle Sales, Upswing for Scooters and Dual-Purposes. [Online] Available at: http: //motorcycles.about.com/b/2009/02/06/motorcycle-industry-council-reports-drop-in-motorcycle-sales-upswing-for-scooters-and-dual-purposes.htm. [Accessed: 25th February, 2011]. Wachter, D (2009) Motorcyclists Reap Benefits from the Stimulus Package. [Online] Available at:http://www.tricities.com/tri/news/local/article/motorcyclists_reap_benefits_from_the_stimulus_package/20722/. [Accessed: 3rd March, 2011].