Create a own Database

Слайд 2

Expected results (Success criteria) Is able to create a database in

Expected results (Success criteria)

Is able to create a database in 1,2,3

normal form
Can create a database in the environment XAMPP
Can create tables and table attributes in the environment XAMPP
Can determine key and foreign keys for a table
Can create links between tables
Can fill records for the table in the environment XAMPP
Can create queries for a database in the environment XAMPP
Слайд 3

Development of a mini project Create a database in 1 normal

Development of a mini project

Create a database in 1 normal form Create

a database in 2 normal forms Create a database in 3 normal forms the3 normal form of the database is implemented in the environment XAMPP
Database creation Creating a table and attributes for a table Identifying primary and foreign keys Create a link between tables Fill in the records for the table Create queries for a table
Слайд 4

“Library Management System” - should provide the following functions: Store book

“Library Management System” - should provide the following functions:
Store book information

such as Author, Title, Year, Press
Store the location of the book, for example, which shelf
Store detail of the people who borrowed than book: who did that, when for how long
4. Fine people in case they don't return the book on time
Слайд 5

1NF: Library(ID, Date_loan, ISBN, Title, Author, Year, Num_of_books, Press, F_name, L_Name, Address, Phone, Grade) Normalization

1NF:
Library(ID, Date_loan, ISBN, Title, Author, Year, Num_of_books, Press, F_name, L_Name, Address,

Phone, Grade)

Normalization

Слайд 6

Normalization 2-3NF: Books(ID_book, ISBN, Title, Authors, Year, Num_of_books, Press); Students(ID_student, F_Name,

Normalization

2-3NF:
Books(ID_book, ISBN, Title, Authors, Year, Num_of_books, Press);
Students(ID_student, F_Name, L_Name, Address, Phone,

Grade);
Loan(ID_loan, Date_loan, ID_book, ID_student, Date_return, Note)
Слайд 7

Crow’s Foot style

Crow’s Foot style

Слайд 8

Chen style

Chen style

Слайд 9

CREATE TABLE IF NOT EXISTS `books` ( `ID_book` char(10) NOT NULL

CREATE TABLE IF NOT EXISTS `books` (
`ID_book` char(10) NOT NULL

DEFAULT '',
`ISBN` char(12) NOT NULL,
`Title` varchar(25) NOT NULL,
`Author` varchar(20) NOT NULL,
`Year` int(4) NOT NULL,
`Num_of_books` int(2) NOT NULL,
`Press` varchar(10) NOT NULL,
PRIMARY KEY (`ID_book`)
);

Table Books

Слайд 10

Table Students CREATE TABLE IF NOT EXISTS `students` ( `ID_student` char(12)

Table Students

CREATE TABLE IF NOT EXISTS `students` (
`ID_student` char(12) NOT

NULL DEFAULT '',
`F_name` varchar(15) NOT NULL,
`L_name` varchar(15) NOT NULL,
`Grade` varchar(5) NOT NULL,
`Address` varchar(20) NOT NULL,
`Phone` char(12) NOT NULL,
PRIMARY KEY (`ID_student`)
);
Слайд 11

CREATE TABLE IF NOT EXISTS `loan` ( `ID_loan` int(11) NOT NULL

CREATE TABLE IF NOT EXISTS `loan` (
`ID_loan` int(11) NOT NULL

AUTO_INCREMENT,
`Date_loan` date NOT NULL,
`ID_book` char(10) NOT NULL,
`ID_student` char(12) NOT NULL,
`Date_return` date NOT NULL,
`Note` tinytext NOT NULL,
PRIMARY KEY (`ID_loan`),
KEY `ID_book` (`ID_book`,`ID_student`)
) ;

Table Loan

Слайд 12

Relationships

Relationships