Consists of the explanations of the basics of SQL and commands of SQL.Helpful for II PU NCERT students and also degree studeents to understand some basic things.
in this presentation the commands let you help to understand the basic of the database system software. how to retrieve data, how to feed data and manipulate it very efficiently by using this commands.
This document provides an introduction to SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. The key points covered include:
- SQL lets you perform queries against a database to retrieve, insert, update, and delete data. It can also be used to create and modify database structures.
- Common SQL commands covered are SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE.
- Additional SQL concepts explained are data types, WHERE clauses, ORDER BY clauses, GROUP BY clauses, and JOIN operations.
- RDBMS systems like MySQL, SQL Server, Oracle, etc. use SQL to communicate with the databases they manage.
This document provides an introduction to SQL and relational database concepts. It explains that SQL is used to manipulate and retrieve data from relational databases. It also outlines the main SQL commands: DDL for data definition, DML for data manipulation, DCL for data control, and DQL for data queries. Key relational database concepts like tables, records, columns, and relationships are defined. Constraints, data types and integrity are discussed. Examples are provided for SQL statements like CREATE, INSERT, UPDATE, DELETE, and SELECT.
SQL is a standard language for accessing and manipulating databases. It allows users to retrieve, insert, update, and delete data as well as create new databases and tables. Common SQL statements include SELECT, UPDATE, DELETE, and INSERT. SQL uses clauses, operators, and wildcards to filter records based on conditions. Some key points are that SQL is an ANSI standard but different versions exist, it allows querying and modifying data in databases, and is essential for interacting with relational database systems.
SQL - Structured query language introductionSmriti Jain
SQL is a language used to define, manipulate, and control relational databases. It has four main components: DDL for defining schemas; DML for manipulating data within schemas; DCL for controlling access privileges; and DQL for querying data. Some key SQL concepts covered include data definition using CREATE, ALTER, DROP statements; data manipulation using SELECT, INSERT, UPDATE, DELETE; and joining data across tables using conditions. Advanced topics include views, aggregation, subqueries, and modifying databases.
SQL is a language used to communicate with databases and manage data. It allows users to create, update, and retrieve data from databases. The document outlines the history of SQL and its evolution over time. It also describes key SQL concepts like data types, commands, primary keys, database normalization, and techniques for ensuring data integrity.
SQL is a standard language for querying and manipulating data in relational databases. It contains five categories of statements: data definition language (DDL) for defining data structure, data manipulation language (DML) for managing data, data control language (DCL) for privileges, transaction control statements for transactions, and session control statements for sessions. Common DDL commands include CREATE, ALTER, and DROP for databases and tables. Common DML commands include SELECT, INSERT, UPDATE, and DELETE for querying and modifying data. Joins are used to combine data from two or more tables.
Structured Query Language (SQL) is a query language that allows users to specify conditions to retrieve data from a database. SQL queries select rows from database tables that satisfy specified conditions. The results are output in a table format. Common SQL clauses include SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, and INTO to output results to a table, cursor, file or printer. SQL can perform queries on single or multiple related tables through joins.
This document provides an overview of SQL programming including:
- A brief history of SQL and how it has evolved over time.
- Key SQL fundamentals like database structures, tables, relationships, and normalization.
- How to define and modify database structures using commands like CREATE, ALTER, DROP.
- How to manipulate data using INSERT, UPDATE, DELETE, and transactions.
- How to retrieve data using SELECT statements, joins, and other techniques.
- How to aggregate data using functions like SUM, AVG, MAX, MIN, and COUNT.
- Additional topics covered include subqueries, views, and resources for further learning.
SQL language includes four primary statement types: DML, DDL, DCL, and TCL. DML statements manipulate data within tables using operations like SELECT, INSERT, UPDATE, and DELETE. DDL statements define and modify database schema using commands like CREATE, ALTER, and DROP. DCL statements control user access privileges with GRANT and REVOKE. TCL statements manage transactions with COMMIT, ROLLBACK, and SAVEPOINT to maintain data integrity.
This document provides information about SQL queries and joins. It begins by introducing SQL (Structured Query Language) which is used to communicate with databases and retrieve required information. It describes the basic CRUD (Create, Read, Update, Delete) functions of SQL. It then discusses different types of SQL queries - aggregate function queries, scalar function queries, and join queries. It provides the syntax and explanation of inner joins, outer joins (left, right, full) which are used to query data from multiple tables based on relationships between columns. The document is presented by Hammad, Bilal and Awais.
Data Definition Language (DDL), Data Definition Language (DDL), Data Manipulation Language (DML) , Transaction Control Language (TCL) , Data Control Language (DCL) - , SQL Constraints
SQL is a programming language used to manage data in relational database systems. It can be used to create, query, update, and modify relational databases. SQL comprises both data definition and data manipulation languages that allow users to define and modify database schemas as well as store, retrieve, and manage data within databases. Some key advantages of SQL include high speed for retrieving large amounts of data, adherence to well-defined standards, and not requiring coding to manage database systems.
Presentation slides of Sequence Query Language (SQL)Punjab University
SQL is a language used to communicate with and perform operations on relational database management systems (RDBMS). The document outlines what SQL is, what it can do, important SQL commands like SELECT, INSERT, UPDATE and DELETE, how to create and drop databases and tables, and key concepts like primary keys, foreign keys, and constraints. SQL allows users to retrieve, manipulate and transform data stored in an RDBMS through statements that include keywords, clauses, aggregates, expressions, identifiers, parameters, and operators.
This presentation is on SQL constraints. This presentation was used by me in my YouTube vlog on SQL constraints. Vlog link: https://youtu.be/E94YFmATqb4
Joins in SQL are used to combine data from two or more tables based on common columns between them. There are several types of joins, including inner joins, outer joins, and cross joins. Inner joins return rows that match between tables, outer joins return all rows including non-matching rows, and cross joins return the cartesian product between tables.
Integrity constraints are rules used to maintain data quality and ensure accuracy in a relational database. The main types of integrity constraints are domain constraints, which define valid value sets for attributes; NOT NULL constraints, which enforce non-null values; UNIQUE constraints, which require unique values; and CHECK constraints, which specify value ranges. Referential integrity links data between tables through foreign keys, preventing orphaned records. Integrity constraints are enforced by the database to guard against accidental data damage.
This document provides an overview of MySQL, a relational database management system that uses SQL. It discusses the different languages used in SQL - Data Definition Language (DDL) for creating and modifying database objects, Data Manipulation Language (DML) for inserting, updating, selecting and deleting data, Data Control Language (DCL) for granting and revoking user privileges, and Transaction Control Language (TCL) for managing transactions. Each section provides examples of key commands used for each language type and their purposes.
Structured Query Language
SQL Commands:
• The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE and DROP
This document summarizes the main DML (Data Manipulation Language) commands used for editing data in SQL: INSERT for adding new rows, UPDATE for changing existing rows, and DELETE for removing rows. It provides the syntax and examples for each command, including using default values, assigning null values, and specifying conditions with WHERE clauses.
The document discusses SQL database commands including DDL commands like CREATE, ALTER, DROP and TRUNCATE used to build and modify database structures. It describes using CREATE TABLE to generate tables with data types like VARCHAR2, CHAR, NUMBER, DATE and LOB types. ALTER TABLE adds, deletes or modifies columns and constraints. DROP TABLE deletes tables. DML commands like INSERT INTO, UPDATE and DELETE are used to add, modify and remove data from tables.
This document discusses SQL commands for creating tables, adding data, and enforcing integrity constraints. It covers the core SQL commands: DDL for defining schema, DML for manipulating data, DCL for controlling access, DQL for querying data, and TCL for transactions. Specific topics summarized include data types, primary keys, foreign keys, indexes, views, stored procedures, functions and triggers. Integrity constraints like NOT NULL, UNIQUE, CHECK, DEFAULT are explained. The document also covers SQL queries with filtering, sorting, patterns and ranges. Authorization using GRANT and REVOKE commands is briefly covered.
Aggregate functions are functions that take a collection of values as input and return a single value.The ISO standard defines five (5) aggregate functions namely :-
1) COUNT
2) SUM
3) AVG
4) MIN
5) MAX
1.COUNT Function
The COUNT function returns the total number of values in the specified field. It works on both numeric and non-numeric data types. All aggregate functions by default exclude nulls values before working on the data.
MIN function
The MIN function returns the smallest value in the specified table field.
2.MAX function
Just as the name suggests, the MAX function is the opposite of the MIN function. It returns the largest value from the specified table field.
3.SUM function
Suppose we want a report that gives total amount of payments made so far. We can use the MySQL SUM function which returns the sum of all the values in the specified column. SUM works on numeric fields only. Null values are excluded from the result returned.
4.AVG function
MySQL AVG function returns the average of the values in a specified column. Just like the SUM function, it works only on numeric data types.
5.MIN function
The MIN function returns the smallest value in the specified table field.
The document discusses various types of constraints in SQL including column level constraints like NOT NULL, UNIQUE, DEFAULT, and CHECK constraints as well as table level constraints like PRIMARY KEY and FOREIGN KEY. It provides examples of how to define these constraints when creating or altering tables and explains how each constraint enforces integrity rules and data validation. Constraints are used to impose rules on data values and relationships between columns and tables.
The document discusses different types of SQL joins, including inner joins, outer joins, equi joins, non-equi joins, natural joins, cross joins, left joins, right joins, full outer joins, and self joins. It provides the syntax and examples for each type of join. It also discusses joining tables through referential integrity, where a foreign key references a primary key in another table to link the tables together.
MySQL is a popular and freely available open-source relational database management system (RDBMS). It stores data in tables and relationships between data are also stored in tables. MySQL uses SQL and works on many operating systems. It has commands for data definition (CREATE, ALTER, DROP), data manipulation (SELECT, INSERT, UPDATE, DELETE), transaction control (COMMIT, ROLLBACK), and data access control (GRANT, REVOKE). Joins allow retrieving data from multiple tables by linking rows together. Common join types are inner joins, outer joins, and self joins.
SQL.pptx for the begineers and good knowPavithSingh
SQL is a standard language for storing, manipulating and retrieving data in relational databases. It allows users to define database structures, create tables, establish relationships between tables and query data. Popular uses of SQL include inserting, updating, deleting and selecting data from database tables. SQL is widely used across industries for managing large datasets efficiently in relational database management systems like MySQL, Oracle and SQL Server.
This document provides an overview of the relational database language SQL. It begins by defining basic data types in SQL like numbers, characters, dates and times. It then discusses the SQL Data Definition Language (DDL) which is used to define and modify database schemas and objects. Specific DDL commands like CREATE, DROP, ALTER, TRUNCATE and RENAME are described. The document also covers the SQL Data Manipulation Language (DML) including commands for queries, inserts, updates and deletes. Additional topics discussed include constraints, indexes, views and the advantages of SQL.
This document provides an overview of SQL programming including:
- A brief history of SQL and how it has evolved over time.
- Key SQL fundamentals like database structures, tables, relationships, and normalization.
- How to define and modify database structures using commands like CREATE, ALTER, DROP.
- How to manipulate data using INSERT, UPDATE, DELETE, and transactions.
- How to retrieve data using SELECT statements, joins, and other techniques.
- How to aggregate data using functions like SUM, AVG, MAX, MIN, and COUNT.
- Additional topics covered include subqueries, views, and resources for further learning.
SQL language includes four primary statement types: DML, DDL, DCL, and TCL. DML statements manipulate data within tables using operations like SELECT, INSERT, UPDATE, and DELETE. DDL statements define and modify database schema using commands like CREATE, ALTER, and DROP. DCL statements control user access privileges with GRANT and REVOKE. TCL statements manage transactions with COMMIT, ROLLBACK, and SAVEPOINT to maintain data integrity.
This document provides information about SQL queries and joins. It begins by introducing SQL (Structured Query Language) which is used to communicate with databases and retrieve required information. It describes the basic CRUD (Create, Read, Update, Delete) functions of SQL. It then discusses different types of SQL queries - aggregate function queries, scalar function queries, and join queries. It provides the syntax and explanation of inner joins, outer joins (left, right, full) which are used to query data from multiple tables based on relationships between columns. The document is presented by Hammad, Bilal and Awais.
Data Definition Language (DDL), Data Definition Language (DDL), Data Manipulation Language (DML) , Transaction Control Language (TCL) , Data Control Language (DCL) - , SQL Constraints
SQL is a programming language used to manage data in relational database systems. It can be used to create, query, update, and modify relational databases. SQL comprises both data definition and data manipulation languages that allow users to define and modify database schemas as well as store, retrieve, and manage data within databases. Some key advantages of SQL include high speed for retrieving large amounts of data, adherence to well-defined standards, and not requiring coding to manage database systems.
Presentation slides of Sequence Query Language (SQL)Punjab University
SQL is a language used to communicate with and perform operations on relational database management systems (RDBMS). The document outlines what SQL is, what it can do, important SQL commands like SELECT, INSERT, UPDATE and DELETE, how to create and drop databases and tables, and key concepts like primary keys, foreign keys, and constraints. SQL allows users to retrieve, manipulate and transform data stored in an RDBMS through statements that include keywords, clauses, aggregates, expressions, identifiers, parameters, and operators.
This presentation is on SQL constraints. This presentation was used by me in my YouTube vlog on SQL constraints. Vlog link: https://youtu.be/E94YFmATqb4
Joins in SQL are used to combine data from two or more tables based on common columns between them. There are several types of joins, including inner joins, outer joins, and cross joins. Inner joins return rows that match between tables, outer joins return all rows including non-matching rows, and cross joins return the cartesian product between tables.
Integrity constraints are rules used to maintain data quality and ensure accuracy in a relational database. The main types of integrity constraints are domain constraints, which define valid value sets for attributes; NOT NULL constraints, which enforce non-null values; UNIQUE constraints, which require unique values; and CHECK constraints, which specify value ranges. Referential integrity links data between tables through foreign keys, preventing orphaned records. Integrity constraints are enforced by the database to guard against accidental data damage.
This document provides an overview of MySQL, a relational database management system that uses SQL. It discusses the different languages used in SQL - Data Definition Language (DDL) for creating and modifying database objects, Data Manipulation Language (DML) for inserting, updating, selecting and deleting data, Data Control Language (DCL) for granting and revoking user privileges, and Transaction Control Language (TCL) for managing transactions. Each section provides examples of key commands used for each language type and their purposes.
Structured Query Language
SQL Commands:
• The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE and DROP
This document summarizes the main DML (Data Manipulation Language) commands used for editing data in SQL: INSERT for adding new rows, UPDATE for changing existing rows, and DELETE for removing rows. It provides the syntax and examples for each command, including using default values, assigning null values, and specifying conditions with WHERE clauses.
The document discusses SQL database commands including DDL commands like CREATE, ALTER, DROP and TRUNCATE used to build and modify database structures. It describes using CREATE TABLE to generate tables with data types like VARCHAR2, CHAR, NUMBER, DATE and LOB types. ALTER TABLE adds, deletes or modifies columns and constraints. DROP TABLE deletes tables. DML commands like INSERT INTO, UPDATE and DELETE are used to add, modify and remove data from tables.
This document discusses SQL commands for creating tables, adding data, and enforcing integrity constraints. It covers the core SQL commands: DDL for defining schema, DML for manipulating data, DCL for controlling access, DQL for querying data, and TCL for transactions. Specific topics summarized include data types, primary keys, foreign keys, indexes, views, stored procedures, functions and triggers. Integrity constraints like NOT NULL, UNIQUE, CHECK, DEFAULT are explained. The document also covers SQL queries with filtering, sorting, patterns and ranges. Authorization using GRANT and REVOKE commands is briefly covered.
Aggregate functions are functions that take a collection of values as input and return a single value.The ISO standard defines five (5) aggregate functions namely :-
1) COUNT
2) SUM
3) AVG
4) MIN
5) MAX
1.COUNT Function
The COUNT function returns the total number of values in the specified field. It works on both numeric and non-numeric data types. All aggregate functions by default exclude nulls values before working on the data.
MIN function
The MIN function returns the smallest value in the specified table field.
2.MAX function
Just as the name suggests, the MAX function is the opposite of the MIN function. It returns the largest value from the specified table field.
3.SUM function
Suppose we want a report that gives total amount of payments made so far. We can use the MySQL SUM function which returns the sum of all the values in the specified column. SUM works on numeric fields only. Null values are excluded from the result returned.
4.AVG function
MySQL AVG function returns the average of the values in a specified column. Just like the SUM function, it works only on numeric data types.
5.MIN function
The MIN function returns the smallest value in the specified table field.
The document discusses various types of constraints in SQL including column level constraints like NOT NULL, UNIQUE, DEFAULT, and CHECK constraints as well as table level constraints like PRIMARY KEY and FOREIGN KEY. It provides examples of how to define these constraints when creating or altering tables and explains how each constraint enforces integrity rules and data validation. Constraints are used to impose rules on data values and relationships between columns and tables.
The document discusses different types of SQL joins, including inner joins, outer joins, equi joins, non-equi joins, natural joins, cross joins, left joins, right joins, full outer joins, and self joins. It provides the syntax and examples for each type of join. It also discusses joining tables through referential integrity, where a foreign key references a primary key in another table to link the tables together.
MySQL is a popular and freely available open-source relational database management system (RDBMS). It stores data in tables and relationships between data are also stored in tables. MySQL uses SQL and works on many operating systems. It has commands for data definition (CREATE, ALTER, DROP), data manipulation (SELECT, INSERT, UPDATE, DELETE), transaction control (COMMIT, ROLLBACK), and data access control (GRANT, REVOKE). Joins allow retrieving data from multiple tables by linking rows together. Common join types are inner joins, outer joins, and self joins.
SQL.pptx for the begineers and good knowPavithSingh
SQL is a standard language for storing, manipulating and retrieving data in relational databases. It allows users to define database structures, create tables, establish relationships between tables and query data. Popular uses of SQL include inserting, updating, deleting and selecting data from database tables. SQL is widely used across industries for managing large datasets efficiently in relational database management systems like MySQL, Oracle and SQL Server.
This document provides an overview of the relational database language SQL. It begins by defining basic data types in SQL like numbers, characters, dates and times. It then discusses the SQL Data Definition Language (DDL) which is used to define and modify database schemas and objects. Specific DDL commands like CREATE, DROP, ALTER, TRUNCATE and RENAME are described. The document also covers the SQL Data Manipulation Language (DML) including commands for queries, inserts, updates and deletes. Additional topics discussed include constraints, indexes, views and the advantages of SQL.
This document provides an overview of SQL commands and concepts. It begins by defining SQL and its uses for manipulating and retrieving data from relational databases. It then covers the main SQL commands: DDL for schema definition, DML for data manipulation, DCL for security, and TCL for transactions. Common data types are also defined. The document proceeds to explain SQL syntax and components like keywords, identifiers, and clauses. Specific SQL commands like CREATE TABLE, ALTER TABLE, DROP TABLE, INSERT, UPDATE, DELETE, SELECT are described along with examples. Logical and comparison operators are defined. The WHERE clause for filtering rows is explained.
This document provides an overview of SQL commands and concepts. It begins by defining SQL and its purpose for manipulating data in relational database systems. It then covers the main SQL commands categorized as DDL, DML, DCL, and TCL. Examples are provided for commands like CREATE TABLE, ALTER TABLE, INSERT, UPDATE, DELETE, SELECT and more. Logical and comparison operators are also defined. The document concludes with examples of implementing SQL commands to interact with database tables.
This document provides an overview of structured query language (SQL) including:
- SQL is used to store, manipulate and retrieve data from relational databases.
- It allows users to access, describe, define, embed, create, drop, and set permissions on database objects.
- When executing SQL commands, a query dispatcher and optimization engines determine the best way to carry out the request by figuring out how to interpret the task.
- SQL defines constraints like NOT NULL, DEFAULT, UNIQUE, PRIMARY KEY, FOREIGN KEY, and CHECK to maintain data integrity.
- It supports various data types including character, numeric, date/time, large object, and rowid data types.
- SQL statements are
This document provides an overview of tools for PL/SQL development like Oracle SQL Developer and SQL*Plus. It also summarizes key SQL concepts including data definition, manipulation, retrieval, and security commands. Basic SQL elements such as constants, operators, conditions, data types, comments, and variables are also defined.
This document provides an overview of SQL and PL/SQL concepts including data definition language (DDL), data manipulation language (DML), data control language (DCL), and transaction control language (TCL). It discusses SQL commands to create, modify and delete database objects as well as manipulate data. It also covers PL/SQL concepts such as stored procedures, functions, cursors and triggers. Indexes and their use in improving query performance are also summarized.
The document provides an overview of SQL Server training. It defines data and databases, explaining that a collection of data leads to a database. It also discusses database management systems (DBMS), explaining that a DBMS allows users to create, read, update and delete data in an organized way. The document also covers types of databases like hierarchical, network, relational and object-oriented databases. It focuses on relational database management systems (RDBMS) and discusses advantages like storing data uniquely and performing complex queries. Finally, it discusses Microsoft SQL Server in more detail.
SQL is a language used to interface with relational databases. It allows users to create, modify and delete database structures and data. Key features include using commands like SELECT, INSERT, UPDATE and DELETE. SQL follows specific syntax rules and uses delimiters like semicolons. It supports various data types and operators to perform queries and manipulations. Common SQL statements are used for data definition (DDL), data manipulation (DML), and data control (DCL).
The document provides information about SQL (Structured Query Language). It defines SQL, describes what it is used for, lists some major RDBMS systems that use SQL, and explains that SQL allows users to query databases using English-like statements. It also discusses SQL basics like data definition language, data manipulation language, data control language, transaction control language, and data query language. Examples of SQL commands are provided for each along with explanations.
SQL is a language that provides an interface to a relational database system.
SQL is developed by IBM in 1970s and it is a defacto standard as well as ISO & ANSI standard
SQL also supports DML for insert, update & delete operations and DDL for creating and modifying tables and other database structures.
The document discusses various components and concepts related to database management systems (DBMS). It defines a database as a collection of related data organized for easy access, management, and updating. It describes the main components of a DBMS as hardware, software, data, procedures, and database access language. It also discusses key DBMS concepts like data definition language, data manipulation language, functions, constraints, and having clause.
This document provides an overview of SQL (Structured Query Language). It discusses that SQL is used to define, manipulate, and control data in a relational database. It can define database schemas, insert, modify, retrieve, and delete data from databases. The document also provides a brief history of SQL and describes its main components like DDL, DML, and DCL. It provides examples of common SQL commands and functions. Finally, it discusses SQL Plus which is a basic Oracle utility used to interact with databases through a command line interface.
The document discusses various SQL commands and concepts. It begins by defining SQL and explaining its purpose and architecture. It then covers the different types of SQL commands - DDL, DML, DCL, and TCL. Specific commands like CREATE, SELECT, INSERT, UPDATE and DELETE are discussed along with their uses. Data types like NUMBER, CHAR, VARCHAR, DATE and LONG are also explained. The document provides examples of creating a table and altering it using SQL statements.
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...Celine George
Analytic accounts are used to track and manage financial transactions related to specific projects, departments, or business units. They provide detailed insights into costs and revenues at a granular level, independent of the main accounting system. This helps to better understand profitability, performance, and resource allocation, making it easier to make informed financial decisions and strategic planning.
INTRO TO STATISTICS
INTRO TO SPSS INTERFACE
CLEANING MULTIPLE CHOICE RESPONSE DATA WITH EXCEL
ANALYZING MULTIPLE CHOICE RESPONSE DATA
INTERPRETATION
Q & A SESSION
PRACTICAL HANDS-ON ACTIVITY
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsDrNidhiAgarwal
Unemployment is a major social problem, by which not only rural population have suffered but also urban population are suffered while they are literate having good qualification.The evil consequences like poverty, frustration, revolution
result in crimes and social disorganization. Therefore, it is
necessary that all efforts be made to have maximum.
employment facilities. The Government of India has already
announced that the question of payment of unemployment
allowance cannot be considered in India
Envenomation is the process by which venom is injected by the bite or sting of a venomous animal such as a snake, scorpion, spider, or insect. Arthropod bite is nothing but a sharp bite or sting by ants, fruit flies, bees, beetles, moths, or hornets. Though not a serious condition, arthropod bite can be extremely painful, with redness and mild to severe swelling around the site of the bite
The ever evoilving world of science /7th class science curiosity /samyans aca...Sandeep Swamy
The Ever-Evolving World of
Science
Welcome to Grade 7 Science4not just a textbook with facts, but an invitation to
question, experiment, and explore the beautiful world we live in. From tiny cells
inside a leaf to the movement of celestial bodies, from household materials to
underground water flows, this journey will challenge your thinking and expand
your knowledge.
Notice something special about this book? The page numbers follow the playful
flight of a butterfly and a soaring paper plane! Just as these objects take flight,
learning soars when curiosity leads the way. Simple observations, like paper
planes, have inspired scientific explorations throughout history.
How to manage Multiple Warehouses for multiple floors in odoo point of saleCeline George
The need for multiple warehouses and effective inventory management is crucial for companies aiming to optimize their operations, enhance customer satisfaction, and maintain a competitive edge.
*Metamorphosis* is a biological process where an animal undergoes a dramatic transformation from a juvenile or larval stage to a adult stage, often involving significant changes in form and structure. This process is commonly seen in insects, amphibians, and some other animals.
How to Subscribe Newsletter From Odoo 18 WebsiteCeline George
Newsletter is a powerful tool that effectively manage the email marketing . It allows us to send professional looking HTML formatted emails. Under the Mailing Lists in Email Marketing we can find all the Newsletter.
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetSritoma Majumder
Introduction
All the materials around us are made up of elements. These elements can be broadly divided into two major groups:
Metals
Non-Metals
Each group has its own unique physical and chemical properties. Let's understand them one by one.
Physical Properties
1. Appearance
Metals: Shiny (lustrous). Example: gold, silver, copper.
Non-metals: Dull appearance (except iodine, which is shiny).
2. Hardness
Metals: Generally hard. Example: iron.
Non-metals: Usually soft (except diamond, a form of carbon, which is very hard).
3. State
Metals: Mostly solids at room temperature (except mercury, which is a liquid).
Non-metals: Can be solids, liquids, or gases. Example: oxygen (gas), bromine (liquid), sulphur (solid).
4. Malleability
Metals: Can be hammered into thin sheets (malleable).
Non-metals: Not malleable. They break when hammered (brittle).
5. Ductility
Metals: Can be drawn into wires (ductile).
Non-metals: Not ductile.
6. Conductivity
Metals: Good conductors of heat and electricity.
Non-metals: Poor conductors (except graphite, which is a good conductor).
7. Sonorous Nature
Metals: Produce a ringing sound when struck.
Non-metals: Do not produce sound.
Chemical Properties
1. Reaction with Oxygen
Metals react with oxygen to form metal oxides.
These metal oxides are usually basic.
Non-metals react with oxygen to form non-metallic oxides.
These oxides are usually acidic.
2. Reaction with Water
Metals:
Some react vigorously (e.g., sodium).
Some react slowly (e.g., iron).
Some do not react at all (e.g., gold, silver).
Non-metals: Generally do not react with water.
3. Reaction with Acids
Metals react with acids to produce salt and hydrogen gas.
Non-metals: Do not react with acids.
4. Reaction with Bases
Some non-metals react with bases to form salts, but this is rare.
Metals generally do not react with bases directly (except amphoteric metals like aluminum and zinc).
Displacement Reaction
More reactive metals can displace less reactive metals from their salt solutions.
Uses of Metals
Iron: Making machines, tools, and buildings.
Aluminum: Used in aircraft, utensils.
Copper: Electrical wires.
Gold and Silver: Jewelry.
Zinc: Coating iron to prevent rusting (galvanization).
Uses of Non-Metals
Oxygen: Breathing.
Nitrogen: Fertilizers.
Chlorine: Water purification.
Carbon: Fuel (coal), steel-making (coke).
Iodine: Medicines.
Alloys
An alloy is a mixture of metals or a metal with a non-metal.
Alloys have improved properties like strength, resistance to rusting.
A measles outbreak originating in West Texas has been linked to confirmed cases in New Mexico, with additional cases reported in Oklahoma and Kansas. The current case count is 771 from Texas, New Mexico, Oklahoma, and Kansas. 72 individuals have required hospitalization, and 3 deaths, 2 children in Texas and one adult in New Mexico. These fatalities mark the first measles-related deaths in the United States since 2015 and the first pediatric measles death since 2003.
The YSPH Virtual Medical Operations Center Briefs (VMOC) were created as a service-learning project by faculty and graduate students at the Yale School of Public Health in response to the 2010 Haiti Earthquake. Each year, the VMOC Briefs are produced by students enrolled in Environmental Health Science Course 581 - Public Health Emergencies: Disaster Planning and Response. These briefs compile diverse information sources – including status reports, maps, news articles, and web content– into a single, easily digestible document that can be widely shared and used interactively. Key features of this report include:
- Comprehensive Overview: Provides situation updates, maps, relevant news, and web resources.
- Accessibility: Designed for easy reading, wide distribution, and interactive use.
- Collaboration: The “unlocked" format enables other responders to share, copy, and adapt seamlessly.
The students learn by doing, quickly discovering how and where to find critical information and presenting it in an easily understood manner.
Understanding P–N Junction Semiconductors: A Beginner’s GuideGS Virdi
Dive into the fundamentals of P–N junctions, the heart of every diode and semiconductor device. In this concise presentation, Dr. G.S. Virdi (Former Chief Scientist, CSIR-CEERI Pilani) covers:
What Is a P–N Junction? Learn how P-type and N-type materials join to create a diode.
Depletion Region & Biasing: See how forward and reverse bias shape the voltage–current behavior.
V–I Characteristics: Understand the curve that defines diode operation.
Real-World Uses: Discover common applications in rectifiers, signal clipping, and more.
Ideal for electronics students, hobbyists, and engineers seeking a clear, practical introduction to P–N junction semiconductors.
2. Introduction
• Structured Query Language helps to make practice on SQL
commands which provides immediate results.
• SQL is a language of database, it includes database creation,
deletion, fetching rows and modifying rows etc..
• SQL is an ANSI standard but there are many different versions
of the SQL language.
• SQL is database language for storing, manipulating and
retrieving data stored in relational database.
• All relational database management systems like MySQL, MS
Access, Oracle, Sybase, Informix and SQL server use SQL as
standard database language.
3. • MS SQL server using T-SQL.
• Oracle using PL/SQL.
• MS Access version of SQL is called JET SQL(native format) etc..
• Allows users to access data in relational database management
systems.
• Allows users to describe the data.
• Allows user to define the data in database and manipulate that data.
• Allows embedding within other languages using SQL modules,
libraries and pre-compilers.
• Allows users to create and drop databases and tables.
• Allows users to create view, stored procedure, functions in a
database.
• Allows users to set permissions on tables, procedures and views.
4. History
• 1970: Dr. E.F.Codd of IBM is known as father of relational
databases.
• 1974: SQL appeared.
• 1978:IBM worked to develop Codd’s ideas and released a
product named System/R.
• 1986: IBM developed first prototype of relational database and
standardized by ANSI. The first relational database was
released by Relational Software and its later becoming Oracle.
6. • When you are executing an SQL command for any RDBMS,
the system determines the best way to carry out your request
and SQL engine figure out how to interpret the task.
• There are various components included in the process. These
components are Query Dispatcher, Optimization Engines,
Classic Query Engine and SQL query engine etc..
• Classic query engine handles all non-SQL queries but SQL
query engine won’t handle logical files. These are the
components of SQL: MySQL, MS SQL server, Oracle, MS
Access.
7. SQL Commands
• The standard SQL commands to interact with relational
databases are CREATE, SELECT, INSERT, UPDATE,
DELETE and DROP. These commands can be grouped based
on their nature.
DDL-Data Definition Language
• DDL defines the conceptual schema providing a link between
the logical(the way the user views the data) and the physical
(the way in which the data is stored physically) structures of
the database.
• The logical structure of a database is called a schema. A
subschema is the way a specific application views the data
from the database.
8. Functions of DDL
• Defines the physical characteristics of each record, filled in the
record, field’s data type, field’s length. Field’s logical name
and also specify relationship among those records.
• Describes schema and subschema.
• Indicates the keys of records.
• Provides means for associating related records or fields.
• Provides data security measures.
• Provides for the logical and physical data independence.;
9. • Few of the basic commands of DDL are:
Command Description
CREATE Creates a new table, a view of table or other
object in database.
ALTER Modifies an existing database object, such as
a table.
DROP Deletes an entire table, a view of table or
other object in the database
10. DML-Data Manipulation Language
• Provides the data manipulation techniques like selection,
insertion, deletion, update, modification, replacement,
retrieval, sorting and display of data or records.
• Facilitates the use of relationship between the records.
• Enables the user and application program to be independent of
the physical data structures and database structures
maintenance by allowing to process data on a logical or
symbolic basis.
• Provides for independence of programming languages by
supporting several high level programming languages like
COBOL. PL/1 an C++.
11. • Few DML commands are:
DCL-Data Control Language
Command Description
INSERT Creates a record
UPDATE Modifies a record
DELETE Deletes a record
Command Description
GRANT Gives a privilege to user
REVOKE Takes back privileges granted from users
13. Data types in SQL
• SQL data type is an attribute that specifies type of data of any
object.
• Each column, variable and expression has related data type n
SQL.
• SQL servers offers six categories of data types for your use:
EXACT NUMERIC DATA TYPES
DATA TYPE FROM TO
int -2,147,483,648 2,147,483,647
numeric -10^38+1 10^38-1
14. Floating point numeric data types:
Date and Time data types:
DATA TYPE FROM TO
Float -179E+308 1.79E+308
Real -3.40E+38 3.40E+38
DATA TYPE FROM TO
datetime Jan 1, 1753 Dec 31, 9999
Date Stores a date like MARCH 26,
2014
Time Stores a time of day like
12:30PM
15. Note: Here, date time has 3.33 milliseconds accuracy whereas
small datetime has 1 minute accuracy.
Characters, Strings Data Types:
DATA TYPE keyword Description
Char char Maximum length of
8,000
characters(Fixed
length non-Unicode
characters)
Varchar varchar Maximum length of
8,000
characters(Variablel
ength non-Unicode
data)
16. Operator in SQL
• An operator is a reserved word or a character used primarily in
an SQL statement’s WHERE clause to perform operations(s),
such as comparisons and arithmetic operations.
Arithmetic operators
Comparisons Operators
Logical operators
Operators used to negate the conditions
20. SQL expression
• SQL EXPRESSIONs are like formulas and they are written in
query language.
• An expression is a combination of one or more values,
operators, and SQL functions that evaluate to a value.
• Syntax:
SELECT column1, column2, columnN
FROM table_name
WHERE [CONDITION|EXPRESSION];
21. SQL-Boolean expressions
• SQL Boolean expressions fetch the data on the basis of
matching single value.
• Syntax:
SELECT column1,column2,columnN
FROM table_name
WHERE SINGLE VALUE MATCHIING EXPRESSION;
22. Consider an employee table having the following records:
SQL>SELECT * FROM EMP WHERE age=45;
empid empname age address salary
333 Srinivas 45 Mangalore 25000
23. Numerical expression
• This expression is used to perform any mathematical operation
in any query. Following is the syntax:
SELECT numerical_expression as OPERATION_NAME
[FROM table_name
WHERE CONDITION];
Example:
SQL>SELECT (15+6) AS ADDITION
ADDITION
21
24. • There are several built-in functions like avg(), sum(), count()
etc.. to perform what is known as aggregate data calculations
against a table or a specific table column.
SQL> SELECT COUNT(*) AS “RECORDS” FROM EMP;
RECORDS
7
1 row inset(0.00 sec)
25. SQL Constraints
• Constraints are the rules enforced on data columns on table.
• These are used to limit the type of data that can go into a table.
• Constraints could be column level or table level. Column level
constraints are applied only to one column, whereas table level
constraints are applied to the whole table.
26. SQL Primary Key
• Primary key constraint uniquely identifies each record in a
database. A Primary Key must contain unique value and it
must not contain null value.
• Example using PRIMARY KEY constraint at Table Level:
CREATE table Student (s_id int PRIMARY KEY, Name
varchar(60) NOT NULL, Age int);
• Example using PRIMARY KEY constraint at Column Level
ALTER table Student add PRIMARY KEY (s_id);
27. Foreign Key Constraint
• FOREIGN KEY is used to relate two tables. FOREIGN KEY
constraint is also used to restrict actions that would destroy
links between tables. To understand FOREIGN KEY, let's see
it using two table.
• Example using FOREIGN KEY constraint at Table Level:
CREATE table Order_Detail(order_id int PRIMARY
KEY,order_name varchar(60) NOT NULL, c_id int
FOREIGN KEY REFERENCES Customer_Detail(c_id));
• In this query, c_id in table Order_Detail is made as foriegn
key, which is a reference of c_id column of Customer_Detail.
28. • Example using FOREIGN KEY constraint at Column Level:
ALTER table Order_Detail add FOREIGN KEY (c_id)
REFERENCES Customer_Detail(c_id);
NOT NULL Constraint
• NOT NULL constraint restricts a column from having a NULL
value.
• Once NOT NULL constraint is applied to a column, you cannot
pass a null value to that column.
• NOT NULL constraint is that it cannot be defined at table level.
• Example using NOT NULL constraint:
CREATE table Student(s_id int NOT NULL, Name varchar(60), Age
int);
The above query will declare that the s_id field of Student table
will not take NULL value
29. UNIQUE Key Constraint
• UNIQUE constraint ensures that a field or column will only
have unique values. A UNIQUE constraint field will not have
duplicate data.
• Example using UNIQUE constraint when creating a Table
(Table Level)
CREATE table Student(s_id int NOT NULL UNIQUE, Name
varchar(60), Age int);
The above query will declare that the s_id field of Student
table will only have unique values and wont take NULL value.
Example using UNIQUE constraint after Table is created
(Column Level):
ALTER table Student add UNIQUE(s_id);
• The above query specifies that s_id field of Student table will
only have unique value.
30. Check Constraint
• This constraint defines a business rule on a column. All the
rows must satisfy this rule.
• CHECK constraint is used to restrict the value of a column
between a range. It performs check on the values, before
storing them into the database.
Example using CHECK constraint at Table Level:
create table Student(s_id int NOT NULL CHECK(s_id > 0),Name
varchar(60) NOT NULL, Age int);
Example using CHECK constraint at Column Level:
ALTER table Student add CHECK(s_id > 0);
31. Implementation of SQL Commands
• Basic syntax of CREATE TABLE statement is as follows”
CREATE TABLE table_name(
column1 datataype1,
column2 datatype2,
:
:
columnN datatype,
PRIMARY KEY(one or more columns)
);
32. • CREATE TABLE is the keyword telling the database system
what you want to do.
• A copy of an existing table can be created using a combination
of the CREATE TABLE statement and the SELECT statement.
• You can verify if your table has been created successfully by
looking at the message displayed by the SQL server, otherwise
you can use DESC command as follows:
DESC EMPLOYEE;
33. Alter Statement
• The table can be modified or changed by using the Alter
command.
• ALTER TABLE table_name (columnname datatype(size);
• ALTER TABLE table_name ADD column_name datatype;
EX: SQL>alter table employee modify salary number(15,2);
Table altered.
34. ID NAME AGE ADDRESS SALARY
1 RAMESH 32 Shimoga 10000
2 KIRAN 25 Davangere 12000
3 KOUSHIK 23 Mangalare 11000
4 CHETHAN 34 Chitradurga 10500
ALTER TABLE CUSTOMERS ADD GENDER char(1);
ID NAME AGE ADDRESS SALARY GENDER
1 RAMESH 32 Shimoga 10000 NULL
2 KIRAN 25 Davangere 12000 NULL
3 KOUSHIK 23 Mangalare 11000 NULL
4 CHETHAN 34 Chitradurga 10500 NULL
36. DROP statement
• The SQL DROP TABLE statement is used to remove a table
definition and all data, indexes, triggers, constraints, and
permission specifications for that table.
• Basic syntax of DROP table statement:
DROP TABLE table_name;
Ex:
SQL>DROP TABLE Student;
Table dropped
37. Insert
• The SQL INSERT INTO Statement is used to add new rows of
data to a table in the database.
• Syntax is :
INSERT INTO TABLE_NAME (Column1,Column2….ColumnN
VALUES(value1,value2….valueN);
• Here you may not need to specify the column(s) name in the
SQL query if you are adding the values for all the columns of
the table.
38. Populate one table using another table
INSERT INTO first_table_name[(col1,col2…colN)]
SELECT col1,col2…colN
FROM second_table
[WHERE CONDITION];
39. Select
• SELECT statement is used to fetch the data from a database
table which returns data in the form of result table.
• These result tables are called result-sets.
• Syntax is:
SELECT column1,column2…..columnN FROM table_name;
• WHERE clause to filter the records and fetching only
necessary records.
• Syntax is:
SELECT column1,column2…columnN
FROM table_name
WHERE [condition];
41. • SELECT EmployeeID, FirstName, LastName, HireDate, City
FROM Employees WHERE City = 'London'
42. The SQL AND & OR Operators
• The AND operator displays a record if both the first condition
AND the second condition are true.
• The OR operator displays a record if either the first condition
OR the second condition is true.
SELECT * FROM Customers
WHERE Country='Germany'
AND City='Berlin';
SELECT * FROM Customers
WHERE City='Berlin'
OR City='München';
43. • Syntax for AND
SELECT column1,column2, columnN
FROM table_name
WHERE [CONDITION1] AND [CONDITION2];
• Syntax for OR
SELECT column1,column2, columnN
FROM table_name
WHERE [CONDITION1] OR [CONDITION2];
44. Update
• The SQL update Query is used to modifying the existing
records in a table.
• You can use WHERE clause with UPDATE query with
WHERE clause is as follows:
UPDATE table_name
SET column1=value1,column2=value2…columnN=valueN
WHERE[condition];
ID NAME ADDRESS SALARY
1 Sachin Tumkur 9000
2 Rahul Bangalore 10000
3 Sourav Mysore 11000
4 Anil Shimoga 12000
45. Example: Consider the above table Employee.
We can update ADDRESS for a customer whose ID is 2
SQL> UPDATE EMPLOYEE SET ADDRESS=‘Bengaluru’
WHERE ID=2;
The resultant table is:
ID NAME ADDRESS SALARY
1 Sachin Tumkur 9000
2 Rahul Bengaluru 10000
3 Sourav Mysore 11000
4 Anil Shimoga 12000
46. DELETE
• DELETE Query is used to delete the existing records from a
table.
• You can use WHERE clause with DELETE query to delete
selected rows, otherwise all the records should be deleted.
• The syntax of WHERE clause is:
DELETE FROM table_name
WHERE [condition];
Example: Consider the given table EMPLOYEE
47. ID NAME ADDRESS SALARY
1 Sachin Tumkur 9000
2 Rahul Bengaluru 10000
3 Sourav Mysore 11000
4 Anil Shimoga 12000
SQL> DELETE FROM EMPLOYEES WHERE ID=3;
ID NAME ADDRESS SALARY
1 Sachin Tumkur 9000
2 Rahul Bengaluru 10000
4 Anil Shimoga 12000
48. Order By Clause
• Order By clause is used to sort the data in ascending or
descending order, based on one or more columns.
• Some database sorts query results in ascending order by
default.
• Syntax is :
SELECT column_list
FROM table_name
[WHERE condition]
[ORDER BY column1,column2,…columnN [ASC|DESC] ;
49. • Consider the EMPLOYEE table having the following records:
SQL> select id, name, salary from employees order by salary;
id name salary
6 Sachin 15000
5 Rahul 16000
4 Sourav 18000
9 Anil 19000
50. GROUP BY
• The SQL GROUP BY clause is used in collaboration with the
SELECT statement to arrange identical data into groups.
• The GROUP BY clause follows the WHERE clause in a
SELECT statement and precedes the ORDER BY clause.
• Syntax is:
SELECT column1, column2
FROM table_name
WHERE [ conditions ]
GROUP BY column1, column2
ORDER BY column1, column2
51. DISTINCT
• The SQL DISTINCT keyword is used in conjunction with
SELECT statement to eliminate all the duplicate records and
fetching only unique records.
• There may be a situation when you have multiple duplicate
records in a table. While fetching such records, it makes more
sense to fetch only unique records instead of fetching duplicate
records.
• Syntax:
SELECT DISTINCT column1, column2,.....columnN
FROM table_name
WHERE [condition]
52. JOINS
• The SQL Joins clause is used to combine records from two or
more tables in a database.
• A JOIN is a means for combining fields from two tables by
using values common to each.
• It is noticeable that the join is performed in the WHERE
clause. Several operators can be used to join tables, such as =,
<, >, <>, <=, >=, !=, BETWEEN, LIKE, and NOT; they can
all be used to join tables. However, the most common operator
is the equal symbol.
53. SQL JOIN TYPES
There are different types of joins available in SQL:
INNER JOIN: returns rows when there is a match in both tables.
LEFT JOIN: returns all rows from the left table, even if there are
no matches in the right table.
RIGHT JOIN: returns all rows from the right table, even if there
are no matches in the left table.
FULL JOIN: returns rows when there is a match in one of the
tables.
SELF JOIN: is used to join a table to itself as if the table were
two tables, temporarily renaming at least one table in the SQL
statement.
CARTESIAN JOIN: returns the Cartesian product of the sets of
records from the two or more joined tables.
54. • Group functions are built-in functions that operate on groups
of rows and return one value for the entire group. These
functions are: COUNT, MAX, MIN, AVG, SUM, DISTINCT.
SQL COUNT() : This function returns the number of rows in the
table that satisfies the conditions specified in the WHERE
condition.
Example: SELECT COUNT(*) FROM employee
WHERE dept=‘Computer Science’;
SQL DISTINCT(): This function is used to select all the distinct
rows.
Example: SELECT DISTINCT dept FROM employee;
55. SQL MAX(): This function is used to get the maximum value
from a column.
Example: SELECT MAX(Salary) FROM EMPLOYEE;
SQL MIN(): This function is used to get the minimum value from
a column.
Example: SELECT MIN(Salary) FROM EMPLOYEE:
SQL AVG(): Used to get the average value of a numeric column.
Example: SELECT AVG(Salary) FROM EMPLOYEE:
SQL SUM(): Used to get the sum of the numeric problem.
Example: SELECT SUM(SALARY) FROM EMPLOYEE;
56. Creating Views:
• Database views are created using the CREATE VIEW
statement. Views can be created from a single table, multiple
tables, or another view.
• To create a view, a user must have the appropriate system
privilege according to the specific implementation.
• Syntax is :
CREATE VIEW view_name AS
SELECT column1, column2.....
FROM table_name
WHERE [condition];
57. The COMMIT command
• The COMMIT command is the transactional command used to
save changes invoked by a transaction to the database.
• COMMIT command saves all transactions to the database
since the last COMMIT or ROLLBACK command.
DCL commands are used to enforce database security in a
multiple server database environments.
GRANT
REVOKE
58. • GRANT is used to provide access or previleges on the database objects to the
users.
• Syntax is :
GRANT privilege_name
ON object_name
TO {user_name |PUBLIC |role_name}
[WITH GRANT OPTION];
• privilege_name is the access right or privilege granted to the user.
Some of the access rights are ALL, EXECUTE, and SELECT.
• object_name is the name of an database object like TABLE, VIEW,
STORED PROC and SEQUENCE.
• user_name is the name of the user to whom an access right is being
granted.
• user_name is the name of the user to whom an access right is being
granted.
59. • PUBLIC is used to grant access rights to all users.
• ROLES are a set of privileges grouped together.
• WITH GRANT OPTION - allows a user to grant access rights
to other users.
SQL REVOKE Command:
• The REVOKE command removes user access rights or
privileges to the database objects.
REVOKE privilege_name
ON object_name
FROM {user_name |PUBLIC |role_name}
60. Privileges and Roles:
• Privileges: Privileges defines the access rights provided to a
user on a database object. There are two types of privileges.
• 1) System privileges - This allows the user to CREATE,
ALTER, or DROP database objects.
2) Object privileges - This allows the user to EXECUTE,
SELECT, INSERT, UPDATE, or DELETE data from database
objects to which the privileges apply.
61. • Few CREATE system privileges are listed
below:
System Privileges Description
CREATE object
allows users to
create the specified
object in their own
schema.
CREATE ANY object
allows users to
create the specified
object in any
schema.
62. • The above rules also apply for ALTER and DROP system
privileges.
Object Privileges Description
INSERT
allows users to insert
rows into a table.
SELECT
allows users to select
data from a database
object.
UPDATE
allows user to update
data in a table.
EXECUTE
allows user to execute
a stored procedure or
a function.
63. System Role Privileges Granted to the Role
CONNECT
CREATE TABLE, CREATE VIEW, CREATE
SYNONYM, CREATE SEQUENCE, CREATE
SESSION etc.
RESOURCE
CREATE PROCEDURE, CREATE SEQUENCE,
CREATE TABLE, CREATE TRIGGER etc. The
primary usage of the RESOURCE role is to
restrict access to database objects.
DBA ALL SYSTEM PRIVILEGES
64. Oracle Built in Functions
• There are two types of functions in Oracle.
1) Single Row Functions: Single row or Scalar functions
return a value for every row that is processed in a query.
2) Group Functions: These functions group the rows of data
based on the values returned by the query.
65. • There are four types of single row functions. They are:
1) Numeric Functions: These are functions that accept
numeric input and return numeric values.
2) Character or Text Functions: These are functions that
accept character input and can return both character and
number values.
3) Date Functions: These are functions that take values that
are of datatype DATE as input and return values of datatype
DATE, except for the MONTHS_BETWEEN function, which
returns a number.
4) Conversion Functions: These are functions that help us to
convert a value in one form to another form. For Example: a
null value into an actual value, or a value from one datatype to
another datatype like NVL, TO_CHAR, TO_NUMBER,
TO_DATE etc.
66. What is a DUAL Table in Oracle?
• What is a DUAL Table in Oracle?
This is a single row and single column dummy table provided by
oracle. This is used to perform mathematical calculations without
using a table.
• Example: Select * from DUAL
Output:
DUMMY
-------
X
Select 777 * 888 from Dual;
Output:
777 * 888
---------
689976
67. 1) Numeric Functions:
• Numeric functions are used to perform operations on numbers.
Function Name Return Value Function Name
ABS (x)
Absolute value of the
number 'x'
ABS (x)
CEIL (x)
Integer value that is
Greater than or equal to
the number 'x'
CEIL (x)
FLOOR (x)
Integer value that is Less
than or equal to the
number 'x'
FLOOR (x)
TRUNC (x, y)
Truncates value of number
'x' up to 'y' decimal places
TRUNC (x, y)
ROUND (x, y)
Rounded off value of the
number 'x' up to the ROUND (x, y)
69. 2) Character or Text Functions:
• Character or text functions are used to manipulate text strings.
They accept strings or characters as input and can return both
character and number values as output.
Function Name Return Value
LOWER (string_value)
All the letters in 'string_value' is converted to
lowercase.
UPPER (string_value)
All the letters in 'string_value' is converted to
uppercase.
INITCAP (string_value)
All the letters in 'string_value' is converted to
mixed case.
LTRIM (string_value, trim_text)
All occurrences of 'trim_text' is removed from
the left of 'string_value'.
RTRIM (string_value, trim_text)
All occurrences of 'trim_text' is removed from
the right of 'string_value' .
TRIM (trim_text FROM string_value)
All occurrences of 'trim_text' from the left and
right of 'string_value' , 'trim_text' can also be
only one character long .
SUBSTR (string_value, m, n)
Returns 'n' number of characters from
'string_value' starting from the 'm' position.
Number of characters in 'string_value' in
70. DATE FUNCTIONS
• These are functions that take values that are of datatype DATE
as input and return values of datatypes DATE, except for the
MONTHS_BETWEEN function, which returns a number as
output.
Function Name Examples Return Value
ADD_MONTHS ( )
ADD_MONTHS ('16-Sep-
81', 3)
16-Dec-81
MONTHS_BETWEEN( )
MONTHS_BETWEEN
('16-Sep-81', '16-Dec-81')
3
NEXT_DAY( )
NEXT_DAY ('01-Jun-08',
'Wednesday')
04-JUN-08
LAST_DAY( ) LAST_DAY ('01-Jun-08') 30-Jun-08
NEW_TIME( )
NEW_TIME ('01-Jun-08',
'IST', 'EST')
31-May
71. Conversions Functions
• These are functions that help us to convert a value in one form
to another form. For Ex: a null value into an actual value, or a
value from one datatype to another datatype like NVL,
TO_CHAR, TO_NUMBER, TO_DATE.
72. Function Name Return Value
TO_CHAR (x [,y])
Converts Numeric and Date values to a
character string value. It cannot be used
for calculations since it is a string value.
TO_DATE (x [, date_format])
Converts a valid Numeric and Character
values to a Date value. Date is formatted
to the format specified by 'date_format'.
NVL (x, y)
If 'x' is NULL, replace it with 'y'. 'x' and 'y'
must be of the same datatype.
DECODE (a, b, c, d, e, default_value)
Checks the value of 'a', if a = b, then
returns 'c'. If a = d, then returns 'e'. Else,
returns default_value.