0% found this document useful (0 votes)
10 views8 pages

Databases

The document outlines the curriculum for a Database Systems course in the DIT Part-II program, detailing the objectives, course contents, and practical requirements over a 20-week period. Students will learn about database concepts, relational databases, data modeling, and MySQL development, including SQL commands and front-end development using MS Access. The course includes both theoretical and practical components, with a total of 120 contact hours and a focus on hands-on experience with MySQL and database management.

Uploaded by

Anees Ahmed
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)
10 views8 pages

Databases

The document outlines the curriculum for a Database Systems course in the DIT Part-II program, detailing the objectives, course contents, and practical requirements over a 20-week period. Students will learn about database concepts, relational databases, data modeling, and MySQL development, including SQL commands and front-end development using MS Access. The course includes both theoretical and practical components, with a total of 120 contact hours and a focus on hands-on experience with MySQL and database management.

Uploaded by

Anees Ahmed
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/ 8

| KP BT&CE DIT-2 Year Curriculum

DATABASE SYSTEMS

(DIT Part-II)

Total Marks: 100 Theory Marks: 75 Practical Marks: 25


Total Weeks: 20
Contact Hours per week: 06
Total Contact Hours: 120
Theory Hours: 40
Practical Hours: 80

GENERAL OBJECTIVES:

After completion of this course, students are expected to be able:


To ascertain the importance of databases in knowledge-based societies.
To understand the basic concepts of Database and Database Management Systems.
To transform an Entity Relationship Model into a Relational Schema.
To use an Open Source software.
To apply SQL commands for data manipulation in a database.
To use MySQL Community Server 8.0 for Creating and Maintaining a database.
To Create Front-end in MS ACCESS for MySQL Databases

[31]
| KP BT&CE DIT-2 Year Curriculum

Allotted Contact
Module Course Contents
Weeks Hours
INTRODUCTION TO DATABASE CONCEPTS
1.1 Definition of Database
1.2 Importance/Advantages of Databases
1.3 Database Models
1.3.1 Hierarchical
1.3.2 Network
1.3.3 Relational
1.4 Definition of Database Management System (DBMS)
1.4.1 Relational DBMS (SQL Based)
(MS Access, MS SQL, MySQL, ORACLE)
01
1.4.2 Non-Relational DBMS (NoSQL) 06
01 Week
(MongoDB, HBase, Cassandra)
1.5 Functions of DBMS
1.5.1 Data Dictionary Management
1.5.2 Data Storage Management
1.5.3 Data Integrity Management
1.5.4 Backup & Recovery Management
1.5.5 Security Management
1.5.6 Multi-User Access Control

RELATIONAL DATABASE CONCEPTS


2.1 Definition of Relational Database & RDBMS
2.2 Entity, Table, Record, Field
2.3 Primary Key, Composite Key, Foreign Key
2.4 Referential Integrity
2.5 Types of Relationships 01
02 06
2.5.1 One-to-One Week
2.5.2 One-to-Many
2.5.3 Many-to-Many

DATA MODELLING
3.1 Introduction to Data Modelling & its importance
3.2 Definition of Entity Relationship Diagram (ERD)
3.3 Elements of ERD
3.4 Transforming ERD to Relational Schema 03
03 3.5 Normalization of Relational Database 18
Weeks
3.5.1 First Normal Form (1NF)
3.5.2 Second Normal Form (2NF)
3.5.3 Third Normal Form (3NF)

DATABASE DEVELOPMENT USING MYSQL


4.1 Introduction to MYSQL
4.1.1 Definition and advantages of MySQL
4.1.2 Installation of MySQL Community Server 8.0
4.1.3 Introduction to MySQL Workbench 8.0
04 4.1.4 Introduction to MySQL Shell 8.0 15
90
4.1.5 Introduction to MySQL 8.0 Command Line Client Weeks
4.2 Introduction to Structured Query Language (SQL)
4.2.1 Data Definition Language (DDL)
4.2.2 Data Manipulation Language (DML)
4.2.3 Data Control Language
[32]
| KP BT&CE DIT-2 Year Curriculum

4.3 MySQL Statements for Database Development


4.3.1 Database Manipulation
i. CREATE DATABASE statement
ii. DROP DATABASE statement
iii. USE Statement
4.3.2 Basic Data Types
i. VARCHAR
ii. TEXT
iii. LONGTEXT
iv. INT
v. BIGINT
vi. FLOAT
vii. DOUBLE
viii. BOOL
ix. DATE
x. TIME
xi. YEAR
4.3.3 Table Manipulation
i. SHOW TABLE Statement
ii. CREATE TABLE statement
iii. DROP TABLE statement
iv. TRUNCATE TABLE statement
v. ALTER TABLE statement
vi. ALTER TABLE ADD
vii. ALTER TABLE DROP COLUMN
viii. ALTER TABLE MODIFY COLUMN
ix. CREATE INDEX statement
x. INSERT INTO statement
xi. UPDATE statement
xii. DELETE statement
xiii. LIMIT clause
xiv. INSERT INTO SELECT statement
xv. DESC and EXPLAIN statements
4.3.4 Data Retrieval
i. SELECT statement
ii. SELECT DISTINCT statement
iii. WHERE clause
iv. Operators used in WHERE clause
v. Wildcards ( % , _ ) used in WHERE clause
vi. AND, OR, NOT Operators
vii. ORDER BY clause
viii. ORDER BY DESC
ix. GROUP BY statement
x. HAVING clause
4.3.5 Constraints
i. NOT NULL
ii. UNIQUE
iii. PRIMARY KEY
iv. FOREIGN KEY
v. DEFAULT
vi. CHECK
4.3.6 Functions
i. AVG()
[33]
| KP BT&CE DIT-2 Year Curriculum

ii. COUNT()
iii. CONCAT()
iv. LOWER()
v. LENGTH()
vi. LTRIM()
vii. MIN()
viii. MAX()
ix. RTRIM()
x. REPLACE()
xi. REPEAT()
xii. STRCMP()
xiii. SUBSTR()
xiv. SUM()
xv. UPPER()
4.3.7 MySQL Operators
i. Arithmetic Operators
ii. Comparison Operators
iii. Logical Operators
4.3.8 Views
i. CREATE VIEW statement
ii. DROP VIEW statement
4.3.9 MySQL Joins
i. INNER JOIN
ii. LEFT JOIN
iii. RIGHT JOIN
iv. CROSS JOIN
4.3.10 Front-end-Development
i. Connection MS Access to MySQL Database.
ii. Creating Forms for MySQL Databases
iii. Creating Reports for MySQL Databases
TOTAL 20 120

Software Requirements:
Lab Minimum Windows 7 (64-bit, Professional level or higher)
Requirements Mac OS X 10.6.1+
(Software) Ubuntu 9.10 (64bit)
Ubuntu 8.04 (32bit/64bit)

Practical Description
Number
Downloading and Installation of MySQL Server 8.0:
1. Download MySQL Community Server from
dev.mysql.com/downloads/mysql/
List of 2. Install MySQL Server 8.0, MySQL Workbench 8.0 and MySQL
Practical Shell 8.0 as follow: (a) Run the downloaded mysql-installer-
1 community-8.0 file. (b) Choose the Custom setup type, click Next.

Click Execute then Next. (d) Leave default settings on Type and

[34]
| KP BT&CE DIT-2 Year Curriculum

next. Create a MySQL Root Password and click next. Leave default

settings and click next. Click Execute. Click Finish. (e) Enter
password and click check. Then Next and then Execute. Finally
click Finish, Next and Finish. (f) The MySQL Workbench 8.0 and
MySQL Shell tool will be started.

To verify the successful installation of MySQL Server, run the windows


--

variable.
Starting MySQL Server and Establishing the Session/Connection:
1. The MySQL Server will automatically start by starting windows
because it was selected by default during the installation of MySQL
Server.
2. If MySQL Server is not started automatically, then (a) Write

eral' tab is opened, select the Startup Type as Automatic. (d)


If the Service status is Stopped, click on Start.
2
3. Connect to MySQL Server by following these steps: (a) Start

\
command and press enter key to change command prompt to SQL
\
enter key. Then enter the password. Choose whether to save
password or not. (e) If your MySQL Connection Id is shown, then
Server is started and connection is established successfully. (f)
Now here all SQL commands can be used to play with MySQL
databases.
MySQL Workbench User Interface:
1. Start MySQL Workbench 8.0. Title bar shows the application name

Home Tab. Below the Home Tab is Menu bar.


2.

3.

3
home Tab icon (on the left) to go to the Home Screen.
4. The toolbar available under the menu bar contains controls for
creating a new database (Schema), new table, new view, SQL tab
etc.
5. In the Navigator Pane, two Tabs are available; Administration and
Schemas. Administration Tab provides features for managing the
server, clients etc. Schemas Tab allows to manage Databases.
6. Click on Schemas Tab to show available databases.
Using MySQL Shell tool for exploring available databases:
1. Connect to MySQL Server as explained in step-3 of practical No-2
4 above.
2.
databases are shown.

[35]
| KP BT&CE DIT-2 Year Curriculum

3.
be set to World. (Note the prompt which contains database name)
4.
will be shown.
5.
will be shown.
6. CTRL + L is used to clear screen. CTRL + C is used to interrupt
execution.
Creating and Deleting a MySQL Database:
1. Connect to MySQL Server as explained in step-3 of practical No-2
above.
2.
5 3.
4.
contains both DBs.
5.
SHOP Db.
Creating table in a MySQL database:
1. Connect to MySQL Server as explained in step-3 of practical No-2
above.
2.
to College.
3.
6
database. It is currently empty because it was only created in
practical No-5 above.
4.
command to create a new table called Student.
5.
6. Extract all data from Student table using SELECT statement.
Adding more attributes in existing table:
1. Start
2. Use the ALTER TABLE - ADD statement to add two more
7 columns (City and Phone No) in Student table.
3. Use UPDATE statement to populate these two new columns with
data.
4. Extract all records using SELECT statement.
Deleting a Column of a Table and Changing data type of a Column:
1.
2. Show all data of Student table by using SELECT statement.
3. Use ALTER TABLE- DROP COLUMN statement to delete city
column.
8
4. Use DESC statement to show the structure of Student table.
5. Use ALTER TABLE MODIFY COLUMN statement to change
the data type of phone column from VARCHAR to BIGINT.
6. Again use the DESC statement to show the structure of Student
table.
Creating a duplicate table and setting the Primary Key:
1.
2. Show all data of Student table by using SELECT statement.
3.
9
called studentcopy.
4. Show all records of the new table.
5.
command to set the ID field as Primary key of studentcopy table.
6.
[36]
| KP BT&CE DIT-2 Year Curriculum

Deleting only data from table and then using INSERT INTO SELECT:
1.
2. Show all data of studentcopy table by using SELECT statement.
3.
10 all records in the studentcopy table and then check, it will be empty.
4. Now execute this command to fill the studentcopy table again with
SELECT *

5. Check its structure by using the DESC or EXPLAIN statement.


Creating an Index on a table and using the LIMIT clause:
1.
2. Show all data of studentcopy table by using SELECT statement.
11 3.
command to create an index on the age field of studentcopy table.
4.
3 records.
Applying NOT NULL and Setting Primary Key:
1.
2. Set default database to pharma by using USE statement.
12 3. Create a new Table Customer with fields CID as INT, CNAME as
TEXT, CCITY as TEXT, CPHONE as TEXT.
4. Set CID as Primary Key and NOT NULL.
5. Insert at least 20 records in this table.
Creating a database table using MySQL Workbench 8.0:
1. Start MySQL Workbench 8.0 from windows start menu, click on

password.
2.
shown.
3.
in use.
4.
13 NOT NULL, SNAME VARCHAR(15), SCITY TEXT(15),

a new table Supplier.


5. Press CTRL + ENTER to execute the current statement. The new
table is created which can be checked in the left pane by pressing
the refresh button.
6.

Result Grid below shows empty table.

1. practical No-13
above, in MySQL Workbench.
2.
grid user interface.
3. Create following 4 more tables in similar way in the MySQL
14 Workbench.
a. MedicineType ( TID(int), TYPE(text) )
b. Medicine ( MID(int), MNAME(text), MPRICE(int),
MEXPIRY(date), SID(int), TID(int) )
c. CustomerOrdersMedicine (ORDID(int), MID(int),
Quantity(int) )
d. CustomerOrders ( ORDID(int), CID(int), ORDDATE(date) )

[37]
| KP BT&CE DIT-2 Year Curriculum

1. practical No-13 &


14 above, in MySQL Workbench.
2. Define Foreign keys in newly created tables.
3. Enter at least 20 records in each table created in practical No-14
15 above using MySQL Workbench.
4. Then extract specific records from these tables using the WHERE
clause, using wildcards, using AND OR NOT operators.
5. Create views for these tables.
6. Combine tables using different MySQL JOIN statements.
Creating an ODBC Connection for MS ACCESS:
1.
2.

3.

4. Create new data source window opens up. In the list search for
list, then you
16 have to download it as explained in practical No-17 below.
5.

6.

enter root password in password field. Select desired MySQL

Successf

Downloading MySQL ODBC Connector:


1. Go to www.mysql.com, click on Downloads.
2. Click on MySQL Community Downloads. Then click on
17
bit) MSI installer.
Install the downloaded file.

Developing Front-end for MySQL database:


1. Open a blank database in MS ACCESS.
2. Click on External Data, New Data Source, From other sources, and
click on ODBC Database.
3.

4.

18 5. The connection is established and all the Tables of the database


appears.
6. Now create a form for any table of your connected MySQL
database and enter new records.
7. Open the same MySQL database in MySQL Workbench and check
the new record there.
8. Create a report in MS ACCESS for any table of your MySQL
database.
Front-end (through MS ACCESS Forms and Reports) is created
https://dev.mysql.com/downloads/mysql/
Reference
https://www.w3schools.com/mysql/default.asp
Material
https://www.mysqltutorial.org

[38]

You might also like