NCERT Solutions for Class 12 Physics Chapter 2 Electrostatic Potential and Capacitance includes the usage of many complicated equations and formulas that students learn in their Class 12. Also, the PDF file of the NCERT Solutions for Class 12 Physics Electrostatic Potential and Capacitance is available here for free download. The PDF includes important questions, answers to questions from the textbook, worksheets and other assignments.
The NCERT Solutions for Class 12 are essential to score good marks in the Class 12 board examination. These solutions are curated by individual subject matter experts according to the latest CBSE Syllabus (2023-24) and the guidelines. Further, the NCERT Solutions for Class 12 Physics Chapter 2 Electrostatic Potential and Capacitance provided here can be used by students to understand the concepts discussed in the chapter in detail.
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
MQSL JOINING OF TABLES.pptx
1. Discuss the terms:
(i) Cartesian Product –Cross Join,
(ii) Equi-Join,
(iii) Referential Integrity,
(iv) Foreign Key.
To differentiate between Equi-Join, and Cross join in Mysql
To construct MySql query to join rows of different tables
based on constraints.
3. •To find the highest cost of any shoe of type 'School'.
•To find the average cost from the shoes table.
•To count the different types of shoes that the factory produces
Starter Activity
4. •To find the highest cost of any shoe of type 'School'.
SELECT MAX(cost) FROM shoes WHERE type = 'School';
•To find the average cost from the shoes table.
SELECT AVG(cost) FROM shoes;
•To count the different types of shoes that the factory produces
SELECT COUNT(distinct type) FROM shoes;
Starter Activity
5.
6.
7.
8. Foreign Key :
It is a column of a table which is the primary key of another table in the same
database. It is used to enforce referential integrity of the data.
In a join the data is retrieved from the Cartesian product of two tables by giving
a condition of equality of two corresponding columns - one from each table.
Generally, this column is the Primary Key of one table. In the other table this
column is the Foreign key. Such a join which is obtained by putting a condition
of equality on cross join is called an ‘Equi-join'.
In these tables there is a common column between Product and
Order_table tables (Code and P_Code respectively) . Code is the
Primary Key of Product table and in Order_table table it is not so (we
can place more than one orders for the same product). In the
order_table, P_Code is a Foreign Key. A foreign key in a table is used to
ensure referential integrity and to get Equi-Join of two tables.
9. Referential Integrity:
The property of a relational database which ensures that no entry in a foreign key
column of a table can be made unless it matches a primary key value in the
corresponding related table is called Referential Integrity.
Suppose while entering data in Order_table we enter a P_Code that does not exist in
the Product table. It means we have placed an order for an item that does not exist!
We should and can always avoid such human errors. Such errors are avoided by
explicitly making P_Code a foreign key of Order_table table which always references
the Product table to make sure that a non-existing product code is not entered in the
Order_table table.
10. The FOREIGN KEY constraint is used to prevent actions that would destroy links
between tables.
A FOREIGN KEY is a field (or collection of fields) in one table, that refers to the
PRIMARY KEY in another table.
The table with the foreign key is called the child table, and the table with the
primary key is called the referenced or parent table.
Look at the following two tables: Persons Table
PersonID LastName FirstName Age
1 Hansen Ola 30
2 Svendson Tove 23
3 Pettersen Kari 20
OrderID OrderNumber PersonID
1 77895 3
2 44678 3
3 22456 2
4 24562 1
11. SQL FOREIGN KEY on CREATE TABLE
The following SQL creates a FOREIGN KEY on the "PersonID" column when the "Orders" table is created:
CREATE TABLE Orders (
OrderID int NOT NULL,
OrderNumber int NOT NULL,
PersonID int,
PRIMARY KEY (OrderID),
FOREIGN KEY (PersonID) REFERENCES Persons(PersonID)
);
SQL FOREIGN KEY on ALTER TABLE
To create a FOREIGN KEY constraint on the "PersonID" column when the "Orders" table is already created, use the following SQL:
ALTER TABLE Orders
ADD FOREIGN KEY (PersonID) REFERENCES Persons(PersonID);
DROP a FOREIGN KEY Constraint
To drop a FOREIGN KEY constraint, use the following SQL:
ALTER TABLE Orders
DROP FOREIGN KEY PersonID;
12. Create table empnew
( Id int(3) not null primary key,
Name varchar(20),
Eno int(5),
Foreign key(eno) references emp(eno));
Alter table flight add foreign key(fare) references emp(eno);
Notice that the "PersonID" column in the "Orders" table points to the "PersonID"
column in the "Persons" table.
The "PersonID" column in the "Persons" table is the PRIMARY KEY in the "Persons"
table.
The "PersonID" column in the "Orders" table is a FOREIGN KEY in the "Orders" table.
The FOREIGN KEY constraint prevents invalid data from being inserted into the foreign
key column, because it has to be one of the values contained in the parent table.
13. 1. Identify the candidate key of Table Customer.
2. How many rows and columns will be there in the Cartesian product of
the above given tables. Also mention the degree and cardinality of the
Cartesian product of the above given table.
3. Which column can be considered as Foreign Key column in Transaction
table.
4. Select * from Customer, Transaction.
Each row from the first table (Customer )will be paired
with each table in the second table(Transaction)
15. Equi-Join: An equi join of two tables is obtained by putting an equality
condition on the Cartesian product of two tables. This equality condition is
put on the common column of the tables. This common column is,
generally, primary key of one table and foreign key of the other.
We can extract meaningful information from the Cartesian product by placing some
conditions in the statement. To find out the product details corresponding to each
Order details
SELECT * FROM order_table, product WHERE P_code = Code;
|
Two table names are specified in the FROM clause of this statement, therefore MySQL
creates a Cartesian product of the tables. From this Cartesian product MySQL selects
only those records for which P_Code (Product code specified in
the Order_table table) matches Code (Product code in the Product
table). These selected records are then displayed.
16. Example of Equi-join.
Select Order_no, Product.name as Product, Supplier.Name as Supplier
From order_table, Product, Supplier WHERE order_table.Sup_Code =
Supplier.Sup_Code and P_Code = Code;
17. Natural join
The SQL NATURAL JOIN is a type of EQUI JOIN and is structured in
such a way that, columns with the same name of associated tables will appear once only.
18. Natural Join: Guidelines
- The associated tables have one or more pairs of identically named columns.
- The columns must be the same data type.
- Don’t use ON clause in a natural join.
19.
20.
21. Main Activity
Group 1 Group 2,3 Group 4
• Identify data type of
column I_code in
table Items
Identify the Primary
Key of
Items Table.
Which column can be
considered as
Foreign Key column
in Bills Table.
•Display the total quantity sold
for each item.
•Display the details of bill
records along with Name of
each corresponding item.
•Display the bill records for
each Italian item sold.
•Display total quantity of
each item sold but don't
display this data for the
items whose total quantity
sold is less than 3.
•Display the details of the bill
records for which the item is
'Dosa'.
•Display the total value of
items sold for each bill.
22. MIP
EmpId Name TelNo DOJ DptID Salary
100 Steve 05883452 1987-06-17 20 25000
101 Neena 05224897 1989-06-18 30 34000
102 Lex 05991234 1990-08-12 60 12000
103 Alexa 05881278 1996-03-12 60 55000
104 Bruce 05534879 1999-04-12 30 40000
Create two table
GASCO_Emp
(EmpId, Fname,LName,Email,TelNo, DOJ, DeptID, Salary)
GASCO_Dept(DeptID,DeptName,MgrID,LocID)
DeptID DeptName MgrID LocID
20 Administration 200 1700
30 Marketing 130 1800
40 Purchasing 114 2200
50 HumanResource 220 1600
60 IT 136 2300
Display the Empid, Name, Telno. Dept and Deptname of all the
employees working in GASCO
23. PLENARY
Difference between Foreign Key and Primary Key
Identify the candidate key of Customer table.
Which column can be considered as Foreign Key column in
Transaction table.
Identify Primary key column of Transaction table.
What is the Cartesian product of two table? Is it same as an Equi-
join?
24.
25. 1. Display details of the students of Cricket team.
2. Display the name and phone number of the students of class 12 who are
play some game.
3. Display the Number of students with each coach.
4. Display the names and phone numbers of the students whose grade is 'A'
and whose coach is ‘Narendra’.
5. Identify the Foreign Keys (if any) of these tables. Justify your choices.
6. SELECT game, name, address FROM students, Sports WHERE
students.admno = sports.admno AND grade = 'A';
7. SELECT Game FROM students, Sports WHERE students.admno
= sports.admno AND Students.AdmNo = 1434;
8. There are two table T1 and T2 in a database. Cardinality and
degree of T1 are 3 and 8 respectively. Cardinality and degree of
T2 are 4 and 5 respectively. What will be the degree and Cardinality
of their Cartesian product?