EY training notes
EY training notes
Day 1 -SQL
-Sowmya Shree BV [data base trainer]
LINK : https://dev.mysql.com/downloads/installer/
REQUIREMENTS :
• connector 0.8.33
• workbench 0.8.33
• server 0.8.33
select full custom while installing
• multiple databases
• open SQL script ->file
• select the database and line so it execute as there are many databases
INTRODUCTION
• Database management is the most part when you have huge data
• varchar is for String
• consider + and - for date and time
• + current date + further
• _ current - previous date
example :
6oct
+ 5(days) =11 oct
-5
1 oct
• Date , days or week can be considered
• primary key
• foreign key
Primary key : Unique identifier of a table , Each and every table must have at least one pk .
Foreign key : when you represent a relationship between tables you create a foreign key by adding the
column nothing but referring to another table primary key.
DATABASE RELATIONSHIPS
example of one to one : custom order , one customer has one order.
Ord id Qty
1 5
3 10
Example one to many : one customer has one order , customer 2 has two orders.
• composite key - more than one primary key both foreign key referencing to another table.