You are on page 1of 3

DEMONSTRATION PLAN WOMEN SONIPAT

Trade : Computer Operator & Programming Assistant Week :


Date : Lesson No. :
Name : Demo No. : 20

Skill : Designing database using MYSQL

Objectives : Trainees must be able to design table and access database,joins and views
etc.

Aids : Computer System and its Accessories ( Mains cords, Printer cords)

Preparation :
(a) Material :MYSQL

(b) Tools & Equipments : Computer System and Accessories

(c) Other Requirements : Power Supply 230 volts

Review : Basics of database , its features to have the fundamentals of database


tables, queries and access database

Link : A query is a kind of question which is applied to table to retrieve specific


information. and Form is kind of design which is being used to acquire
information from user

Motivation : Whatever information stored in database (tables) it should be outputted in


proper format which is known as reports

Presentation

Procedure Questions
(Do) (Ask)

Example: CREATE TABLE EMPLOYEE(Name


VARCHAR2(20), Email VARCHA R2(100), DOB How to create table
DATE);

Example: DROP TABLE EMPLOYEE; How to drop table


Example: ALTER TABLE STU_DETAILS
ADD(ADDRESS VARCHAR2(20)); ALTER How to alter table
TABLE STU_DETAILS MODIFY (NAME
VARCHAR2(20));

Example: TRUNCATE TABLE EMPLOYEE; How to truncate table

Example: INSERT INTO XYZ (Author, Subject) How to insert records into table
VALUES ("Sonoo", "DBMS");

Example: UPDATE students SET User_Name = How to update a table


'Sonoo' WHERE Student_Id = '3'

How to revoke a record from


Example: REVOKE SELECT, UPDATE ON table
MY_TABLE FROM USER1, USER2

Example: DELETE FROM CUSTOMERS WHERE How to commit


AGE = 25; COMMIT;

Example: DELETE FROM CUSTOMERS WHERE How to delete a record from table
AGE = 25; ROLLBACK;

Syntex: SAVEPOINT SAVEPOINT_NA ME; How to create a savepoint

Create Index statement CREATE INDEX


index_name ON table_name (column1, How to create a index to a table
column2, ...);

Drop Index Statement Syntax DROP INDEX How to drop index from a table
index_name; Example DROP INDEX websites_idx;

column Example SELECT COMPANY, COUNT(*)


FROM PRODUCT_MAST GROUP BY How to use groupby clause
COMPANY;
Example SELECT COMPANY, COUNT(*) FROM
PRODUCT_MAST GROUP BY COMPANY How to count records from table
HAVING COUNT(*)>2;

Example SELECT * FROM CUSTOMER ORDER How to arrage records inh


BY NAME; OR SELECT * FROM CUSTOMER descending order
ORDER BY NAME DESC

Example SELECT EMPLOYEE.EMP_NAME,


PROJECT.DEPARTMENT FROM EMPLOYEE How to use innerjoin
INNER JOIN PROJECT ON PROJECT.EMP_ID =
EMPLOYEE.EMP_ID;

Example SELECT EMPLOYEE.EMP_NAME,


PROJECT.DEPARTMENT FROM EMPLOYEE How to use left join
LEFT JOIN PROJECT ON PROJECT.EMP_ID =
EMPLOYEE.EMP_ID;

Example SELECT EMPLOYEE.EMP_NAME,


PROJECT.DEPARTMENT FROM EMPLOYEE How to use right join
RIGHT JOIN PROJECT ON PROJECT.EMP_ID =
EMPLOYEE.EMP_ID;

Example SELECT EMPLOYEE.EMP_NAME,


PROJECT.DEPARTMENT FROM EMPLOYEE How to use full join
FULL JOIN PROJECT ON PROJECT.EMP_ID =
EMPLOYEE.EMP_ID;

Application: For trainees attempting to create table,create index and using different types
of joins
Summary: Trainees should have already prepared table with proper information
Test: Trainees should be tested on to check with proper table data, queries and different
types of join
Assignment : Practical 20
Next Demonstration: Connecting a computer to a network and sharing of Devices, files
and Folders.

You might also like