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)

Étiquettes Connexes
Database TestingMySQL SetupSample SchemaWorkbench GuideSQL TutorialData ImportSchema ExplorationSoftware InstallationTesting EnvironmentClassic Models
Besoin d'un résumé en anglais ?