Classs 11 Lab 1 ‐ Building a Database - Justin-Boyd/Ethical-Hacking-Class GitHub Wiki
Task 1: Building an SQL Database
Step 1
Start the Kali Linux virtual machine.
Step 2
Start the MariaDB service and create a database named cyber
service mysql start
mysql -u root -p
create database cyber ;
use cyber ;
Step 3
Create two tables: Attackers and Defenders. In each table add an ID, username, password, country, and another item of your choice. For each table, create five players with attributes of your choice.
create table attackers(id INT(15), username VARCHAR(15), password VARCHAR(15), country VARCHAR(15), fruit VARCHAR(15));
create table defenders(id INT(15), username VARCHAR(15), password VARCHAR(15), country VARCHAR(15), fruit VARCHAR(15));
INSERT INTO attackers (id, username, password, country, fruit) VALUES (1234,'james','777','UK','apple');
INSERT INTO defenders (id, username, password, country, fruit) VALUES (12,”alice”,”pass1”,”USA”,”banana”);
Task 2: Displaying Specific Data
Step 1
Display all the data in the Attackers and Defenders tables.
select * from attackers ;
select * from defenders ;
Step 2
Display both tables sorted in ascending ID order.
select * from attackers order by id ;
select * from defenders order by id ;
Step 3
Display both tables in a unified table using a single command.
select * from attackers union select * from defenders ;