0% found this document useful (0 votes)
59 views

Sem2_IDC_BCA-124 P Working With Data Using MySQL_revised (1) (1)

The course 'Working with Data using MySQL' (IDC-BCA-124 P) aims to teach students how to work with database applications using MySQL, covering topics such as DBMS basics, MySQL commands, and query execution. It includes practical exercises involving the creation of various databases and tables, along with specific queries to manipulate and retrieve data. The course requires no prerequisites and utilizes MySQL Workbench and XAMPP for hands-on learning.

Uploaded by

Sachin Patel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Sem2_IDC_BCA-124 P Working With Data Using MySQL_revised (1) (1)

The course 'Working with Data using MySQL' (IDC-BCA-124 P) aims to teach students how to work with database applications using MySQL, covering topics such as DBMS basics, MySQL commands, and query execution. It includes practical exercises involving the creation of various databases and tables, along with specific queries to manipulate and retrieve data. The course requires no prerequisites and utilizes MySQL Workbench and XAMPP for hands-on learning.

Uploaded by

Sachin Patel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Course Name: Working with Data using MySQL

Course Code: IDC-BCA-124 P

Credits: 2

Course Outcomes:
The aim of this course is to enable students to
 Work with database applications.

Prerequisites: No prerequisites
Software’s: MySQL Workbench (Client Side) and XAMPP (Server side)

Contents:

Unit Particulars Hours Credits


No.
1. Unit Title: Basic Introduction of DBMS and MySQL 30 1

Introduction of DBMS. What is MySQL? Features of MySQL, Installing


MySQL (XAMPP) , How MySQL works? What is RDBMS?
MySQL Data Types:-Numeric, Date and Time, String
MySQL DDL Commands: CREATE, DROP, ALTER.
Using MySQL Workbench Interface: Create Database, Drop Database, Create
table, Drop table, Rename table, Alter Database, Alter Table, Change column
type or size, Add/Delete Column, Change column name.

2. Unit Title: MYSQL Queries 30 1

MySQL DML Commands : INSERT,SELECT, UPDATE, DELETE


MySQL Operator: -Arithmetic Operators, Comparison Operators, Logical
Operators, Special Operators (LIKE,NOT LIKE, BETWEEN, IN,NOT IN,
IS NULL), Using MySQL Wildcard characters (% , _ )
Aggregate Functions: AVG, MIN,MAX,SUM,COUNT
MySQL Constraints (NOT NULL,PRIMARY KEY, FOREIGN KEY,DEFAULT)
MySQL Clauses(WHERE Clause, LIMIT Clause, ORDER BY clause, GROUP BY
Clause, Having Clause)
MySQL Queries: - Queries based on Insert, Update, Delete and Select
statement using Where Clause.
Establishing Relationship: Creating ER diagram of database in MySQL
Workbench.
Following type of sample applications can be asked in exam

1. Create a database BANKING with the following tables


Set appropriate datatypes and set primary keys and foreign keys, create relationship between
tables and create E-R Model.

 Customer (cid, c_name,address,email,city)


 Loan (Loanid,cid,amount,rate_of_interest,loan_type,issue_date)
Values for loan_type should be “HOUSING”,” PERSONAL” and “VEHICLE” only.

Perform the following queries


a) Update the city of cid=2 to “Ahmedabad”
b) Display the loan details of customers where loan amount is > 50,000 and rate_of_interest is
less than 4.5%.
c) Display records of customer where c_name begins with letter “M”.
d) Display the number of customers in each city .
e) Arrange the records of customer in descending order of city.

2. Create a database EVENT_MANAGEMENT with the following tables


Set appropriate datatypes and set primary keys and foreign keys, create relationship between
tables and create E-R Model .

 Event(eid,ename,start_date,end_date)
 Participants(pid,eid,P_name,gender)
Gender should be ‘M’ or ‘F’ only. And Value for ename should not be null and default value
should be “BIRTHDAY”.
Perform the following queries
a) Count the number of participants where eid=2.
b) Display the number of participants in each gender.
c) Display the records of events where ename begins with ‘B’.
d) Display all event starting between “2022/03/03” and “2022/05/05”
e) Arrange records in ascending order of participant’s name.

3. Create a database BOOKDETAILS with the following tables


Set appropriate datatypes and set primary keys and foreign keys, create relationship between
tables and create E-R Model.
 Publisher(pid,pname,contact_no)
 Book(bid,bname,price,pid,edition)

Perform the following queries


a) Display all the records from Book table where edition is either (1,2 or 4) using IN operator.
b) Display all records from Book table with price increased by 100.
c) Display the details of book where price is highest.
d) Update the price of book to 2500 where edition is > 4
e) Display the average price of the books.
4. Create a database EMPLOYEE_DUTY with the following tables
Set appropriate datatypes and set primary keys and foreign keys, Create relationship between
tables and create E-R Model.
 Employee(empid,empname,skill,pay)
 Duty(dutyid,empid,day,shift)

Perform the following Queries:


a) Display all records from Employee table where pay is deducted by 200.
b) Find the employee names which ends with ‘I’.
c) Display total no. of employees where skill is other than “PROGRAMMERS”.
d) Display employee details where pay is more than 10000.
e) Display employee details of where skill is “DBA”.

5. Create a database MYORDERS with the following tables


Set appropriate datatypes and set primary keys and foreign keys, create relationship between tables
and create E-R Model.
 Product(pid,pname,product_description,disc_available)
 Order(pid,oid,odate,qty,price)
Values for discount available should be ‘Y’ or ‘N’
Perform the following queries
a) Display product details where disc_available is ‘Y’.
b) Display order details where quantity>5 and price< 2000.
c) Display order details where odate is between 1/1/2020 to 31/12/2020
d) Display minimum price order.
e) Count the number of orders where price is > 2500.

6. Create a database FACULTY_INFO with the following tables


Set appropriate datatypes and set primary keys and foreign keys, create relationship between tables
and create E-R Model .

 Faculty (fid,fname,qualification,salary,cid)
 Course(cid,course_name,fees)
Perform the following queries
a) Display the name of courses where fees are greater than 25000.
b) Display the faculty names that begins with letter “A” and ends with letter “v”
c) Display the records of faculties where qualification is “M.COM”.
d) Update the fees of course to 25000 where course_name is “MCA”
e) Delete record of faculty where fid=5.
7. Create a database LIBRARY_DB with the following tables
Set appropriate datatypes and set primary keys and foreign keys. Create relationship between tables
and create E-R Model.

 Book_Category(catid,cat_name)
 Book_details(bid,bname,publication,author,price,catid)
Perform the following queries
a) Display books where book name begins with letter “P” or “M”.
b) Update price of book “DATABASE” to 2000.
c) Count number of books where publication is “DREAMTECH”
d) Display records book_category table where catid is 1 or 4
e) Display books where publication is “Dreamtech”.

8. Create a database HOSPITAL_DB with the following tables


Set appropriate datatypes and set primary keys and foreign keys, create relationship between
tables and create E-R Model .
 Doctor(docid,name,dept,gender)
 Patient(pid,pname,disease,docid,charges)
Values for gender should be “M” or “F”
Perform the following queries
a) Display the records for doctors where dept = “Surgery”.
b) Count the number of doctors in each gender.
c) Display the patient’s records where disease is “APPENDIX”.
d) Update charge to 2000 where pid = 3.
e) Display the records of doctors where doctors name begins with letter S.

9. Create a database MOBILE_DETAILS with the following tables


Set appropriate datatypes and set primary keys and foreign keys, create relationship between
tables and create E-R Model .
 Handsets(mobid,mobname,touchscreen,type,cost,qty)
 vendor (vid,mobid,shopname,city)
Value for touchscreen should be either “Y” or “N”
Handset type should be “CDMA” , “Smartphone” and “GSM” only.

Perform the following queries


a) Display vid and shopname for “AHMEDABAD” city
b) Count handset records where type = “Smartphone”;
c) Display the shop name where mobid = 5.
d) Display handset details where touchscreen = ‘Y’.
e) Display handsets details where type is “CDMA” and “GSM”
10. Create a database PAYROLL with the following tables
Set appropriate datatypes and set primary keys and foreign keys, create relationship between
tables and create E-R Model .
 Item(itemid,item_name,quantity,price,sid)
 Supplier(sid,sname,contact_no,address)
Default value for quantity should be 10.

Perform the following queries


a) Display all the records from items where quantity > 15 and price > 2000.
b) Update quantity = 12 where price < 2000.
c) Count the number of items where sid=4.
d) Arrange records from supplier table in ascending order of sname.
e) Delete item record where itemid=5.

---------------------------------

E-Resources:
1. https://www.w3schools.com/mysql/mysql_sql.asp
2. https://www.javatpoint.com/mysql-workbench
3. https://dev.mysql.com/doc/workbench/en/wb-installing.html

You might also like