Create a database table to record application user access information. The table
ID: 3565350 • Letter: C
Question
Create a database table to record application user access information. The table should have two fields: username and access level. Populate the table with following records- include the sql script and screen shot of successful execution. Username Access Level normal_user power_user 0 4
Explanation / Answer
root@host# mysql -u root -p Enter password:******* USE database_name; mysql> CREATE TABLE tbl( -> user_name VARCHAR(40) NOT NULL, -> access_level INT NOT NULL, -> PRIMARY KEY ( user_name) -> ); INSERT INTO tb1 (user_name,access_level) VALUES ("normal_uset", 0); INSERT INTO tb1 (user_name,access_level) VALUES ("power_user", 4); +-----------+-------+-------+ | user_name | access_level | +-----------+-------+-------+ |normal_user| 0 | +-----------+-------+-------+ |power_user | 4 | +-----------+---------------+ 1 row in set (0.01 sec)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.