Part2 : Database Testing | Environment Setup

SDET- QA
12 Oct 202112:12

Summary

TLDRThis tutorial video script guides viewers through setting up an environment for database testing. It begins with installing MySQL Server and downloading the 'classic models' sample database, followed by importing the schema and data into the local server. The script also covers exploring the database schema, which includes tables like customers, orders, and products, and mentions future lessons on testing database objects like tables, views, and relationships.

Takeaways

  • šŸ“š The video is a tutorial on setting up an environment for database testing, following an introduction to database testing in a previous video.
  • šŸ’¾ The first step in setting up the environment is to install a database server; the video uses MySQL as an example, but other databases like Oracle or MSSQL Server are also options.
  • šŸ”— The video provides a link for downloading the MySQL server installer, which is essential for the setup process.
  • šŸ–„ļø Viewers are guided to watch another video for step-by-step instructions on installing MySQL on a Windows operating system, covering basic database operations and connections.
  • šŸ—‚ļø After installing MySQL, the next step is to create a database schema, which is necessary for database testing.
  • šŸ” The 'Classic Models' sample database schema is recommended for practicing database testing, which can be downloaded from the MySQL website.
  • šŸ“ The 'Classic Models' schema comes with an SQL file that needs to be imported to create the database structure and populate it with data.
  • šŸ› ļø MySQL Workbench is introduced as the client software for the MySQL database server, used for connecting to the local server and managing databases.
  • šŸ”„ The process of creating a new database and importing the 'Classic Models' schema data into it using MySQL Workbench is demonstrated.
  • šŸ“‹ The 'Classic Models' database consists of eight tables, each serving a different purpose and interconnected through primary and foreign keys.
  • šŸ”¬ The video concludes with an overview of the tables in the 'Classic Models' schema and a preview of upcoming videos that will cover testing different database objects.

Q & A

  • What is the main topic of the video?

    -The main topic of the video is setting up an environment for database testing, specifically using MySQL as the database server.

  • Why is environment setup necessary before database testing?

    -Environment setup is necessary to install the database server, create the required schemas, and populate them with data, which provides the foundation for performing database testing.

  • Which database server is used in the video for demonstration?

    -MySQL is used in the video for demonstrating the setup process for database testing.

  • What is the link provided in the video for downloading MySQL?

    -The video provides a link in the description for downloading the MySQL installer from the MySQL Community Downloads page.

  • What are the two different flavors of MySQL mentioned in the video?

    -The two different flavors mentioned are for the web community and the installer community, with the latter being for standalone software installation on a local machine.

  • How can viewers learn to install MySQL on Windows?

    -Viewers can learn to install MySQL on Windows by following a provided video link that explains the step-by-step process, including using SQL Workbench and command line clients.

  • What is the sample database schema used for database testing in the video?

    -The sample database schema used is called 'Classic Models,' which is a popular sample database provided by MySQL.

  • What does the 'Classic Models' database schema contain?

    -The 'Classic Models' database schema contains several tables such as customers, employees, offices, order details, orders, payments, product lines, and products, which are interconnected through primary and foreign keys.

  • How can one import the 'Classic Models' database schema into MySQL?

    -One can import the 'Classic Models' database schema into MySQL by downloading the .sql file, then using the Data Import feature in MySQL Workbench to import the data into the 'classic models' schema.

  • What command is used to create a new database in MySQL?

    -The command used to create a new database in MySQL is 'CREATE DATABASE database_name;', where 'database_name' is the name of the new database, such as 'classic models'.

  • What command is used to switch to a specific database in MySQL?

    -The command used to switch to a specific database in MySQL is 'USE database_name;', which connects to the specified database for further operations.

  • What command in MySQL shows all the tables in a database?

    -The command 'SHOW TABLES;' in MySQL is used to display all the tables available in the currently selected database.

  • What will be covered in the next video according to the script?

    -The next video will cover how to test different database objects such as tables, views, and the relationships between tables, as discussed in a previous video.

Outlines

00:00

šŸ› ļø Setting Up the Database Testing Environment

The script begins with an introduction to the video's purpose, which is to demonstrate the setup of an environment for database testing. The speaker explains the prerequisites, starting with the installation of a database server, such as MySQL, Oracle, or MSSQL. The focus is on MySQL, and the audience is guided to download it from the official website. The speaker also provides a link to a video tutorial on installing MySQL on Windows. After the installation, the script discusses the necessity of having a database schema for testing, specifically the 'classic models' schema, and provides a link to download it. The process of importing the schema into the newly installed MySQL server is outlined, including using MySQL Workbench to connect to the local server, create a new database, and import the data from the downloaded SQL file.

05:03

šŸ” Exploring the Classic Models Database Schema

This paragraph delves into the exploration of the 'classic models' database schema after its successful import. The script describes how to use MySQL Workbench to create a new database, import data, and verify the presence of tables, views, stored procedures, and functions within the database. The focus is on the 'classic models' database, which contains several tables such as customers, orders, payments, and others, each serving a specific purpose and interconnected through primary and foreign keys. The speaker also mentions the availability of documentation for the schema and the importance of understanding each table's role in the database for effective testing.

10:04

šŸ—“ļø Preparing for Practical Database Testing

The final paragraph of the script wraps up the environment setup and previews the next steps. Having successfully installed MySQL and imported the 'classic models' database, the speaker outlines the next video's content, which will cover practical database testing of various objects such as tables, views, and the relationships between them. The script emphasizes the importance of this setup as a foundation for the upcoming testing procedures and assures the audience that the subsequent video will provide hands-on demonstrations of the testing techniques discussed previously.

Mindmap

Keywords

šŸ’”Database Testing

Database Testing is the process of verifying and validating the accuracy and completeness of a database management system by executing test cases. In the video, it is the main theme, as the script discusses setting up an environment for this purpose. The video aims to show viewers how to prepare for database testing, which includes understanding the difference between database testing and user interface testing.

šŸ’”User Interface Testing

User Interface Testing is the process of evaluating a software's graphical user interface to ensure it meets the requirements and provides a good user experience. The script contrasts this with database testing, highlighting that while user interface testing focuses on the frontend, database testing is concerned with the backend data integrity and functionality.

šŸ’”Database Server

A Database Server is a software system that manages and processes requests to a database, allowing multiple users and applications to access the data. In the script, the installation of a database server like MySQL is the first step in setting up the environment for database testing, emphasizing its importance as the foundation for any database operations.

šŸ’”Schemas

In database terminology, a Schema refers to the organization of data as a blueprint of how the database is structured, including tables, fields, and relationships. The script mentions the necessity of having required schemas for database testing, which is essential for understanding the structure and constraints of the database before testing.

šŸ’”MySQL

MySQL is an open-source relational database management system that is widely used for various applications. The script uses MySQL as an example of a database server to be installed and configured for the purpose of demonstrating database testing. It is chosen for its popularity and community support.

šŸ’”MySQL Workbench

MySQL Workbench is a unified visual tool for database architects, developers, and DBAs. It provides a graphical interface for MySQL database server configuration, development, and monitoring. In the video script, MySQL Workbench is used to connect to the local server, create databases, and import data for testing.

šŸ’”Sample Database

A Sample Database is a pre-populated database that developers and testers can use to practice and demonstrate database operations. The script instructs viewers to download a sample database called 'Classic Models' to use for testing, illustrating how to work with real-world data in a controlled environment.

šŸ’”SQL File

An SQL File is a text file containing SQL statements that can be executed against a database. In the context of the video, the script mentions an '.sql' file that contains the schema and data for the 'Classic Models' sample database, which needs to be imported into MySQL to set up the testing environment.

šŸ’”Data Import

Data Import refers to the process of loading data from an external source into a database. The script describes how to use MySQL Workbench to import data from an SQL file into the 'Classic Models' database, which is a crucial step in preparing the database for testing.

šŸ’”Tables

In database design, a Table is a collection of related data held in a structured format within a database. The script explains that the 'Classic Models' database contains several tables such as 'Customers', 'Orders', and 'Products', each serving a specific purpose and containing relevant data for the business context.

šŸ’”Primary Key and Foreign Key

A Primary Key is a unique identifier for a record in a database table, while a Foreign Key is a field that links to a primary key in another table, creating a relationship between the two. The script mentions that the 'Classic Models' database tables are interconnected using primary and foreign keys, which is important for relational integrity and testing.

Highlights

Introduction to database testing, its purpose, and its distinction from user interface testing.

Discussion on various types of database testing methods.

Demonstration of setting up an environment for database testing.

Installation of MySQL as a prerequisite for database testing.

Providing a link for downloading MySQL Community Server.

Instructions on selecting the appropriate MySQL installer for local machine setup.

Explanation of downloading and installing MySQL Workbench for database management.

Guidance on how to connect to a local MySQL server using Workbench.

Importance of having a database schema for effective database testing.

Downloading the 'classic models' sample database schema for testing purposes.

Process of importing the 'classic models' SQL file into the MySQL server.

Using MySQL Workbench to create a new database and import sample data.

Exploration of the 'classic models' database schema and its tables.

Description of the different tables within the 'classic models' schema, such as customers, orders, and products.

Explanation of how to execute SQL queries to view data within the database tables.

Teaser for the next video, which will cover practical testing of database objects like tables and views.

Conclusion of the video with a summary of the steps taken to set up the database testing environment.

Transcripts

play00:02

hi everyone welcome you all inĀ  our previous video we have seen uhĀ Ā 

play00:07

introduction about database testing and asĀ  part of that we have discussed about what isĀ Ā 

play00:12

database testing and what is the differenceĀ  between user interface and database testingĀ Ā 

play00:17

and also we have discussed about different typesĀ  of database testing now in the today's video i'mĀ Ā 

play00:22

going to show you how we can set up environmentĀ  to perform database testing so before performingĀ Ā 

play00:28

database testing we need to set up the environmentĀ  so first we need to install database serverĀ Ā 

play00:33

and which we need to have the database alongĀ  with the required schemas and then we willĀ Ā 

play00:38

explore those schemas and then we will startĀ  the database testing so now we'll start withĀ Ā 

play00:43

environment setup so first of all what we needĀ  to do is we need to first download and installĀ Ā 

play00:47

mysql so you can use any database server youĀ  can use it oracle or mssql server or any otherĀ Ā 

play00:53

databases but i am using here is my sequel okayĀ  so download and install my sequel so these areĀ Ā 

play00:59

first prior first prerequisite so for that whatĀ  you need to do is we need to go to this linkĀ Ā 

play01:05

and i will provide this link in the descriptionĀ  you can get it from there so go to directlyĀ Ā 

play01:09

this link and they provided uh installer of mysqlĀ  server so you can just download and install so youĀ Ā 

play01:16

can just look at here mysql community downloads inĀ  this link you can get it here so my sql installerĀ Ā 

play01:22

for windows you can just click on this link andĀ  again it will go to the next page and here you canĀ Ā 

play01:28

it will show you two different flavors andĀ  one is for web community the other is forĀ Ā 

play01:32

uh installer community so installer only forĀ  community so you can just select the secondĀ Ā 

play01:36

option if you want to install mysql server onĀ  your local machine as a standalone softwareĀ Ā 

play01:42

and once you click on this download it will tryĀ  to download your my sequel server installer inĀ Ā 

play01:47

the dot msi file so once you get that file youĀ  can start installing the my sql server so forĀ Ā 

play01:54

that i'm just going to share this video okayĀ  so here i'm just giving the link how to installĀ Ā 

play02:00

uh how to install a ms sql server or how toĀ  install my sql on your windows operating systemĀ Ā 

play02:07

so you can just go to the video how to install myĀ  sequel on windows so you can just go to the videoĀ Ā 

play02:16

and you will be able to understand how we canĀ  install my sequel on windows cycle expense stepĀ Ā 

play02:21

by step and along with the installation i also uhĀ  explained about to database lines like how to useĀ Ā 

play02:28

sql workbench and how to use command line clientsĀ  how to connect to the database so the basic stuffĀ Ā 

play02:33

i have already explained in this video so pleaseĀ  go to the video so before proceeding furtherĀ Ā 

play02:37

okay this is as a prerequisite so once weĀ  install mysql on windows so the second thing isĀ Ā 

play02:45

we need to have a database schema so for databaseĀ  testing we need to have one database schemaĀ Ā 

play02:51

so for that i'm using a sample database schemaĀ  i'm going to download which is basically classicĀ Ā 

play02:57

uh models okay so the first part is we haveĀ  successfully downloaded and install mysql serverĀ Ā 

play03:05

and the second step is we need to have sampleĀ  database download ms sql sample database theĀ Ā 

play03:11

database name is classic models so how to downloadĀ  this classic model so you can just go to thisĀ Ā 

play03:17

website and here you can just search for downloadĀ  classic models database okay and you can get itĀ Ā 

play03:28

directly from there my sequel website itselfĀ  we can just look at here mysql sample databaseĀ Ā 

play03:34

and this is more popular database so by defaultĀ  you will get it through mysql and but you willĀ Ā 

play03:40

get only the schema but you don't have any tablesĀ  or anything so we need to download the data andĀ Ā 

play03:45

we need to populate in our database so if i justĀ  go to this link and they will provide you how toĀ Ā 

play03:51

download mysql sample database you can just clickĀ  on this link download mysql sample database and asĀ Ā 

play03:57

soon as you click on this link which will downloadĀ  it a small zip file and go to this zip file andĀ Ā 

play04:02

once extracted you will see small sql file hereĀ  mysql sample database dot sql file you can seeĀ Ā 

play04:09

and this particular file we have to import andĀ  from this particular file we have to load theĀ Ā 

play04:15

data into our database so for that what we need toĀ  do is we need to first go to mysql so whichever weĀ Ā 

play04:21

have installed in the first step we need to firstĀ  go and open the workbench so as soon as we haveĀ Ā 

play04:27

installed mysql or database server by default youĀ  will get the workbench mssql workbench this is aĀ Ā 

play04:34

client software of mysql database server and nowĀ  open this and as soon as you open this client andĀ Ā 

play04:41

you will able to connect to the local server soĀ  currently my sql is installed on my local machineĀ Ā 

play04:46

so you can just go to the database and connectĀ  to the database and here you need to provide theĀ Ā 

play04:51

connection details like i provided somethingĀ  like localhostname and 3306 is a default portĀ Ā 

play04:57

number of mysql and i'm giving root username andĀ  if password is required and you can specify theĀ Ā 

play05:03

password also and once you provide the connectionĀ  details of your database here you can just say okĀ Ā 

play05:09

and it will automatically connect it to the yourĀ  local database and if i just look at here thereĀ Ā 

play05:14

are some default databases you can see alreadyĀ  here and these databases by default comes alongĀ Ā 

play05:20

with the mysql server which is uh by default it isĀ  provided okay so now what we need to do we need toĀ Ā 

play05:26

create our own database and then we need to importĀ  the data into the database for our testing so weĀ Ā 

play05:32

already downloaded this mysql sample databaseĀ  so now we need to have this in our mysql serverĀ Ā 

play05:38

so for that we need to first open the sql editorĀ  and here we can execute all the sql statementsĀ Ā 

play05:45

in mysql client or mysql workbench client soĀ  how to create a database i'm just creating theĀ Ā 

play05:50

new database how to create it create and sometimesĀ  if you already have the database in this list youĀ Ā 

play05:56

don't need to create again okay if the databaseĀ  is not available then you need to create it soĀ Ā 

play06:01

create a database this is a command which you haveĀ  to give create a database and then database name iĀ Ā 

play06:06

say classic models so as soon as you executed thisĀ  command this will create a new database and if youĀ Ā 

play06:14

refresh here you can see the new database which isĀ  created and inside this there are no objects areĀ Ā 

play06:20

available there are no database objects like weĀ  don't have tables view store procedure functionsĀ Ā 

play06:26

right only the folders are there but we don't haveĀ  any objects here this is completely new databaseĀ Ā 

play06:33

so now to perform the testing we need sampleĀ  tables right we need to create some sample viewĀ Ā 

play06:38

store procedure functions and so on so we willĀ  see them later so first of all let us try toĀ Ā 

play06:44

uh dump some sample data okay to start testingĀ  so for that we whatever file we have alreadyĀ Ā 

play06:51

downloaded so we need to just import thisĀ  data into your database so how to import thisĀ Ā 

play06:56

data so we need to keep this sql file in someĀ  folder and then go to mysql workbench from hereĀ Ā 

play07:04

you need to just go to the server menu so inĀ  the server menu you can find something calledĀ Ā 

play07:09

data import so once you click on this data importĀ  and you can easily import the data into theĀ Ā 

play07:17

databases any of these databases andĀ  we already downloaded one file it weĀ Ā 

play07:21

need to select the second option hereĀ  because that is a self-contained fileĀ Ā 

play07:26

and import from self content file here we needĀ  to browse our partner file so can click on thisĀ Ā 

play07:31

browse option and select the file whicheverĀ  we downloaded it is basically dot sql fileĀ Ā 

play07:37

then open and once you browse the file in the nextĀ  field we need to specify default to target schemaĀ Ā 

play07:43

so we already created classic models right so weĀ  need to dump this data into the classic modelsĀ Ā 

play07:49

now here select the classic modelsĀ  from the dropdown so which youĀ Ā 

play07:52

if you already created the database here whichĀ  will automatically pop up in this drop downĀ Ā 

play07:57

and we selected the source and thisĀ  is a target database and as soon asĀ Ā 

play08:02

i selected these two then you can say startĀ  import button here you can see start importĀ Ā 

play08:08

and once you click on the start input all the dataĀ  will be imported into your classic models databaseĀ Ā 

play08:16

and still it is doing it yeah so once itĀ  is done you can just close this window andĀ Ā 

play08:22

then go to the database mac and here if i justĀ  refresh this project or refresh your projectĀ Ā 

play08:28

refresh your database you can see the all theĀ  tables are automatically populated now you canĀ Ā 

play08:34

also see the tables like this so which databaseĀ  you are going to connect now classic model soĀ Ā 

play08:38

we can use one command called use classic modelsĀ  and whenever you want to work with any databasesĀ Ā 

play08:45

here first we need to use the database this is aĀ  command which will automatically connect to any ofĀ Ā 

play08:51

the database and from there we can execute otherĀ  queries so we can just execute this statementĀ Ā 

play08:56

and now it is currently pointing to classicĀ  models and then i want to see all the tablesĀ Ā 

play09:01

which are available in the classic models so weĀ  can execute one more command called show tables soĀ Ā 

play09:07

this particular command will show you what are allĀ  tables which are available in the classic modelsĀ Ā 

play09:14

database okay so now let us explore this uh schemaĀ  of this each and every table so for that they alsoĀ Ā 

play09:21

given the documentation so this is actual schemaĀ  of classic model database which contains a numberĀ Ā 

play09:27

of tables like payments customers orders officesĀ  employees product lines products order detailsĀ Ā 

play09:34

so all together six seven eight tables areĀ  there in the database and each table isĀ Ā 

play09:39

internally connected with the primary key andĀ  foreign key so we will also validate them laterĀ Ā 

play09:44

and if i just look at each and every tableĀ  is having their own purpose so we can justĀ Ā 

play09:48

look at here customers that this is theĀ  table basically stores the customers dataĀ Ā 

play09:53

and the products is a table which is basicallyĀ  stores the all the product information andĀ Ā 

play09:59

product lines will store different category of theĀ  products and orders table will store the ordersĀ Ā 

play10:04

which are done by the customers or placed by theĀ  customers and order details uh is another stableĀ Ā 

play10:09

other table which will store the sales order lineĀ  items for each sale order so this will store moreĀ Ā 

play10:14

detailed information about the orders and paymentsĀ  information payments table will store the paymentsĀ Ā 

play10:20

made by the customers based on their accountĀ  and then employees table which is having allĀ Ā 

play10:25

employees data which are working under theĀ  particular organization or particular storeĀ Ā 

play10:30

and finally offices table which stores the salesĀ  office data so these are the basic uh tables whichĀ Ā 

play10:36

are available on which are provided as part ofĀ  classic models database and which is also havingĀ Ā 

play10:41

some data and if you want to see some data fromĀ  the customers you can simply say select star fromĀ Ā 

play10:49

customers and execute this query and it willĀ  show you what is the data which is available inĀ Ā 

play10:54

this table okay similarly every table is alreadyĀ  populated some data which is already availableĀ Ā 

play11:00

so now our environment setup is done so we haveĀ  successfully installed mysql server databaseĀ Ā 

play11:07

second step we have downloaded mysql sampleĀ  database and we have imported that into databaseĀ Ā 

play11:13

and also we have explored the database schemaĀ  which is classic model so classic models containsĀ Ā 

play11:19

are totally eight tables so what are thoseĀ  tables we have customers table employees tableĀ Ā 

play11:25

offices order details orders payments productĀ  lines and products so again each table is havingĀ Ā 

play11:32

different number of columns and each column isĀ  having different type of data types and everythingĀ Ā 

play11:37

so we will see all these things as part of testingĀ  so this is a basic thing which we need to set upĀ Ā 

play11:43

before going for testing okay so in the next videoĀ  we will see how we can test different objects ofĀ Ā 

play11:49

database like how to test the table how to testĀ  the view and how to test the relation between theĀ Ā 

play11:56

tables okay so whatever types of testing we haveĀ  discussed in the previous video so we will doĀ Ā 

play12:01

all kinds of testings practically on the databaseĀ  objects okay that we will see in the coming videoĀ Ā 

play12:07

so that's all for this video guys thanksĀ  for watching in the next video we will see

Rate This
ā˜…
ā˜…
ā˜…
ā˜…
ā˜…

5.0 / 5 (0 votes)

Related Tags
Database TestingMySQL SetupSample SchemaWorkbench GuideSQL TutorialData ImportSchema ExplorationSoftware InstallationTesting EnvironmentClassic Models