
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
how to Create three or more SQL Data Control Language (DCL) Statements using the Homework
- Create a new user statement for the database. The user name should be based on yourself containing your name.
- Statements that grant privileges to the new user. Statements granting privileges to at least 2 of the tables in the assigned database
- Statements that revoke privileges to the new user. Statements revoking privileges to at least 2 of the tables in the assigned Database
the home work data base:
-- creating the RegionStore DataBase
DROP DATABASE IF EXISTS RegionStore;
CREATE DATABASE RegionStore;
USE RegionStore;
-- creating the Region table
CREATE TABLE Region
(
regionID VARCHAR(10),
regionName VARCHAR(50),
supervisor VARCHAR(50),
CONSTRAINT PRIMARY KEY (regionID)
);
-- creating the store table
CREATE TABLE Store
(
storeID VARCHAR (10),
storeAddress VARCHAR (50),
phone VARCHAR (10),
Manager VARCHAR (10),
regionID_FK VARCHAR (10),
CONSTRAINT PRIMARY KEY (storeID),
CONSTRAINT FOREIGN KEY (regionID_FK)
REFERENCES REGION (regionID)
);
-- creating the Employee table
CREATE TABLE Employee
(
empNum VARCHAR (10),
empName VARCHAR (50),
hireDate DATE,
birthDate Date,
socSecNum CHAR(9),
storeID_FK VARCHAR(10),
CONSTRAINT PRIMARY KEY (empNum),
CONSTRAINT FOREIGN KEY (storeID_FK)
REFERENCES Store(storeID)
);
-- creating the Supplier table
CREATE TABLE Supplier
(
supplierID VARCHAR (10),
supplierName VARCHAR (50),
contact VARCHAR (50),
phone CHAR (10),
email VARCHAR (50),
CONSTRAINT PRIMARY KEY (supplierID)
);
-- creating the Supplies table
CREATE TABLE Supplies
(
supplierID_FK VARCHAR (10),
storeID_FK VARCHAR (10),
startDate DATE,
CONSTRAINT PRIMARY KEY (supplierID_FK,storeID_FK )
);
-- creating the StateOfRegion table
CREATE TABLE StateOfRegion
(
stateCode CHAR(2),
stateName VARCHAR(50),
regionID_FK VARCHAR(10),
statePopulation INT,
CONSTRAINT PRIMARY KEY (stateCode),
CONSTRAINT FOREIGN KEY (regionID_FK )
REFERENCES REGION(regionID)
);
--INSERTING information INTO the Region table
INSERT INTO region (regionID,regionName,supervisor)
VALUES ('001','Alabama','Henry');
INSERT INTO Region (regionID,regionName,supervisor)
VALUES ('003','wellington','katty');
INSERT INTO Region (regionID,regionName,supervisor)
VALUES ('004','hamilton','ross');
INSERT INTO Region (regionID,regionName,supervisor)
VALUES ('005','auckland','robert');
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- SQL script which is the physical design for this database ### Animals This table contains the following data about all animals in the zoo. - animal ID (primary key) - animal name - animal birthdate - species - habitat (foreign key) [1 habitat to many relationship] ### Habitats This table contains data about the habitats in the zoo. Each animal lives in a specific habitat. The habitat table should include the following data - habitat name, foreign key) - habitat location ### Database CREATE DATABASE zoo; Write queries to create the tables. Be sure to include primary keys for each table and the required foreign keys and referential integrity actions. Add appropriate indexes. This database requires at least 2 indexes in addition to those automatically created by MySQL.arrow_forwardProcedure: 1. Click New Query and type an SQL statement to create a database named myDB. Tools Window Help | New Query D Execute DNI 2. Click the Execute button or press F5 to see the new database in the Object Explorer. 3. Create queries to perform the next steps. Before writing the queries, type USE MYDB; in the first line to use the database you have created in Step 1. 4. Create the tables named Customers and Product. Setthe appropriate data types and determines which ones are supposed to be NOT NULL. Customers: CustomerID (Primary key), EirstName, LastName, Email, Gender, Birthdate Products: ProductID (Primary key), Description, Quantity, Price, VendorID 5. Create anothertable named Vendors with columns: VendorID (Primary key), Name, ContactNum, CityAddress. 6. Set VendorlD from the Vendortable as a foreign key in the Products table. 7. Save a copy of your queries since these will be used in the last laboratory session of the Pre-final period.arrow_forwarda) Manually (you do not need do any of this in code) create a graphical user interface such as the one depicted in Figure 1. Use the value provided in the CSV file on Canvas. b) Minimum requirements are to always ask for 3 assignments – for this, you skip this step. For bonus credit, prompt the user to input the number of assignments to calculate statistics for. In this case you would need to prompt the user via an input box for the total number of deliverables for which summary statistics will be calculated. You must verify that the user enters a value that can represent a valid integer number in the range [1, 6]. If the user enters a value that does not represent a number, the user enters a valid value but the value is outside of the allowed range, or the user enters a non-integer value, your program must display an error message box. Once the user acknowledges the error by pressing the “OK” button on the message box, your program must continue to display the input box asking for…arrow_forward
- Scenario and Database Model: InstantRide InstantRide is the new ride sharing application in the city and it has just started its operations. With the help of the InstantRide mobile application, the users request a ride with their location. Drivers and cars are assigned to the request; and then the driver picks up the user to ride their requested location. Information for the users, drivers and cars are stored in the database as well as the travel transactions. In the USERS table, information for the users are stored with their first name, last name and email: In the DRIVERS table, all the drivers in the InstantRide are stored with their name, driving license number and check and rating information: In the CARS table, all the cars in the InstantRide system are kept with the license plate, model and year: Finally, the transactions of the rides are stored in the TRAVELS table. For each travel, start and end time with location are stored. In addition, the involved driver, car and…arrow_forwardDesign an Employee database in SQL having id, name, DOB, gender, designation, department and joining_date.Using appropriate controls and design a windows form for the Employee database. Perform the CRUD operation in windows form using Entity Framework DatabaseFirst approach. Select the record from Grid view for update and delete. Also generate report of Employees using Crystal Reports. Please don't highlight it. Perform full code with it and if possible send me the db and visual studio file in zip. Thanksarrow_forwardWrite a SQL script that performs the following. Creates an updatable view based on the employee table. The view must contain the following features Rename all of the columns Display all "manager" records Insert 5 new records into the base table (using the view) Display all the view records using the base table (to verify that the view performed the inserts)arrow_forward
- How to Write a sequence of SQL Statements that include a Stored Trigger to Create an Audit Trail for Updating and Deleting Rows in a Table in your version of the Sales Rep - Customer - Invoice Database. Write a Stored Trigger linked updating a table row in the Enterprise Contracting Company Database. Enterprise Contracting Company Database Write a Stored Trigger linked deleting a table row in the Enterprise Contracting Company Database For each Trigger, a copy of the row before the update or delete operation should be placed in one or more audit tables that keep track of the history of the data. Your Script must contain SQL Statements that Test and Verify that the Triggers are working correctly. A Delete Statement removing one or more rows from a table An Update Statement changing one or more rows from a table CREATE TABLE Statement to create your version of the audit table storing the versions of the data before being deleted or updated SELECT Statements visually…arrow_forwardScenario and Database Model: InstantRide InstantRide is the new ride sharing application in the city and it has just started its operations. With the help of the InstantRide mobile application, the users request a ride with their location. Drivers and cars are assigned to the request; and then the driver picks up the user to ride their requested location. Information for the users, drivers and cars are stored in the database as well as the travel transactions. In the USERS table, information for the users are stored with their first name, last name and email: In the DRIVERS table, all the drivers in the InstantRide are stored with their name, driving license number and check and rating information: In the CARS table, all the cars in the InstantRide system are kept with the license plate, model and year: Finally, the transactions of the rides are stored in the TRAVELS table. For each travel, start and end time with location are stored. In addition, the involved driver, car and…arrow_forwardBased on the ERD below, write the SQL statement to change the job description of “Database Designer” to “Database Developer”. After completing this task examine the results with a select statement. (Hint: Use an Update Statement.)arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education