Monday, September 30, 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

Sunday, September 29, 2019

Corporation, Partnership, or Sole Proprietorship? 

Corporation, partnership, or sole  proprietorship? Now that you have decided to start your own business, you will have to determine what business structure or form of organization suits your needs. The structure of your business will depend on whether you want to run your business yourself or with a partner or associates. There are four types of business structures: sole proprietorships, partnerships, corporations and cooperatives. On this page: 1. 1. Sole proprietorship 2. 2. Partnerships 3. 3. Corporations 4. 4. Cooperatives 1. Sole proprietorship^TopWith this type of business organization, you would be fully responsible for all debts and obligations related to your business and all profits would be yours alone to keep. As a sole owner of the business, a creditor can make a claim against your personal or business assets to pay off any debt. Advantages: * Easy and inexpensive to form a sole proprietorship (you will only need to register your business name provincially, except in N ewfoundland and Labrador) * Relatively low cost to start your business * Lowest amount of regulatory burden * Direct control of decision making Minimal working capital required to start-up * Tax advantages if your business is not doing well, for example, deducting your losses from your personal income, lower tax bracket when profits are low, and so on * All profits will go to you directly Disadvantages: * Unlimited liability (if you have business debts, personal assets would be used to pay off the debt) * Income would be taxable at your personal rate and, if your business is profitable, this may put you in a higher tax bracket * Lack of continuity for your business, if you need to be absent * Difficulty raising capital on your own 2.Partnerships^Top A partnership would be a good business structure if you want to carry on a business with a partner and you do not wish to incorporate your business. With a partnership, you would combine your financial resources with your partner into th e business. You can establish the terms of your business with your partner and protect yourself in case of a disagreement or dissolution by drawing up a specific business agreement. As a partner, you would share in the profits of your business according to the terms of your agreement. You may also be interested in a limited liability partnership in the business.This means that you would not take part in the control or management of the business, but would be liable for debts to a specified extent only. When establishing a partnership, you should have a partnership agreement drawn up with the assistance of a lawyer, to ensure that: * You are protecting your interests * That you have clearly established the terms of the partnership with regards to issues like profit sharing, dissolving the partnership, and more * That you meet the legal requirements for a limited partnership (if applicable) Advantages: Easy to start-up a partnership * Start-up costs would be shared equally with you an d your partner * Equal share in the management, profits and assets * Tax advantage, if income from the partnership is low or loses money (you and your partner include your share of the partnership in your individual tax return) Disadvantages: * Similar to sole proprietorship, as there is no legal difference between you and your business * Unlimited liability (if you have business debts, personal assets would be used to pay off the debt) * Hard to find a suitable partner Possible development of conflict between you and your partner * You are held financially responsible for business decisions made by your partner (for example, contracts that are broken) 3. Corporations^Top Another business structure is to incorporate your business. This can be done at the federal or provincial level. When you incorporate your business, it is considered to be a legal entity that is separate from the owners and shareholders. As a shareholder of a corporation, you will not be personally liable for the d ebts, obligations or acts of the corporation.When making such decisions, it is always wise to seek legal advice before incorporating. Advantages: * Limited liability * Ownership is transferable * Continuous existence * Separate legal entity * Easier to raise capital * Possible tax advantage as taxes may be lower for an incorporated business Disadvantages: * A corporation is closely regulated * More expensive to incorporate than a partnership or sole proprietorship * Extensive corporate records required, including shareholder and director meetings, and documentation filed annually with the government * Possible conflict between shareholders and directors Possible problem with residency of directors More information: To learn more about incorporation, please consult the following information: * Guide to Federal Incorporation Step by step guidelines to help you incorporate your business and set up an appropriate structure. Provincial or territorial  incorporation Alberta * Corporate Registry To conduct business in Alberta, register your cooperative, corporation, extra-provincial company, non-profit company, society, trade name and/or partnership. Manitoba * Companies Office – Business name registration and provincial ncorporation (Manitoba) How do you register your business, and what do you need to know about provincial incorporation? New Brunswick * Incorporation / Registration of a business Find out about the rules, procedures and fees for registering a provincial corporation in New Brunswick. * Incorporation of non-profit companies (New Brunswick) Find out about the rules, procedures and fees for incorporating a not-for-profit company in New Brunswick. Newfoundland and Labrador * Registry of Companies (Newfoundland and Labrador)In Newfoundland and Labrador, you must register with the Registry of Companies if you decide to incorporate provincially. Northwest Territories * Corporate Registry — Co-operative Associations Are you looking to establis h and incorporate a co-operative within the Northwest Territories? Find out the rules pertaining to starting your venture and what is needed to remain compliant with the law. * Corporate Registry — Business Corporations Are you looking to incorporate your business? Find out how you can register to do business in the Northwest Territories. Corporate Registry — Societies Are you interested in starting a society or non-profit organization? Find out the benefits of incorporation and what you are required to do at the territorial and federal levels. Nova Scotia * Business incorporation and registration (Nova Scotia) Incorporate your business provincially through the Nova Scotia Registry of Joint Stock Companies. Nunavut * Business corporations — Territorial corporations – (Nunavut) Find out how to incorporate as a territorial business in Nunavut. Ontario * Ontario Business IncorporationIncorporate your Ontario business online, in person, or by mail. * Professi onal corporations Find out how you can incorporate your practice in Ontario for specific regulated professions. * Correcting errors on your Ontario corporation documents You can ask to have errors corrected in documents you have filed for your Ontario corporation. * Making changes to your corporate information Find out how to make changes to the information about your Ontario corporation, including its name, address and number of directors. * How to merge Ontario corporationsDo you have two or more active Ontario business corporations that you would like to merge? * Involuntary dissolution of Ontario business corporations Your corporation can be dissolved or cancelled if it has failed to comply with specific rules and regulations. * Reviving your corporation You may be able to revive your Ontario corporation if it was involuntarily dissolved within the past 20 years. * Incorporation (Not-for-Profit Corporations) You can incorporate your not-for-profit organization provincially with the Government of Ontario. Making Changes to Your Ontario Not-for-Profit Corporation Find out how to make changes to the information about your Ontario not-for-profit corporation. * Reviving your Ontario not-for-profit corporation You can restart your previously cancelled Ontario not-for-profit corporation by filing an Application for Revival. Quebec * Incorporate a business (Quebec) Learn the steps to incorporate your business in Quebec, especially the forms to be filled out and the application process. Saskatchewan * Incorporating Your Business in SaskatchewanFind out how to incorporate your business in Saskatchewan, including the fees, the forms required and the turn-around time. * Forming a Non-Profit Corporation in Saskatchewan Find out how to register your non-profit corporation in Saskatchewan, including the fees, the forms required and the turn-around time. 4. Cooperatives^Top The last business structure you could create is a cooperative. With a cooperative, you would have a business that would be owned by an association of members. This is the least common form of business, but can be ppropriate in situations where a group of persons or businesses decide to pool their resources to provide access to common needs, such as the delivery of products or services, the sale of products or services, employment, and more. Advantages: * Owned and controlled by members * Democratic control (one member, one vote) * Limited liability * Profit distribution Disadvantages: * Possible conflict between members * Longer decision-making process * Participation of members needed for success * Extensive record keeping * Less incentive to invest additional capital

Saturday, September 28, 2019

Rather than being a medium for western culture alone, the internet Essay

Rather than being a medium for western culture alone, the internet actually helps promote and strengthen the societies - Essay Example Governance and Democratization Early this year, Egypt and parts of the Arab world experienced one of their most successful revolutions in history. This revolution was organized with the help of the internet and specifically social networking tools. The people of Egypt organized themselves and through proper coordination and communication, they were able to change their country in a manner never witnessed before in any country. This revolutionary event was seen by many as what can be achieved through people power. Without the internet the Egyptian revolution would probably have taken a very different route than it did. The Egyptians were able to push for proper leadership and their democratic rights because the internet empowered them to do so. Another country that has made major gains in the democratization process is China (Lagerkvist, 2010). The country’s leadership is slowly but surely becoming more democratic as citizens become more empowered to fight for their rights usin g information technology tools such as the internet. Through the internet, citizens in a country are able to know how they are being governed. Many governments have adopted the use of the internet in service dissemination. This means that citizens can access the services from the comfort of wherever they are. The internet also empowers the people to communicate more effectively with their leaders. They can give feedback on the kind of services they want and they can use the same technology to demand for changes where they deem fit to do so. In other words, the internet has enabled citizens in different countries keep track of how their governments are doing their work and this helps in the overall development of the nations (Kalathil and Boas, 2003). Learning and Development Education is key to development and this is evidenced by the rate at which countries having high literacy levels have developed. Many nations in Asia, Africa and South America have for a long time been classifie d at the bottom in terms of literacy. However, the situation is slowly changing as more and more people from these countries seek education in different ways. The internet has played a major role in revolutionalizing the learning and development in nations outside the West. Many learning institutions in these countries have incorporated online learning into their programmes (Schell, 2007). This makes learning more effective, thus giving students the kind of education they need to lead productive lives in future. Those seeking higher education do not have to travel long distances to do so. Renowned institutions in the west have high class programmes which they offer online. This makes it easy for individuals in other countries to access the education offered in these institutions from wherever they are. These improved educational opportunities empower societies in non-western countries to develop at the same level as their counterparts living in western nations (Howard and Jones, 200 4). Business and Economic Development Most third world countries have had to struggle with the problem of unemployment for a very long time. Many youths in these parts of the world had been without any meaningful source of income before the internet age. However, things have drastically changed for the better in terms of employment opportunities among the young

Friday, September 27, 2019

What effect did the Enlightenment and the Great Awakening have on life Essay

What effect did the Enlightenment and the Great Awakening have on life in British North America - Essay Example The natives were also very much concerned with their beliefs, authority of their tribal chiefs, the traditional responsibilities for an individual’s clan and their close relationship with the nature (Demos, 4). The English were trying to bring these natives from â€Å"darkness of heathenism† to Protestant Christianity, which could fill the savagery lives of these natives with bright light of English â€Å"civility†. However the transformation in the form of an awakening did not happen overnight. The English started to build villages, started plantation, trees were cut down and sawed to build houses, barns, furnishings, etc. They also built special places called â€Å"praying towns† for the inhabitants who converted to Protestants. But the British faced many natural hindrances like winter cold, crop blights, droughts and storms. Then there were epidemic diseases like small pox, measles, respiratory illnesses and typhus, which were brought by the European colonizers themselves also acted as crippling influence to their plans for creating a new civilization. It also created demographic losses and complications brewed up with ethnic, linguistic and religious differences. (Demos, 3) After much struggle when they finally built the colony, during the late 17th and 18th centuries, different cities of colonial America played a pivotal role as many of them were seaports and it enabled the Enlightenment movement of Europe to reach American soil.... The theory of Rational Christianity also emerged during this period. This Enlightenment process reached the American colonists a century later and during the late 1700 and early 1800 century the American colonists saw a key change. The British colonies were liberal in their outlook in dealing with different intellectual and religious challenges. During this period America saw many spiritual and religious revitalizations. It also challenged the divine right and role of religion. It enabled the American colonists to challenge the King as well as the divine right. This helped to raise common views between the North and South and this belief was preached across the races through North and South of the colonial America. It also stated that slavery is similar to sin. The people began to develop belief in themselves and the importance of the church and the clergymen diminished. Changes were observed with respect to the reducing significance of the sects. (The Great Awakening And Enlightenme nt In Colonial America). The period saw a growth in literacy and witnessed an increase in number of colleges. The impact of the Great Awakening in colonial America led to creation of many new colleges in order to educate â€Å"new light† ministers like – Princeton, Rutgers, Brown, etc. This enabled to create a rift between believes of the thinkers and it resulted in formation of two cults namely, â€Å"old lights† who believed in rational process and â€Å"new lights† who focused on the experience gathered from life. These religious challenges also strengthened political challenges to the authorities (CHAPTER FIVE: THE CULTURES OF COLONIAL NORTH AMERICA, 1700—1780). Many soldiers those who took part in the revolutionary war were â€Å"new light†

Thursday, September 26, 2019

In a well-organized Essay, respond to two of the following questions Essay

In a well-organized , respond to two of the following questions - Essay Example The First World War was triggered by both long-term and short-term factors and some of the long-term causes include alliance system1 particularly the long-standing alliances between central powers including Germany and Austria Hungary versus Triple Entente that comprised of Britain, France and Russia. Secondly, World War 1 was caused by imperialism, that is, most European countries wanted to expand their territory and some historian have described this war as an imperialistic struggle.2 Another long-term cause of the First World War is nationalism whereby, there were rivalries between European countries resulting from colonialism. Finally, arms race is also another triggering factor of World War 1 because Britain and Germany had the best navies during that period and so naval rivalry between the two countries played a significant role in the emergence of World War 1. In addition, there were also short-term causes of the First World War and these include Austria-Hungary’s attac k on Serbia among others. World War 1 had political, economic and social consequences, first, it led to the emergence of Versailles Treaty that stated that Germany had to pay reparations and disarm. More so, some countries started fighting for their independence. Economically, it led to worldwide depression, which lasted for years. Socially, it resulted to massive loss of lives, and left many individuals in Europe with home and food among others. The Second World War followed and it was the most widespread conflict that negatively affected the world. 3A number of factors including the Versailles Treaty that had imposed unfair conditions on Germany caused this war and this may have forced them to start the war. Secondly, the weakness of the League of Nations as it was not able to control aggressive actions of the axis powers when England and France embraced the policy of appeasement towards them.

Wednesday, September 25, 2019

How people with such different background can make friends with each Essay - 1

How people with such different background can make friends with each other - Essay Example Understandably, when one visits a new place, they are more likely to make a direct connection with those they share culture or background with since many friendships sprout on common grounds. Take my case for instance; when I first arrived in America, I was nervous and apprehensive about just about everything. I kept constantly reminding myself that I was a foreigner, and somehow this must have influenced my perception of how my fellow students, especially the Americans, saw me. As a result, it was easier to make friends with Chinese people – either the Chinese Americans or the Chinese people living in America. This was because around them, I did not feel very self-conscious, and I blended in much more easily; however, as I came to learn that with the benefit of research and personal experiences it can also be easy to make friends and interact with people from different cultures. Such interactions can be very rewarding and enlightening since one can learn a lot about different cultures; besides, with all our differences, every human being can find some similarly between themselves and anybody else as long as each of them shows interest in knowing the other. Interacting with new people in a new country by itself is a common experience; this is because each of you is in one way new to your present environment. After I moved into my house, I rarely spent much of my free time there, and every other weekend or when I had free time, I would go out visiting my Chinese friends or their families. In fact, in my first few days, I hardly spoke more than a few words to any of my flat mates, who were not Chinese, and there were a precious few of these. In a way, in my mind, I was still in China since I was actively avoiding any non-Chinese culture in what my American friend Chris later told me was a search for stability. However, one Sunday afternoon I was in my room browsing, and my computer crashed; I wondered what the

Tuesday, September 24, 2019

Post Assignment Example | Topics and Well Written Essays - 250 words

Post - Assignment Example On the same note, some questions were surprising, especially those that were out of context by regional and national boundaries. This is due to the fact that there are certain nature variables that may not be of interest to an individual but impacts significantly to nature. For instance, country interdependence is primarily viewed as an enterprising activity (Laposata & Pratte 355). However, ecological footprint has a different idea on the same matter and in the context of nature. The calculator asked about percentage of processed and packaged rather than locally grown food. This is because; the processing of packaging of food is characterized by activities that heighten humanity’s demands on nature than growing of food locally. This shows that an individual has demands on nature both locally and beyond borders, since processed and packaged foods are not necessarily locally produced. In the determining ecological footprint, the calculator should also take into account professional advice on humanity-nature relationships. In doing so, the results produced are likely to be more accurate, rather than point in time approximations of humanity’s demands on

Monday, September 23, 2019

E-business strategy and design exercise Assignment

E-business strategy and design exercise - Assignment Example The value proposition of the company has also been explained in this section. In the second section, few of the areas where improvement need of Amazon have been identified were assessed and correspondingly, suggestive measures have been recommended on the basis of the evaluations made in section 1. In the third and final section of the paper, the e-business strategies of Amazon along with its management issues have been explained. Introduction E-business has emerged as one of the pivotal concerns for every contemporary business that strives to mark its presence in the global realm and obtain competitive success over its long-run performance. In the present market scenario, most of the global companies have realized that with the adoption of the e-business strategy, they can develop their business model in a manner that satisfies the varying needs and diversified concerns of international business partners as well as customers. If the meaning of e-business is to be termed in general s ense, it can be justifiably described as the use of internet or the virtual space in the operational activities of the business to gain a leading position within the targeted market (Turban et al., 2010). When focusing on this subject matter, Amazon.com Inc has often been regarded as an example of best practices in its industry whereby its e-business model has been quite beneficial and productive in adding value to its services among its customers (Damani & Damani, 2007). Amazon, an American multinational, is one of the renowned and largest global e-commerce retailing companies. Amazon has been a pioneer in the application of e-commerce business model that runs its functions through virtual space entirely. It is not only involved in the selling of books and other products, but also renders due significance on gathering the valuable suggestions from the buyers so as to define its customer satisfaction and industrial leadership competencies. It records various movements of its buyers such as the number of visitors who visit its site and how much time do they spend on it while purchasing from a particular category of its product line. All these movements of the buyers are utilised by the company in order to analyse the buying behaviour of consumers in various targeted markets to identify its developmental needs along with its growth potentials. Through the advanced technologies of the e-business, Amazon has been successful in introducing the one stop shopping trend successfully (McGraw-Hill Education, 2013). Section 1 Effective technological tools Amazon has been operating with a mission and a vision to serve its customers as per their conveniences and in a productive manner for the company. Undoubtedly, in doing so, the company has to witness pressures from various international business forces that can be comprehensively addressed through the application of a PESTEL analysis framework. Political. From a critical point of view, it can be observed that because th e e-retail industry is yet in its developing phase within the global context, governmental interventions and political limitations bestowed on the industry as well as faced by Amazon correspondingly, is less. Subsequently, the international sale procedure of Amazon involves various risks mainly in terms of the requirement for import and export licensing that

Sunday, September 22, 2019

Extreme Ice Essay Example for Free

Extreme Ice Essay In this documentary film, â€Å"Extreme Ice,† produced by PBS TV, 2009, James and scientists shows how glacier ice is melting. James Balog, a photographer, wanted to document and help scientists to understand mountain monumental changes. So he surveyed the ice and went to the places such as Alaska, Green land, etc. The project team which called â€Å"Extreme ice† discovered that there were very serious problems. The sun was the most reason of ice melting. But now, such as Industrial revolution and fossil fuels output green house gases alter the planet. For example, Columbia bay where is the fastest melting ice in the world, the ice is going to be collapsed faster than before. Scientists eventually discover about the mystery of the fast-melting ice at Columbia Bay. They announced that high temperature create more water and the water is melting ice because high pressure water cracked ice open and collapse. So Dr. Tad Pfeffer who is the one of the researchers suspected that if mountain glaciers are continuous melting, then people like living in Asia could not drink water. Frozen ice core record also support the reason. They have periodical ice in National Ice Core Lab in Colorado and it can distinguish between bubbles and pack of air. Late 1990s, Greenland is the hardest so far. But when they visited there, they figured out so many water drained out and it goes booming ice. Approximately 100million people will see to exist the melting ice on coastal countries such as Florida, Bangladesh, and Vietnam. Thats because the film Extreme Ice might mean quickly disappearing the ice and land increasingly.

Saturday, September 21, 2019

What is evaluating Essay Example for Free

What is evaluating Essay Evaluation is an assessment of something or making an observation of the outcome whether good or bad. An example of evaluating is after the Year 8 disco, was the year 8 pupil’s filing out an evaluation form on how they thought the event went. There are many different ways to evaluate such as minutes of meeting, questionnaires, post-event papers and circulation list. Minutes of meeting Meetings normally have formal minutes attached to them or they have notes. When taking minutes of a meeting the information given and any actions that need to be taken are recorded so that what is needed to happen before the next meeting does. Minutes need to be told to the people attending ASAP so that they can look through them, check that it is accurate and carry out any actions if needed. The main advantage of minutes of meeting is that more of what is needed to be said is said this is good because everyone’s ideas can be shared. Another advantage of minutes of meeting is that everyone who is needed is there so that no one misses out on the information that has been given. The final advantage of minutes of meeting is the privacy, this is good because the information said will only be between the people who are present in the meeting. There are also disadvantages to minutes of meeting they are that everyone present in the meeting may all have disagreements this may lead to not having what is needed to be done, done. Another disadvantage of minutes of meeting is that people present may be shy and won’t feel like sharing their ideas. The final disadvantage to minutes of meeting is that the information given at the meeting may be said to quick so that everyone cannot be taken down in time. When planning the Year 8 disco we wrote down the minutes during the meeting. This helped us as a group because everyone knew what they needed to do before the next meeting. For example as the event manager I would inform my deputy manager when they need to go into the Year 8 assembly to inform them what is happening, when it is happening and to give them the information needed to them about the event. If we did not do this then everyone would be confused on what they had to do to prepare for the event, and also everything that needed to be taken care of so that event was a success was done. Questionnaires A questionnaire is research which involves a number of different questions to gather information from the people who are filling it in. Questionnaires are designed as a way to find out what people are thinking. An advantage of questionnaires is that it is very practical because it is quick to collect information from the people filling out the questionnaire. Another advantage of questionnaires is that the same questions is asked to everyone filling the questionnaire out so easy to sum up. The final advantage to questionnaires is that large information can be collected. There are also some disadvantages to questionnaires which is that there is no way of telling how much though someone who is filling the questionnaire out has put it. Another disadvantage is that the person filling it out may forget what has happened to fill it out so it won’t be reliable. The final disadvantage to questionnaires is that there is no way to tell how truthful a respondent is being. As a way of evaluating the Year 8 pupil’s event, we created questionnaires for the Year 8 pupils who attended to fill in. This helped us because the information we had been given back told us why they enjoyed the event and what they thought could have gone better. It was important for us to create questionnaires for the year 8 pupils, so we know how well our planning of the event went, and also to know what went wrong. It also helped us to know what to do and what not to do if planning another event. The questionnaires advantage was the way it was set out, it was set out in a way where if any of the Year 8’s had a lot of feedback from one question then there was space for them to write it down. Post-event report Most conferences and exhibitions usepost post-event reports contain details of what the event will be like, and what it has to offer. Because of post-event reports it is becoming very common to share post-event reports For planning the Year 8 pupils event we did not use any post-event reports because it would not work as we invited all of the Year 8 pupils to the event. If we did use post-event reports than it would be useful to us as it would be away of informing the Year 8 pupils what the event is and what sort of stuff is on offer at the event. Circulation lists A circulation list is a way of giving out information to delegates who attend the past event. The event is a useful way of engaging delegates to attend more events by the holder. Because of this it is becoming more often to have e-lists, or email lists that can be used to send information to the delegates. There are more ways that event organisers can put a circulation list which is through a website with a password so that previous delegates can access. An advantage of circulation list is that you have a list of people who are certain to attend all other events which are being held by you. However a disadvantage to circulation list is that it takes time having to create a website to make an e-list. When planning the Year 8 pupils event we did not use a circulation list invite a certain number of pupils to the event. If we did use circulation lists then it would be useful because if we had another chance to plan an event, then there would be a number of pupils who would definitely attend. Overall, evaluating can contribute to future planning of events by many different ways. Using questionnaires is the easiest way to evaluate information. This is because instead of evaluating at the end of something you can also evaluate at the beginning and find out information of what people want. By doing this you would find out information about what the attendees are looking for in the event, by knowing this planning the event will be easy because you know what is wanted. Using a circulation list as part of your evaluation is also good because it means that you already have people who are certain to attend. This will mean not having to worry about no one showing up. Taking minutes at meetings is very important so that everyone is participating knows what they are doing and everyone knows what they need to do by the next meeting. If no minutes at meetings were taken than the people planning the event will all get confused on what is needed to be done, which means nothing will be done to make sure the event is successful. In conclusion to evaluation it is very important to do after anything that has been done. This is because it informs you on how well something happened and how it can be improved. It was important we did an evaluation for the Year 8 event because we wanted to know how the pupils attended found it, if they enjoyed it or if they did not. Evaluation helps a lot because if wanting to plan another event you will know what to do and what not to do for people to enjoy.

Friday, September 20, 2019

Role of Weak Attractions in Macromolecular Structure

Role of Weak Attractions in Macromolecular Structure Weak attractions in aqueous system?  Hydrogen bonding in water. Crucial role of weak attractions in macromolecular structure  and function. Muhammad Sanain Javed Group A Water is also known as universal solvent because it is the only solvent which mostly use in almost every reaction. There are many types of weak attractions which are present in aqueous system. The weak attractions which are present in the aqueous system are: Hydrogen Bonding Hydrophobic forces of attractions van der Waals forces of attractions Electrostatic forces of attractions Hydrogen Bonding: First of all we will discuss about hydrogen bonding which is present in the aqueous system. Oxygen is more electronegative element as compared to the hydrogen atom, so in this way we can say that the water is a polar molecule. So that there will be dipole-dipole attractions present between partial positively charged hydrogen atom and partial negatively charged oxygen atom. So that we can say that the hydrogen bonding is something more than that of simple dipole-dipole forces. The oxygen atom has two lone pairs. While on the other hand hydrogen has sufficient partial positive charge. In this way both the hydrogen atoms present in the water molecules produce strong electric field due to its small sizes. So that the other oxygen atoms, may be of other molecules, will get link to the hydrogen atoms by means of coordinate covalent bond, using one of its lone pair of electrons. Thus the loose bond is formed, in the result, which is definitely stronger than that of simple dipole -dipole attractions. Because of the small size of hydrogen atom it can take part in this type of bonding. This bonding acts as a bridge between two electronegative oxygen atoms. So that we can say that the hydrogen bonding is the electrostatic force of attraction between a highly electronegative atom and partial positively charged hydrogen atom. Hydrogen bonding plays very important role in the water. We can say that it is the blessing of Allah. As the molecule of water have tetrahedral structure. Two lone pairs of electrons on oxygen atoms occupy two corners of the tetrahedron. In case of liquid state the molecules of water are extensively bonded with each other but these associations are break, just minute to minute because the mobility of molecules of water. When the temperature of the water decreases up to a limited extent then the ice is formed and the and the molecules of water become more and more regular and the regularity of water molecules extends through-out the whole structure of water. So in this way the empty space are created between in the whole structure. When the water freezes it occupies 9% more space as compared to the original water. So in this way its density decreases and ice floats on the surface of the water. The structure is just like to the structure of diamond because each atom of carbon in diamon d is at the center of tetrahedron just like the atoms of oxygen of water molecule present in the ice. The lower density of ice at the temperature of 0 degree helps the water to float on the surface of water from upward to downward direction. When the water attains the temperature of 4C by the fall of temperature in the surrounding it starts to freezes. As the temperature of the surrounding more falls, the water at its surface become less dense. In this way the water on the surface will freezes and animals underlying he surface of the ice will survive. Hydrophobic Attractions: Another important attraction present in the aqueous system is the hydrophobic attraction which is in fact the self association attraction present in the non polar molecules sometimes the hydrophobic attractions are incorrectly referred as hydrophobic bonds. Hydrophobic forces of attractions can easily be described as the interaction between the water and the hydrophobes. This can be explained as low water soluble molecules so in this way we can say that these are the non polar molecules having long chain carbon atoms and some alkyl groups which do not react with the water molecules. Electrostatic forces of attractions: Electrostatic forces of attractions are also present in the aqueous system. This force of attraction is present between the atoms or molecules having opposite charges. These types of forces are only exist in the aqueous solutions so sometimes these are also known as salt bridge. Salt bridge is referred as the electrostatic forces of attractions which are present between oppositely charged groups present within or between the bio-molecules. The strength of the salt bridge can be compared with the strength of the hydrogen bonding but act over larger distance. In this way they also facilitate the attractions of charged particles with the nucleic acids in aqueous system. Van der Waals forces: Van der Waals forces of attractions are also present in the aqueous system. This type of weak forces arises due to attraction between transient dipoles which are produce by the rapid movement of free electrons present in the atom or a molecule. These forces are much weaker than that of hydrogen bonding but on the other hand they are numerous, van der Waals force of attraction decreases as the sixth power of the distance separating atoms. So that due to this reason and due to weak force the van der Waals forces act over very short distance may be up to 2 to 4 aungstrom. Van der Waals forces contain two components one of them is the attractive forces which are commonly known as London dispersion forces. These attractive forces depend on the polarizability of the molecule or an atom. While on the other hand repulsive forces are also present which are commonly known as steric repulsion. This force of repulsion depends on the size of the atom. The force of attractions dominates almost at the longer distance. It is almost about 0.4 nm to 0.7 nm while on the other hand the repulsion dominates at very shorter distance. Van der Waals forces are very weak force and it can easily be broke. We can also say that this is a universal type of attractive force because it can be generated easily between two molecules which are near to each other due to the rapid movement of their electrons. Crucial role of weak attractions in macromolecules: Weak attractions are crucial to macromolecular structure and functions because all the non covalent interactions such as hydrophobic attractions, ionic attractions and van-der Waals attractions are much weaker than that of the covalent attractions. Hydrophobic attractions are also much weaker than that of covalent attractions although they are highly strengthened by a highly polar solvent while on the other hand the hydrogen bonding may be compare able with the covalent bonding but the hydrogen bonding is always less stronger than that of the covalent bonding. All these four types of bonding such as hydrophobic attractions, ionic attractions, hydrogen bonding and van-der Waals forces of attractions are present in the aqueous system. The combined effect of all these four attractions play very important role in the formation of structure of the macromolecule. For example if we look upon the structure of the proteins, DNA and RNA then we can easily see that these bonding specially hydrogen bonding plays very important role in the formation of structure of the macromolecules. More these weak attractions present in the macromolecule hence the more will be the stability of the macromolecule. This shows the combine effect of the weak attractions in the structure of macromolecule. In case of proteins or even in case of nucleotides all the base pairs are attached with the help of these weak attractions such as hydrogen binding. If we see the attachment of adenine and thymine then we can easily observed that these are combined with each other with t he help of two hydrogen bonds while on the other hand if we observe the attachment of guanine with cytosine then easily observe that these are also combined with the help of three hydrogen bonds. While in case of proteins two polypeptides are also combined with each other by the help of hydrogen bonding but only at specific sites. In case of antigen antibody complex formation hydrogen bonding also plays very important role because antigen binds with the antibody with the help of hydrogen bond formation. Other weak attractions are also present in the macromolecules. In case of the enzyme catalytic reactions, when the substrate binds with the catalytic site of enzyme then the energy produced in this reaction is used the catalysis of the bio molecule. The substrate binds with the active sites of enzyme is also due to the formation of weak forces of attractions in the aqueous system. The binding of hormone or a neurotransmitter with the cellular receptor is also due to these weak forces of attractions. When we see the structure of the protein such as hemoglobin then we can easily see that there are many water molecules which are tightly bounded and they look as the part of that protein. Same is true for the DNA or RNA so that in this way we can see that water it self and there related weak attractions play very important role in the stability of the macromolecule. In this way we can say that the weak forces of attractions plays very important role in the stability of the macromolecules. So we can say that without these weak attractions in aqueous system the stability of the macromolecule must be impossible.