Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you answer the question next to the emojis, please. This is for database. Im not sure what to put for what the user is

Can you answer the question next to the emojis, please.

This is for database.

Im not sure what to put for what the user is "acting" as.

image text in transcribed

image text in transcribed

1) Installing MySQL Access RPi's terminal and enter the following command to install MySQL: #sudo apt-get install mysql-server Enter the command below to access MySQL. Press enter when prompted for a password: #sudo mysql-u root -P Enter the commands below in MySQL environment to create the user user' with pass' as password: >create user 'user'@'localhost' identified by 'pass'; >grant all privileges on *.* to 'user'@'localhost'; >flush privileges; >quit; : When you do the above you are acting as a DB using (DDL or DCL). Enter the command below to access MySQL as user 'user' and enter the password when prompted to do so: #mysql-u user-p 2) Creating a database and its tables for the following DB: person (pname, street, city) vehicle (year, make, model, cost, licplate, pname) accident (accnum, licplate, accdate, pname) Enter the commands below in MySQL to create a database and its tables for the insurance database described above: >create database insurance; > use insurance; > create table person (pname VARCHAR(30) NOT NULL, street VARCHAR(50) NOT NULL, city VARCHAR(50) NOT NULL, Primary key (pname)); > create table vehicle (year VARCHAR(4) NOT NULL, make VARCHAR(30) NOT NULL, model VARCHAR(30) NOT NULL, cost INT NOT NULL, licplate VARCHAR(7) NOT NULL, pname VARCHAR(30) NOT NULL, Primary key (licplate,pname)); > create table accident (accnum INT NOT NULL, licplate VARCHAR(7) NOT NULL, accdate date NOT NULL, pname VARCHAR(30) NOT NULL, Primary key (accnum,licplate)); : When you do the above you are acting as a DB using (DDL or DCL). Using insert command, populate the tables created earlier with the data shown in the tables below (note that multiple records may be entered using one insert command): > insert into person values ("marisol", "zenith", "harlingen"), ("dolly", "pstreet", "brownsville"); > insert into vehicle values (2005, 'toyota', 'camry', 25000, 't123', 'marisol"); > insert into accident values (101, 'n123', '2012/07/15', 'sunny'); > select from person; > select * from vehicle; Ipname street city 1 year | make | model cost | licplate | pname ben zed edinburg dolly pstreet brownsville 1 gloria patreet brownsville marisol zenith | harlingen I puente lwinder edinburg | sunny zenith | harlingen | zapata medial edinburg 1 2006 bmw 2014 jeep 2013 ford | 2015 | dodge 1997 suzuki 1996 jeep | 1966 ford 2005 toyota i 2005 toyota | 2010 | toyota 318i Wrangler 150 Journey samurai Wrangler mustang camry Camry tundra 35000 | b123 29000 $123 31000 1123 28000 1123 25000k123 23000 ml23 18000 n123 25000 t123 25000 t123 39000 y123 zapata zapata dolly puente Idolly I marisol I gloria marisol sunny ben 7 rows in set (0.00 sec) 10 rows in set (0.00 sec) > select from accident: I accnum lioplate accdate poame 101 n123 103 123 104 | 123 103 t123 106 k123 107 kl 23 108 | n123 109 b123 110 t123 2012-07-15 | sunny 2014-04-04 Bunny 2014-01-25 zapata | 2013-02-16 | sunny 2012-06-06 | sunny 2011-09-17 dolly 1 2013-09-24 dolly | 2010-12-12 gloria 2010-11-05 | zapata! | 2010-03-03 | sunny 10 rows in set (0.00 sec) : When you do the above you are acting as a user using (DML or Query L). Use select command to list contents of the tables created: > select * from person; > select * from vehicle; >select * from accident; : When you do the above you are acting as a user using (DML or Query L)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Lab Manual For Database Development

Authors: Rachelle Reese

1st Custom Edition

1256741736, 978-1256741732

More Books

Students also viewed these Databases questions

Question

a. Describe the encounter. What made it intercultural?

Answered: 1 week ago