SQL CODE
– System Variables
System variables can be set via the command line. Please write a sequence of statements to:
Write the commands to display the value of the four variables you have updated.
Write statements that do the following:
Write statements that do the following:
Write statements to do the following:
SQL_SAFE_UPDATES is a system variable.
SET SQL_SAFE_UPDATES=0;
SET GLOBAL long_query_time = 7;
mysql> SET GLOBAL max_connections = 250;
expire_log_days=3
*********************************************************
CREATE USER daisy IDENTIFIED BY imadog
CREATE USER elmo IDENTIFIED BY imacat
CREATE USER ap_superuser IDENTIFIED BY imsuper
CREATE USER ap_dev IDENTIFIED BY apdev
CREATE USER ap_guest IDENTIFIED BY apuser
RENAME USER 'daisy' TO 'lazydaisy';
ALTER USER daisy IDENTIFIED BY imslazydog;
DROP USER 'elmo';
*********************************************************************
GRANT Insert, Select, Update, Delete ON ap database To 'ap-superuser';
GRANT Insert, Select, Update ON ap database To 'ap-dev';
GRANT SELECT ON ap database To 'ap-guest';
GRANT Update ON VENDORS To 'ap-guest';
REVOKE ALL ON ap database FROM 'ap-guest';
REVOKE INSERT ON ap database FROM 'ap-dev';
**********************************************************************************
select User,Host from mysql.user;
SHOW GRANTS FOR CURRENT_USER;
SHOW GRANTS FOR lazydaisy;
SHOW GRANTS FOR ap_superuser ;
SHOW GRANTS FOR 'ap-guest';
SQL CODE – System Variables System variables can be set via the command line. Please write a sequence of statements to: Set safe updates to false for the session. Do the following at the global level...
SQL CODE – System Variables System variables can be set via the command line. Please write a sequence of statements to: Set safe updates to false for the session. Do the following at the global level: Set the maximum number of connections to 45. Set the threshold for long running queries to 7 seconds – do this at the global level. Set logs to expire when they are more than 3 days old Write the commands to display the value...
1. Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database. Give INSERT and UPDATE permission to the new role for the Orders and OrderItems table. Give SELECT permission for all user tables. 2. Write a script that (1) creates a login ID named “RobertHalliday” with the password “HelloBob”; (2) sets the default database for the login to the MyGuitarShop database; (3) creates a user named “RobertHalliday” for the login; and (4) assigns the user...
Step 1: Create table audits via triggers The system must log any insertion, deletion, or updates to the following tables: • Employee table (project 1) create table Employee ( empNumber char(8) not null, firstName varchar(25) null, lastName varchar(25) null, ssn char(9) null, address varchar(50) null, state char(2) null, zip char(5) null, jobCode char(4) null, dateOfBirth date null, certification bit null, salary money null, constraint PK_EMP PRIMARY KEY(empNumber), constraint EMP_STATECHECK CHECK(state in ('CA','FL')) ) GO • Job table (project 1) create...
Please finish all 6 parts with indexing SQL. Don't need to do
the measure time things, but you can do it if you wanna do it.
Thanks!
Write the following SQL queries and measure their execution time both with and without using indexes 1. Count how many parts in NYC have more than 70 parts on hand 2. Count how many total parts on hand, in both NYC and SFO, are Red 3. List all the suppliers that have more...
Please explain each line of code, all code will be in Java. Thank you JKL Restaurant maintains a members’ club for its customers. There are three levels of membership: (1) Basic, (2) Silver, and (3) Gold. A certain member has to be exactly a Basic, Silver, or Gold member at any point in time. Whenever a member spends money at JKL, he/she gets points and as these points are accumulated, one can redeem one or more $20 dining certificates. Each Gold member can...
* myCompany.SQL Introduction to SQL Script file for ORACLE DBMS This script file creates the following tables: VENDOR, PRODUCT, CUSTOMER, INVOICE, LINE EMPLOYEE and loads the default data rows */ set echo on; set serveroutput on; select systimestamp from dual; show user; ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY'; DROP TABLE LINE CASCADE CONSTRAINTS; DROP TABLE INVOICE CASCADE CONSTRAINTS; DROP TABLE CUSTOMER CASCADE CONSTRAINTS; DROP TABLE PRODUCT CASCADE CONSTRAINTS; DROP TABLE VENDOR CASCADE CONSTRAINTS; DROP TABLE EMPLOYEE CASCADE CONSTRAINTS; CREATE TABLE...
Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...