CBSE CS and IP

CBSE Class 11 & 12 Computer Science and Informatics Practices Python Materials, Video Lecture

Showing posts with label Class 12 IP. Show all posts
Showing posts with label Class 12 IP. Show all posts

head() and tail() functions of Series Object

head() and tail() functions of Series Object

Pandas Series provides two very useful methods for extracting the data from the top and bottom of the Series Object. These methods are head() and tail().

head() Method

head() method is used to get the elements from the top of the series. By default, it gives 5 elements.

Syntax:
<Series Object> . head(n = 5)

Example:
Consider the following Series, we will perform the operations on the below given Series S.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
import pandas as pd
s = pd.Series({'A':1,'B':2,'C':3,'D':4,'E':5,'F':6,'G':7,'H':8})
print(s)

Output:
A    1
B    2
C    3
D    4
E    5
F    6
G    7
H    8
dtype: int64


head() Function without argument

If we do not give any argument inside head() function, it will give by default 5 values from the top.
1
2
3
4
5
6
7
8
9
s.head()
Output:
A    1
B    2
C    3
D    4
E    5
dtype: int64


head() Function with Positive Argument

When a positive number is provided, the head() function will extract the top n rows from Series Object. In the below given example, I have given 7, so 7 rows from the top has been extracted.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
s.head(7)
Output:
A    1
B    2
C    3
D    4
E    5
F    6
G    7
dtype: int64


head() Function with Negative Argument

We can also provide a negative value inside the head() function. For a negative value, it will check the index from the bottom and provide the data from the top.
1
2
3
4
5
s.head(-7)

Output:
A    1
dtype: int64

tail() Method

tail() method gives the elements of series from the bottom.

Syntax:
<Series Object> . tail(n = 5)

Example:
Consider the following Series, we will perform the operations on the below given Series S.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
import pandas as pd
s = pd.Series({'A':1,'B':2,'C':3,'D':4,'E':5,'F':6,'G':7,'H':8})
print(s)

Output:
A    1
B    2
C    3
D    4
E    5
F    6
G    7
H    8
dtype: int64


tail() function without argument

If we do not provide any argument tail() function gives be default 5 values from the bottom of the Series Object.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
s.tail()
'''
Output:
D    4
E    5
F    6
G    7
H    8
dtype: int64
'''

tail() function Positive argument

When a positive number is provided tail() function given bottom n elements of the Series Object.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
s.tail(7)
'''
Output:
B    2
C    3
D    4
E    5
F    6
G    7
H    8
dtype: int64
'''

tail() function Negative argument

When a negative number is provided it will give the data as follows:

1
2
3
4
5
6
s.tail(-7)
'''
Output:
H    8
dtype: int64
'''



Mathematical operations on Pandas Series

Mathematical operations on Pandas Series



  1. You can perform arithmetic operations like addition, subtraction, division, multiplication on two Series objects.
  2. The operations are performed only on the matching indexes.
  3. For all non-matching indexes, NaN (Not a Number) will be returned

Note:-  Like NumPy array, series support vector operations. Batch operations on data without writing any for loops. This is usually called vectorization.

Let us consider the following two Series S1 and S2. We will perform mathematical operations on these Series.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import pandas as pd
s1 = pd.Series(data = [ 1 , 2 , 3 , 4 , 5 ], index = [ 'A' , 'B' , 'C' , 'D' , 'E' ])
s2 = pd.Series(data = [ 1 , 2 , 3 , 4 , 5 ], index = [ 'B' , 'C' , 'D' , 'E' , 'F' ])
print(s1)

A 1
B 2
C 3
D 4
E 5
dtype: int64

print(s2)

B 1
C 2
D 3
E 4
F 5
dtype: int64


Now let us perform mathematical operations on these two Series.
  1. Addition:  We can use the '+' Operator or add() method of Series to perform addition between two Series Objects.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    >>> s1 + s2                                                 
    A    NaN
    B    3.0
    C    5.0
    D    7.0
    E    9.0
    F    NaN
    dtype: float64
    
    >>> s1.add(s2)
    A    NaN
    B    3.0
    C    5.0
    D    7.0
    E    9.0
    F    NaN
    dtype: float64
     
    

  2. Subtraction: We can use the '-' Operator or sub() method of Series to perform addition between two Series Objects.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    >>> s1 - s2
    A    NaN
    B    1.0
    C    1.0
    D    1.0
    E    1.0
    F    NaN
    dtype: float64
    
    >>> s1.sub(s2)                                      
    A    NaN
    B    1.0
    C    1.0
    D    1.0
    E    1.0
    F    NaN
    dtype: float64
    

  3. Division: We can use the '/' Operator or div() method of Series to perform addition between two Series Objects.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    >>> s1 / s2
    A         NaN
    B    2.000000
    C    1.500000
    D    1.333333
    E    1.250000
    F         NaN
    dtype: float64                                         
    
    >>> s1.div(s2)
    A         NaN
    B    2.000000
    C    1.500000
    D    1.333333
    E    1.250000
    F         NaN
    dtype: float64
    

  4. Multiplication: We can use the '*' Operator or mul() method of Series to perform addition between two Series Objects.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    >>> s1*s2
    A     NaN
    B     2.0
    C     6.0
    D    12.0
    E    20.0
    F     NaN
    dtype: float64                                      
     
    >>> s1.mul(s2)
    A     NaN
    B     2.0
    C     6.0
    D    12.0
    E    20.0
    F     NaN
    dtype: float64
    



Network Topologies in Computer Network

 

network topology
The term Network Topology defines the Geographic, Physical, or logical arrangement of computer and networking devices.
The pattern of the interconnection of nodes on a network is called the topology.

FACTORS for choosing a Topology of a network are:-
  • Cost: which offers minimum installation cost based on the network under consideration.
  • Flexibility: Can offer easy move of existing nodes and adding new ones.
  • Reliability: Offers least failure.
Types of topology

BUS TOPOLOGY-:

  • It consists of one continuous length of cable (trunk) that is shared by all the nodes in the network.
  • It has a terminating resistor (terminator) at each end that absorbs the signal when it reaches the end of the line.
bus topology
Advantage -:
  1. Easy to connect a computer.
  2. Requires less cable length.
  3. Failure of one node does not affect the network functioning. 
Disadvantage -:
  1. The entire network shuts down if there is a break in the main cable.
  2. Terminators are required at both ends.
  3. Difficult to identify the problem.
  4. Nodes must be intelligent.

RING TOPOLOGY -:

  • Each node has two neighboring nodes.
  • Data packet is received from one neighboring and is transmitted to the next.
  • Data travels in one direction in the ring-like structure.
Ring topology

Advantage -:
  1. Short cable length
  2. The possibility of collision is minimum

Disadvantages -:
  1. One node causes network failure
  2. It is very difficult to diagnose faults
  3. Network reconfiguration is difficult.

STAR TOPOLOGY -:

  • Each node connected directly to a central network hub or concentrator.
  • Data passes through the hub or concentrator before continuing.
  • The hub or concentrator manages and controls all functions of the network.
Star topology

Advantage -:
  1. Easy to install.
  2. No disruptions to the network when connecting or removing devices.
  3. Easy to detect faults and to remove parts.
Disadvantage -:
  1. Requires more cable length than a BUS/RING topology.
  2. If the hub or concentrator fails, the nodes attached are disabled.
  3. More expensive than linear bus topologies because of the cost of the concentrators.

MESH TOPOLOGY -:

  • Each node is connected to another Node.
mesh topology

Advantage -:
  1. It is robust.
  2. Provides security and privacy.
  3. The fault is diagnosed easily.
Disadvantage -:
  1. The cost to implement is higher than other network topologies.
  2. Installation and configuration are difficult.

TREE TOPOLOGY -:

  • A tree topology combines characteristics of linear BUS and STAR topologies.
  • Inverted tree-like structure.
  • It consists of groups of star-configured workstations connected to a linear bus backbone cable.
tree topology

Advantage -:
  1. Point-to-point wiring for individual segments
  2. It is highly flexible
  3. Centralized monitoring 
Disadvantage -:
  1. If the backbone line breaks, the entire segment goes down.
  2. It is difficult to configure the network if there is a single point of failure.
  3. More wire is required than other topologies.

HYBRID TECHNOLOGY -:

  • A hybrid topology is an integration of two or more different topologies to form a resultant topology.
Hybrid topology














Computer Network Devices

 

Computer Network Devices

Introduction -

Specialized hardware is required to carry out various roles in a network e.g. Establishing connections, controlling network traffic, and many more.
Network Devices


NIC (Network Interface card) -

It is a device attached to each workstation and server. Helps to make connections within the network.
Each NIC has a unique number identifying it called node address/MAC address (Media Access Control) /Physical Address.
Types:
  1. Ethernet Card
  2. WiFi Card

RJ - 45 -:

  • RJ-45 stands for Registered Jack-45.
  • RJ-45 is an eight-wire connector, which is commonly used to connect computers on LAN especially Ethernet.

MODEM (Modulator - Demodulator) -:

  • The modem is an abbreviation for Modulator – Demodulator. 
  • The modulator converts information from digital mode to analog mode at the transmitting end and the demodulator converts the same from analog to digital at receiving end.
MODEM


REPEATER - 

  • It is a device that accepts the weak signals and amplifies the signals for further transmission.
  • Different types of wires have different transmission distances, hence repeater should be used according to the types of wire.
  • Generally, we consider that most wires require a repeater after a 100m distance.
REPEATER


HUB - :

  • Hub is an electronic device that connects several nodes to form a network and redirect the received information to all the nodes in a broadcast mode. It is called a non-intelligent device. 
  • It is mostly used in Star or Ring topology and works on MAC addresses. 

Types:

Active hub:- electrically amplify the signal.
Passive hub:- do not amplify the data.
HUB

BRIDGE - :

  • In telecommunication networks, a bridge is a product that connects a local area network (LAN) to another local area network that uses the same protocol.
  • The bridge acts on MAC/Physical Address.
  • A bridge examines each message on a LAN, "passing" those known to be within the same LAN, and forwarding those known to be on the other interconnected LAN (or LANs).
BRIDGE


SWITCH - :

  • It is an intelligent device that connects several nodes to form a network and redirect the received information only to the intended node(s).
  • A switch is also called Intelligent HUB.
  • Switch stores the MAC address table of all the connected nodes, which helps it to send the data to the desired node.
SWITCH


ROUTER - :

The router works on IP address.
Routers normally connect LANs and WANs together.
It has a dynamically updating routing table (stores IP Addressed) based on which they make decisions on routing the data packets.
ROUTER


GATEWAY - :

  • Gateway is a device that connects dissimilar networks.
  • Establishes an intelligent connection between a local network and external networks with completely different structures.
  • Gateway is the ISP(Internet Service Provider) that connects the user to the internet. The gateway can also act as Firewall, API Gateways, etc.
GATEWAY





Computer Network LAN, MAN, WAN

computer network

 

What is a Computer Network?

When two or more autonomous computing devices connected to one another in order to exchange information or share resources, form a Computer Network. 



Computer Network

Components of Computer Network -:

  1. Maj                
  2. Network-Hardware
  3. Communication Chanel
  4. Software
  5. Network Services
  6. Host
  7. Servers
  8. Client


Types of Computer Network -:

A computer network can be categorized by its size:
  • PAN (Personal Area Network)
  • LAN (Local Area Network)
  • MAN (Metropolitan Area Network)
  • WAN (Wide Area Network)

PAN (Personal Area Network) -:

Personal Area Network is a network arranged within an individual person, typically within a range of 10 meters (30 feet).
Types of Personal Area Network (PAN) :
  • Wireless PAN – Wireless Personal Area Network (WPAN) is connected through signals such as infrared, ZigBee, Bluetooth and ultra-wideband, etc.
  • Wired PAN – Wired PAN is connected through cables/wires such as Firewire or USB (Universal Serial Bus).

LAN  (Local Area Network)-:

  • Local Area Network is a group of computers connected to each other in a small area such as a building, office.
  • It covers an area of a few kilometer radius (approx. 1-10 km).
  • It is managed by a single person / Organization. 
LAN

MAN (Metropolitan Area Network)-:

  • A metropolitan area network is a network that covers a larger geographic area by interconnecting a different LAN to form a larger network e.g. within a city.
  • Covers an area of few kilometers to a few hundred kilometers.
  • Owned by Organization or Government.
  • The network of schools, banks, government offices within a city are examples of MAN.

WAN (Wide Area Network)-:

  • A Wide Area Network is a network that extends over a large geographical area or countries.
  • Covers over hundreds of kilometer radius.
  • It is usually formed by interconnecting LANs, MANs, or maybe other WANs.
  • Network of ATMs, BANKs, National or International organization offices spread a country, the continent is examples of WAN.
  • The internet is one of the biggest WAN in the world.


Computer Network-:

Advantages-

  • Resource Sharing
  •  Cost Reduction
  •  Collaborative User Interaction
  •  Share Storage
  •  Fast Communication

Disadvantage-

  • Security Concerns
  •  Lack of Robustness
  •  Needs an Efficient Handler
  •  Lack of Independence
  •  It requires an expensive set-up.







FOSS (Free and Open Source Software)

 

FOSS

What is FOSS?

Free and open-source software (FOSS) is software that can be classified as both free software and open-source software.

That is, anyone is freely licensed to use, copy, study, and change the software in any way, and the source code is openly shared so that people are encouraged to voluntarily improve the design of the software.

FOSS is also called FLOSS (Free Libre and Open Source Software or Free Livre and Open Source Software). Libre (Spanish Word), Livre(Portuguese Word).

Free software:- 

“Free Software” is a matter of liberty not price. It provides four freedom to Run, Study how the program works, Redistributes copies, Releases improvement to the Public.
 Open-Source Software:- In this type of software, the source code is freely available.

Example of FOSS

Linux – Operating System
Apache – Web Server
CamStudio – Screen Recording
NetBeans
LibreOffice 
OpenOffice
DOSBox
Firefox – Web Browser developed by Mozilla
etc.

Information collected from https://en.wikipedia.org/wiki/List_of_free_and_open-source_software_packages



XII IP CRASH COURSE eBook (PDF) 2020-21



Purchase the Class 12 IP CRASH COURSE ebook from here. It is based on the Revised Syllabus of CBSE.

Free Video Lectures are available on the youtube channel cbsecsip, click here to access the free video lectures.


Note:-
  1. eBook PDF file will be delivered in your email within 15 - 20 minutes of purchase. 
  2. This book covers all the topics which are discussed in the Online Youtube CRASH COURSE of cbsecsip. 
  3. Once purchased, the item is not exchangeable.

NaN (Not a number) Data in Python

NaN not a Number in python


In Python missing data is represented by two value:
  1. None: None is a Python singleton object that is often used for missing data in Python code.
  2. NaN: NaN (an acronym for Not a Number), is a special floating-point value 
NaN stands for not a number. It is a numeric data type that is used to represent any value which is undefined or unpresentable. None data type is used to specify the missing values but NaN is a numeric datatype which specifies the data which is not a Number. 

For Example 0/0 will have an undefined value, hence it will be represented by NaN.

If you check the data type of NaN, it will be of float type. So NaN values in python will have Float Data Type. In Python NaN is available in Math Module and Numpy Module. When we use python pandas we generally use numpy's NaN.

Check the following code which explains the difference between None and NaN.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import pandas as pd
import numpy as np

s = pd.Series([1,2,None])
print(s)

0    1.0
1    2.0
2    NaN
dtype: float64


print(type(None))
>>> NoneType

## From numpy Module
print(type(np.NaN))
>>> <class 'float'>


In the above code we have created a Series "S". S is having one undefined value in a list of numbers. Hence it is represented by NaN in Python Pandas.



What is Plagiarism and How to avoid it


 

Table of contents

  1. What is Plagiarism?
  2. Acts that involve Plagiarism
  3. How to Avoid Plagiarism

What is Plagiarism?

  • Plagiarism is stealing someone else’s intellectual work (can be an idea, literary work or academic work, etc.) and representing it as your own work without giving credit to the creator or without citing the source of information.
  • Plagiarism is an offense because it involves copyright infringement and not giving the credit to the author.

An act that involves plagiarism

  • Turning in someone else's work as your own
  • Copying words or ideas from someone else without giving credit
  • Failing to put a quotation in quotation marks
  • Giving incorrect information about the source of a quotation
  • Changing words but copying the sentence structure of a source without giving credit.

How to avoid plagiarism

You must give credit whenever you use:
  •  Another person’s idea, opinion, or theory
  • Quotation of another person’s actual spoken or written words
  • Paraphrases of another person’s spoken or written words




Net Etiquettes (Netiquettes)


 

What is Net Etiquettes (Netiquettes) or Net+etiquetts?

You must be aware of the term etiquette. This means the general behavior you must follow in your daily life. There is a little difference between etiquette and net etiquette. There are some rules that you must obey when you are online and using the Web/internet. These rules are called net etiquette (Netiquettes), Internet etiquettes or Online etiquetts
  • Online etiquette or ‘netiquette’ refers to the dos and don’ts of online communication.
  • You can do Online Communication using Snapchat, Instagram, WhatsApp, etc. These are the most popular online mediums available online.
Now let us discuss net etiquette do's and don'ts and some rules that you should follow while you are using the internet. 

7 Net Etiquettes you should follow

  1. Be respectful.
  2. Be aware of what you are commenting on social media.
  3. Be careful with humor and sarcasm
  4. You should take care of how you are sharing your data and who can see this.
  5. Friend requests and group invites should be checked before you accept them
  6. Take time to have a read of the rules of conduct/ community standards
  7. Be forgiving do not take fight online

Bad net etiquette

  1. Posting inappropriate jokes on social media
  2. Continuously posting messages to get the attention of someone is bad net etiquette.
  3.  Using a photo of another person on your profile
  4. Not respective peoples privacy online
  5. Taking fight online





Digital footprint

Digital Footprints


What is a Digital footprint?

  • A digital footprint is an impact you create on the Web through your online activity, which incorporates browsing, interactions with others, and publication of content. 
  • In other words, it can be considered as the data trail – intentional and unintentional - you leave behind while you surf the Web or Internet. 
  • Digital footprint or digital shadow refers to the trail of data left behind through the utilization of the Web or on digital devices.
  • The digital footprint of any person can have a positive as well as a negative impact on him.

How Digital Footprints are Created-

Find some of the examples of digital footprints:
  • Visiting Websites And Online Shopping
  •  Online Searching 
  •  Posting on Social Media, blogs, etc.
  •  Online Image and Video Upload 
  •  Communicating Online (Ex:- Chat, Email, etc.)
  •  Any activity you perform Online etc.

Types of digital footprints-

Following are the two types of digital footprints:
Active digital footprints:- Active digital footprints are those data trails that a person leaves intentionally on the Web. 
Ex:- Twitter, blog posts, Facebook, social network connections, image and video uploaded on Internet, phone calls, email, and chats are among the ways people create active digital footprints.
Passive digital footprints:- This suggests that a passive footprint would be defined as the unintentional traces of data that an individual creates on the Web.
Ex:- Website visits and actions, searches, and online purchases are among the activities that add passive data traces to a digital footprint.

Positive and Negative Digital Footprints

Positive digital Footprints:- 
That reflects your Positive Personality.
  • Increased opportunity
  • Higher profits
  • Less risk
  • Gentler treatment
Negative digital footprints:- 
Things that reflect your Negative Personality sort of a drunken photo, a silly comment, logging on to an inappropriate website.
  • Fewer Opportunities (like Admission, Job, etc.)
  • Negative Personal Image

How digital footprints can affect you?

  1. Privacy Issues: Digital footprints are a privacy concern because they're a group of traceable actions, contributions, and concepts shared by users. They are often tracked and may allow internet users to find out about human actions.
  2. Cyber Vetting: where interviewers could research about the applicants before the interview based on their online activities on the Web.
  3. Target advertisement: It is used by marketers so as to seek out what products a user is curious about or to inspire ones' interest during a certain product that supported similar interests.
  4. Less/More Opportunities depends upon your Positive/Negative Digital Footprints.

How can you manage your digital footprint?

Though it is not possible to fully hide your digital footprints, you can follow some of the given techniques to manage your digital footprints.
  1. You can search your name on different search engines and they provide you facilities where you can set up an alert for future notifications when your name searched online
  2. Have different email addresses, so professional and private accounts aren't automatically related to each other
  3. You can change privacy settings on social media accounts where you do not make more things public. But you should not trust them completely because your data is still with those platforms.
  4. Exercise caution altogether our activities, and refrain from oversharing

Built Positive Digital Footprints-

Since it is hard to not have a digital footprint, it is in one’s best interest to create a positive one.

It is beneficial for you !!














 

Cyber Law IT ACT 2000

CYBER LAW


What is cyber Law?


  • Cyber law, also known as cybercrime law, is legislation focused on the acceptable behavioral use of technology including computer hardware and software, the internet, and networks.
  • Cyber law helps protect users from harm by enabling the investigation and prosecution of online criminal activity.
  • It applies to the actions of individuals, groups, the public, government, and private organizations.

Overview of Indian IT ACT

  • The Information Technology Act, 2000 (also known as ITA-2000, or the IT Act) is an Act of the Indian Parliament notified on 17 October 2000. It is the primary law in India dealing with cybercrime and electronic commerce.
  • A major amendment was made in 2008 and now it is called the IT (Amendment) Act 2008.

Some Suggested questions that may be asked in board examination Class 12 CS/IP

  1. What is Cyber Crime? Write the act that deals with it.
  2. What is IT Act, 2000? Write down 2 salient features of IT Act, 2000.
  3. Difference between Cyber Crime and Cyber Law.

IPR (Intellectual Property Rights)

IPR

What is IPR?

  • If a person creates something by himself he posses the right on it, this right is called Intellectual property rights (IPR).
  • IPR gives the right to the creator over the use of his/her creation for a certain period of time.
  • Intellectual property rights can be obtained at the national level/regional level.

Types Of IPR -

The most well-known types are -
  1. Copyrights
  2. Patents
  3. Trademarks
  4. Trade Secrets
The intellectual property right encourages the creation of a wide variety of intellectual goods. To achieve this, the law gives people and businesses property rights to the information and intellectual goods they create, usually for a limited period of time.

Wat Is Copyrights?

  • Copyright (or author’s right) is a legal term, it is used to describe the rights that creators have over their artistic and literary creation. 
  • Copyright is automatic; once you create something, it is yours. However, if you want to file a lawsuit against the infringement of your copyrighted work, then registration of your copyright will be necessary.
  • Works covered by copyright range from books, music, paintings, sculpture, and films, to computer programs, databases, advertisements, maps, and technical drawings.
  • Copyright protection extends only to expressions, and not to ideas, procedures, methods of operation, or mathematical concepts as such. 
  • Typically, the public law duration of a copyright expires 50 to 100 years after the creator dies, depending on the jurisdiction.
  • Copyright may or may not be available for a number of objects such as titles, slogans, or logos, depending on whether they contain sufficient authorship.
  • In the majority of countries, and according to the Berne Convention, copyright protection is obtained automatically without the need for registration or other formalities.

What are Patents?

  • A patent is a type of limited-duration protection that can be used to protect inventions (or discoveries) that are new, non-obvious, and useful, such a new process, the machine, article of manufacture, or composition of matter.
  • When a property owner holds a patent, others are prevented, under law, from offering for sale, making, or using the product.
  • A patent is an exclusive right granted for an invention, which is a product or a process that provides, in general, a new way of doing something, or offers a new technical solution to a problem. 
  • To get a patent, technical information about the invention must be disclosed to the public in a patent application.
  • Kind of protection: Patent protection means that the invention cannot be commercially made, used, distributed, imported, or sold by others without the patent owner's consent.
  • The protection is granted for a limited period, generally 20 years from the filing date of the application.

What Are Trademarks?

  • A trademark is a sign capable of distinguishing the goods or services of one enterprise from those of other enterprises. Trademarks are protected by intellectual property rights.
  • At the national/regional level, trademark protection can be obtained through registration, by filing an application for registration with the national/regional trademark office and paying the required fees.
  • The term of trademark registration can vary but is usually ten years.

What Is Trade Secrets -

  • Trade secrets refer to specific, private information that is important to a business because it gives the business a competitive advantage in its marketplace. Trade secrets are intellectual property (IP) rights on confidential information that may be sold or licensed.
  • Trade secrets are not made public, unlike patents, they do not provide “defensive” protection, as being prior art.
  • Trade secrets are protected without official registration; however, an owner of a trade secret whose rights are breached–i.e. someone steals their trade secret–may ask a court to ask against that individual and prevent them from using the trade secret.
  • kind of information is protected by trade secret: 
  • recipes for certain foods and beverages (like coca-cola or Sprite), new inventions, software, processes, even different marketing strategies. , technical information, such as information concerning manufacturing processes, pharmaceutical test data, designs and drawings of computer programs, distribution methods, list of suppliers and clients, and advertising strategies, financial information, formulas and recipes, and source codes.
  • A trade secret owner, however, cannot stop others from using the same technical or commercial information, if they acquired or developed such information independently by themselves through their own R&D, reverse engineering or marketing analysis, etc. 



MYSQL ORDER BY

 

order by

MYSQL ORDER BY clause

When you use the SELECT statement to query data from a table, the result set is not ordered. It means that the rows in the result set can be in any order.

To sort the result set, you add the ORDER BY clause to the SELECT statement. 
The SQL ORDER BY clause is used to sort the records in the result set for a SELECT statement.

The syntax for using ORDER BY -:

SELECT expressions
FROM tables
[WHERE conditions]
[GROUP BY <COL_NAME>
HAVING <CONDITION ON GROUPS>]
ORDER BY COL1,COL2,.. [ ASC | DESC ];

ASC –:
 Ascending order by COLUMNS [Default]
DESC – :
Descending order by COLUMNS

Note -:

ORDER BY clause is always evaluated after the FROM and SELECT clause.





MYSQL GROUP BY and HAVING



 MySQL  GROUP BY

The GROUP BY statement in SQL is used to arrange data into groups with the help of some functions. GROUP BY statement is used to retrieve grouped records based on one or more columns.

The aggregate function on SELECT Statement can be used with the GROUP BY Statement.
Aggregate Functions : AVG(),COUNT(),MAX(),MIN(),SUM().

The syntax for GROUP BY Statement in SQL -:

SELECT  <COL_NAME>
FROM  <TABLE>
WHERE  <CONDITION>
GROUP BY <COL_NAME>
HAVING <CONDITION ON GROUPS>;

Description MySQL GROUP BY -:

The GROUP BY clause combines all those records (Rows) that have identical values in a particular field (Column) or a group of fields.
This grouping results in one summary record per group.

If you want to total salary for all employees then we used the SUM function and you will get a sum of the total salary.
group by

If you want to total salary department wise like D1 or D2 then we have used GROUP BY.
group by MYSQL

Now you have also used the SUM function and using GROUP BY  tHen you will get the department-wise total salary  You can see all D1 and D2 columns combine in one row.
group by MYSQL

GROUP BY(Nested Grouping) using more than one column -

If you want to GROUP BY using more than one column, you can give all columns by using comma separation.  

Syntex -

SELECT Col1, Col2,AGG_FUN(Col3)
FROM Tab1
[WHERE <Condition>]
GROUP BY Col1, Col2 ;

group by MYSQL Nested grouping

GROUP BY Condition -

The GROUP BY clause is used with Aggregate Functions.
 All the fields (Columns) other than used in aggregate function should be put in GROUP BY clause.

Syntex -

SELECT AGG_FUN(Col1), Col2, Col3
FROM Tab1
WHERE <Condition>
GROUP BY Col2, Col3;










MySQL Aggregate Functions

 

MySQL Aggregate Functions

An aggregate function performs a calculation on multiple values and returns a single value.


1. MAX ()

MAX function returns the maximum value of an expression.

Syntax:
SELECT MAX(aggregate_expression)
FROM tables
[WHERE conditions];

Parameter or Arguments:
aggregate_expression: This is the column or expression from which the maximum value will be returned.

2. MIN ()

MIN function returns the minimum value of an expression.

Syntax:
SELECT MIN(aggregate_expression)
FROM tables
[WHERE conditions];

Parameter or Arguments:
aggregate_expression: This is the column or expression from which the minimum value will be returned.

3. AVG ()

AVG function returns the average value of an expression.

Syntax:
SELECT AVG(aggregate_expression)
FROM tables
[WHERE conditions];

Parameter or Arguments:
aggregate_expression: This is the column or expression that will be averaged.


4. SUM ()

SUM function returns the summed value of an expression.

Syntax:
SELECT SUM(aggregate_expression)
FROM tables
[WHERE conditions];

Parameter or Arguments:
aggregate_expression: This is the column or expression that will be summed.

5. COUNT () and COUNT (*)

COUNT function returns the count of an expression.

Syntax:
SELECT COUNT(aggregate_expression)
FROM tables
[WHERE conditions];

Parameter or Arguments:
aggregate_expression: This is the column or expression whose non-null values will be counted.