Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
2 views12 pages

01-AI Ethics and SQL - Study Material

Uploaded by

silparaghavendra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views12 pages

01-AI Ethics and SQL - Study Material

Uploaded by

silparaghavendra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

CBSE Grade 8

Artificial Intelligence

AI ETHICS
CLASSWORK NOTES

Ethics are the moral responsibility of anyone or anything that can impact others

AI Ethics is a set of values, principals, and techniques that employ widely accepted standards of
right and wrong to guide moral conduct in the development and use of AI technologies.

MAJOR ETHICAL ISSUES AROUND AI

o Bias and fairness


o Accountability
o Transparency
o Safety
o Human AI interaction
o Trust, privacy and control
o Cyber security and malicious use
o Automation and impact over jobs
o Democracy, civil rights, robot rights etc.,
AI BIAS

AI Bias is an anomaly in the result produced through AI based programs and algorithms
because of prejudiced assumptions made during the algorithm development process or
prejudices in training data

WHAT IS ALGORITHM?

An algorithm is a set of instructions or rules designed to solve a problem or perform a task. In


Artificial Intelligence (AI), algorithms are used to make decisions, recognize patterns, and
learn from data.

TRAINING DATA

Training Data is a huge collection of labelled information that’s used to build an AI Model (e.g.:
machine Learning Model)

Bias in data collection

Bias in data collection refers to flawed or unbalanced data with over or under representation of
data related to specific features or groups or ethnicity in the final data collection.

Reasons for AI bias in DATA


Other than the over - and under- representation, there are many reasons that cause or
contribute to AI bias.
1. Human bias in decisions
2. Flawed and unbalanced data collection
3. Under or over representation of specific features
4. Wrong assumptions
5. No proper bias testing
6. No bias mitigation
Page - 1 -
CBSE Grade 8
Artificial Intelligence

ETHICS IN COMPUTING

Computing Ethics is a set of moral principles or a code of conduct that governs how to use
computers so as not to cause any harm to others and others’ data.

Issues related to Computing Ethics include:


a. Privacy – Any users personal data e.g., personal files, email messages, credit card/
debit card/bank details etc. cannot be seen or shown to anyone without the permission
of the owner of information. A save site’s URL stands with https:// (secure connection)
and not with http:// (insecure connection).

b. Intellectual property and rights - Anything created in original by an individual is called


intellectual property
Example: an original painting, an original photograph, an original article/chapter, a
music composition.
One cannot use or share anyone's intellectual property in part or whole without the
owner's permission. And if anyone does this, it is a cyber-crime.

c. Societal effects - Computer Ethics also involve the correct online behaviour as it may
impact environment and society.
On environment - One should not use computer ON when not in use. This is because it
may not only waste power but also emits carbon dioxide (CO2) impacting environment.
It adds to the carbon footprint.
On society - One should not use computers to threaten, bully or blackmail or spread
rumours. All such activities are cyber-crimes and are punishable.

UnEthical Practices
o Plagiarism
Copying someone else's work, ideas, or words without proper acknowledgment.
o Cyber bullying
Using digital platforms (social media, messages, forums) to harass, threaten, or
humiliate someone.
o Hacking
Unauthorized access to or manipulation of computer systems or networks.
o Phishing
Fraudulent attempts to obtain sensitive information (like passwords or credit
card details) by pretending to be a trustworthy entity.
o Spamming
Sending unsolicited, irrelevant, or repetitive messages, often in bulk, especially
via email or messaging platforms.
o Digital and software Piracy
Downloading, copying, distributing media content illegally or using software
without proper licensing.
o Doxxing
Publishing private or identifying information about someone without consent.
o Clickbait
Using misleading headlines or thumbnails to attract clicks.
o Deepfakes
AI-generated videos or images that falsely depict people doing or saying things.

Page - 2 -
CBSE Grade 8
Artificial Intelligence

SQL – STRUCTURED QUERY LANGUAGE

CLASSWORK NOTES

Class Activity - Organize the given data

Ford 108bhp 1 Ecosport facelift Tata 3 121 bhp Ciaz Facelift


Hyundai 2 110 bhp Nexon New-Gen Verna 4 91 bhp
Maruti Suzuki

Step 1: Put related data in single row

Step 2: Add Headings

Step 3: Give a Title

Table Structure

Field Name Type of data it stores


Car Name alpha-numeric (e.g., i10)
Maker Alphabets
Power Numbers or alpha-numeric

Data/Information + Structure Database

What is a Database?

A database is a separate application that stores a collection of data. A database most often
contains one or more tables. Each table is identified by a name (e.g. "Customers" or "Orders").
Tables contain records (rows) with data.

Class 8
Roll No. Name Address Contact Ph No.
1 Raina Model Town 9999999
2 Fahim Karol Bagh 8787878
3 Jacob Dwarka 2132132

Table Name – Class 8


Fields/Columns – Roll No., Name, Address, Contact Ph No.
Number of Rows – 3

Page - 3 -
CBSE Grade 8
Artificial Intelligence

Database as a Group of Tables

A database is not just one table. All the related tables are put together and they together form
a database.

Database

Table 1 Table 2 Table 3

Record 1 Record 2

Field 1 Field 1
Field 2 Field 2
Field 3 Field 3
Example: . .
. .
. .
Database

Customer Employee Supplier Orders


Table Table Table Table

Uses of Databases

1. Search Engines
2. School Registration Record
3. Police Database
4. Library Database
5. Telephone Directory

Why Use a Database?


Database offers these benefits:
o Databases can store very large numbers of records efficiently.
o It is very quick and easy to find information as information is stored in organized way.
o It is easy to add new data and to edit or delete old data
o Data can be searched easily, e.g., ‘find all Ford cars’.
o Data can be sorted easily, for example into ‘data first registered’ order.
o Data can be imported into other applications, for example a mail-merge letter to a customer
saying that some payment is due or overdue.
o More than one person can access the same database at the same time – multi access, multi-
user support.
o Security may be better than in paper files.
Page - 4 -
CBSE Grade 8
Artificial Intelligence

What is DBMS (Database Management system)?

A DBMS is a software that can store, edit and organize data in database.
Duplicate saved copy of data is called backup.

RDBMS – Related Database Management System Terminology

o Database − A database is a collection of tables, with related data.


o Table − A table is a matrix with data. A table in a database looks like a simple
spreadsheet.
o Column/Field − One column or field (data element) contains data of one and the same
kind, for example the column postcode.
o Row − A row (= tuple, entry or record) is a group of related data, for example the data of
one subscription.
o Primary Key – It is a special field of the table that stores unique value for each record.

Few Important Commands:

o Keywords are NOT case sensitive: select is the same as SELECT


o Some database systems require a semicolon at the end of each SQL statement.
Semicolon is the standard way to separate each SQL statement in database systems that
allow more than one SQL statement to be executed in the same call to the server.

CREATE DATABASE - creates a new database


o Create Database Databasename;
o Show databases;
o Use databasename;

CREATE TABLE - creates a new table


o Show tables;
o Desc tablename;

INSERT INTO - inserts new data into a database

SELECT - extracts data from a database

DROP TABLE - Completely removes a table and all its data from the database.

DELETE FROM - Removes specific rows from a table based on a condition.

ALTER TABLE - Modifies the structure of an existing table (e.g., add or drop a column).

UPDATE TABLE - Changes existing data within one or more rows in a table.

Page - 5 -
CBSE Grade 8
Artificial Intelligence

CREATE TABLE Statement:

Syntax:
o CREATE TABLE tablename (column1 datatype, column2 datatype,.... );

INSERT INTO Statement:

Syntax:
o INSERT INTO tablename (column1, column2, ...) VALUES (value1, value2, ...);

SELECT Statement:

Syntax:
o SELECT * FROM tablename;
o SELECT column1, column2, ... FROM tablename;

TABLE 1 - COMMAND TO CREATE AN ATTENDANCE TABLE:

CREATE TABLE attendancetable (Sno integer, Id varchar(25), Name varchar(50), Attendance


varchar(25));

INSERT INTO attendancetable (Sno, Id, Name, Attendance) VALUES(1, “19b1234”, “XXX”,
“Present”);

INSERT INTO attendancetable (Sno, Id, Name, Attendance) VALUES(2, “21ois1133”, “YYY”,
“Present”);

INSERT INTO attendancetable (Sno, Id, Name, Attendance) VALUES(3, “17a7860”, “ZZZ”,
“Absent”);

SELECT * FROM attendancetable;

Output:
Sno Id Name Attendance
1 19b1234 XXX Present
2 21ois1133 YYY Present
3 17a7860 ZZZ Absent

Page - 6 -
CBSE Grade 8
Artificial Intelligence

TABLE 2 - COMMAND TO CREATE STUDENT MARKS TABLE:

CREATE TABLE studentmarks (sno integer, st_id varchar(25), name varchar(50), Eng integer,
Math integer, Science integer, Social integer, Hindi integer, Telugu integer, Spanish integer,
French integer);

INSERT INTO studentmarks (sno, st_id, name, Eng, Math, Science, Social, Spanish)
VALUES(1, “19b1234”, “XXX”, 98, 100, 78, 84, 89);

INSERT INTO studentmarks (sno, st_id, name, Eng, Math, Science, Social, Hindi) VALUES(2,
“21ois1345”, “YYY”, 72, 64, 70, 84, 64);

SELECT * FROM studentmarks;

Output:
Sno St_id Name Eng Math Science Social Hindi Telugu Spanish French
1 19b1234 XXX 98 100 78 84 NULL NULL 89 NULL
2 21ois1345 YYY 72 64 70 84 64 NULL NULL NULL

SELECT Statement – COUNT()


The COUNT() function returns the number of rows that matches a specified criterion.

COUNT() Syntax:
SELECT COUNT(column_name) FROM table_name;

Example:
SELECT COUNT(CustomerId) FROM Customers;

Result:
COUNT(CustomerId)
77

Page - 7 -
CBSE Grade 8
Artificial Intelligence

TABLE 3 - COMMAND TO CREATE ITEM PRICE LIST TABLE:

CREATE TABLE Price_List (Items varchar(255), Price integer);


INSERT INTO Price_List (Items, Price) values (“Candies”, 250);
INSERT INTO Price_List (Items, Price) values (“Ice-cream”, 300);
INSERT INTO Price_List (Items, Price) values (“Cookies”, 200);
SELECT * from Price_List;
SELECT count(Items) FROM Price_List;
SELECT sum(Price) FROM Price_List;
SELECT avg(Price) FROM Price_List;
SELECT max(Price) FROM Price_List;
SELECT min(Price) FROM Price_List;

Output:
Items Price
Candies 250
Ice-cream 300
Cookies 200

COUNT(Items)
3
SUM(Price)
750
AVG(Price)
250
MAX(Price)
300
MIN(Price)
200

Page - 8 -
CBSE Grade 8
Artificial Intelligence

SELECT Statement – WHERE Clause


The WHERE clause is used to filter records. The WHERE clause is used to extract onlythose
records that fulfil a specified condition.

WHERE Syntax:
SELECT column1, column2, ...FROM table_name WHERE condition;
Example:
SELECT * FROM Customers WHERE Country='Mexico';

TABLE 4 - COMMAND TO CREATE EMPLOYEES TABLE:

CREATE TABLE employees (sno INT, name VARCHAR(100), age INT, department VARCHAR(50),
salary DECIMAL(10, 2), date_of_joining DATE);

INSERT INTO employees (sno, name, age, department, salary, date_of_joining)


VALUES (1, 'John Doe', 35, 'HR', 55000.00, '2020-01-15');

INSERT INTO employees (sno, name, age, department, salary, date_of_joining)


VALUES (2, 'Jane Smith', 28, 'Finance', 60000.00, '2021-03-20');

INSERT INTO employees (sno, name, age, department, salary, date_of_joining)


VALUES (3, 'Mike Johnson', 40, 'IT', 75000.00, '2019-08-10');

INSERT INTO employees (sno, name, age, department, salary, date_of_joining)


VALUES (4, 'Sara White', 25, 'IT', 70000.00, '2021-06-15');

INSERT INTO employees (sno, name, age, department, salary, date_of_joining)


VALUES (5, 'James Green', 45, 'Marketing', 65000.00, '2018-11-30');

SELECT * FROM employees;

SELECT * FROM employees WHERE age > 30;

SELECT * FROM employees WHERE date_of_joining > '2020-01-01';

SELECT * FROM employees WHERE name LIKE 'J%';

Output:
Sno Name Age Department Salary Date_of_joining
1 John Doe 35 HR 55000.00 2020-01-15
2 Jane Smith 28 Finance 60000.00 2021-03-20
3 Mike Johnson 40 IT 75000.00 2019-08-10
4 Sara White 25 IT 70000.00 2021-06-15
5 James Green 45 Marketing 65000.00 2018-11-30

Page - 9 -
CBSE Grade 8
Artificial Intelligence

Sno Name Age Department Salary Date_of_joining


1 John Doe 35 HR 55000.00 2020-01-15
3 Mike Johnson 40 IT 75000.00 2019-08-10
5 James Green 45 Marketing 65000.00 2018-11-30

Sno Name Age Department Salary Date_of_joining


1 John Doe 35 HR 55000.00 2020-01-15
2 Jane Smith 28 Finance 60000.00 2021-03-20
4 Sara White 25 IT 70000.00 2021-06-15

Sno Name Age Department Salary Date_of_joining


1 John Doe 35 HR 55000.00 2020-01-15
2 Jane Smith 28 Finance 60000.00 2021-03-20
5 James Green 45 Marketing 65000.00 2018-11-30

Page - 10
-
CBSE Grade 8
Artificial Intelligence

Drop, Delete, Alter and update command

Syntax:

• Drop table tablename;


• Delete from tablename where condition;
• Alter Table tablename add columnname datatype;
• Alter Table Tablename drop column columnname;
• Update tablename set column1=value1,…where condition;

TABLE 5 - COMMAND TO CREATE STATELIST TABLE:

CREATE TABLE statelist(sno integer, state varchar(255), language varchar(255));


INSERT INTO statelist values (1, “Telangana”, “Telugu”);
INSERT INTO statelist values (2, “Karnataka”, “Kannada”);
INSERT INTO statelist values (3, “Kerala”, “Malayalam”);
SELECT * from statelist;
SELECT State, Lang from statelist;
ALTER TABLE statelist ADD Food varchar(255);
SELECT * from statelist;
UPDATE statelist set Food=“Hyderbadi Briyani” WHERE state=“Telangana”;
SELECT * from statelist;

Output:

Sno state Language


1 Telangana Telugu
2 Karnataka Kannada
3 Kerala Malayalam

state Language
Telangana Telugu
Karnataka Kannada
Kerala Malayalam

Page - 11
-
CBSE Grade 8
Artificial Intelligence

Sno state Language Food


1 Telangana Telugu
2 Karnataka Kannada
3 Kerala Malayalam

Sno state Language Food


1 Telangana Telugu Hyderabadi
Biriyani
2 Karnataka Kannada
3 Kerala Malayalam

Page - 12
-

You might also like