Now you are ready for the implementation phase. For this part we will use the DDL scripts that
you created in your previous lab. Execute those scripts again to create the set of normalized
relations and populate with data.
Part 03
Now that you have a set of relations:
Create at least 1 index of your choice.
Drop one of the tables and then recreate the table but this time create a partitioned
table (any type of partition that makes sense for your case i.e partition by year, partition
by state area (east, northeast, ... ), partition by id range,.... )
DDL script:
Now you are ready for the implementation phase. For this part we will use the DDL scripts that
you created in your previous lab. Execute those scripts again to create the set of normalized
relations and populate with data.
Part 03
Now that you have a set of relations:
Create at least 1 index of your choice.
Drop one of the tables and then recreate the table but this time create a partitioned
table (any type of partition that makes sense for your case i.e partition by year, partition
by state area (east, northeast, ... ), partition by id range,.... )v
Create table store(
Store_name varchar(50),
Store_mgr varchar(50),
Opening_date date,
PRIMARY KEY (Store_name)
);
CREATE TABLE Employee
(
Emp_Id integer
Emp_Salary number,
Emp_Super varchar,
Emp_Dept integer,
PRIMARY KEY (Emp_Id),
)
Create table Department
(
Dept_Id integer,
Dept_Name varchar(50),
PRIMARY KEY (Dept_Id)
)
CREATE TABLE Emp_Store
(
Emp_Id integer,
Store_Name VARCHAR(50),
Hours_per_week integer,
Rating number,
PRIMARY KEY (Emp_Id, Store_Name)
FOREIGN KEY (Emp_Id) REFERENCES Employee (Emp_Id),

For making partition we will drop the table Employee
DROP TABLE employee;
Now making a new table employee and without any dependencies
Making PARTITION according to the Emp_Id of Employee
CREATE TABLE `employee` ( `Emp_Id` int(11) NOT NULL, `Emp_Salary` int(11) DEFAULT NULL, `Emp_Super` varchar(520) DEFAULT NULL, `Emp_Dept` int(11) DEFAULT NULL) PARTITION BY RANGE (Emp_Id)( PARTITION p0 VALUES LESS THAN (100), PARTITION p1 VALUES LESS THAN (500), PARTITION p3 VALUES LESS THAN MAXVALUE );
selection from the PARTITION table
select * from employee PARTITION (`p1`); select * from employee PARTITION (`p3`);

selecting data from partition and the base table;
SELECT Emp_Salary, COUNT(Emp_Dept) AS numbers FROM employee PARTITION (p1,p3) GROUP BY Emp_Super HAVING numbers < 4;

Delete PARTITION table from the employee table
ALTER TABLE employee TRUNCATE PARTITION p0;
Now you are ready for the implementation phase. For this part we will use the DDL...
QUESTION 9 You plan to query data using the TRANS_HIST_V view that was created by another user in their schema. Which statement is true? A. The Oracle Server will retrieve the view definition from the ALL_VIEWS data dictionary view. B. The Oracle Server will retrieve data, determined by the query criteria, from the TRANS_HIST_V view. C. The Oracle Server will verify whether you have been granted access privileges to the TRANS_HIST_V view. D. The Oracle Server will automatically reset the...
please write in python. thank you
In this question you will be writing the code to carry out a query on a database table in Python. The CREATE command shown below is given just for your reference, so that you know the structure of the table and its columns. The database is an SQLite database in the file named taxa.sqlite. create table species ( id int primary key, genus varchar ( 5 0 ), species varchar(50), common_name char(100) ) Write...
1. Using a function, display the customer who has the highest credit limit. Display the customer number, customer name, and credit limit. Insert your snip of the query and resultset together here: 2. How many customers have the same credit limit? Display the count of customers by credit limit. Display the count as ‘Number of Customers’ and credit limit as ‘Credit Limit’. Insert your snip of the query and resultset together here: 3. What is the average quoted price, maximum...
Using the Premier Products database answer the following questions 1. Using a union, display all customers that have rep number 65 or live in the town of Sheldon. Display all customer information. Insert your snip of the query and resultset together here: 2. Using a subquery, list the rep information for all customers who have the same credit limit as customer number 725. To receive credit for this question, do not explicitly query for rep number 35. Let MySQL do...
--Create procedure for GetPartNums in SQL --GetPartNums- retrieve all part nums from the database --Database if db_id('TestPremierProducts') is not null begin use master alter database TestPremierProducts set SINGLE_USER with rollback immediate drop database TestPremierProducts end create database TestPremierProducts go USE TestPremierProducts; go /* create the tables */ CREATE TABLE Rep (RepNum int Identity(1,1), LastName VARCHAR(15), FirstName VARCHAR(15), Street VARCHAR(15), City VARCHAR(15), State VARCHAR(2), Zip VARCHAR(5), Commission MONEY, Rate DECIMAL(3,2), PRIMARY KEY (RepNum)); go CREATE TABLE Customer (CustomerNum int Identity(1,1) PRIMARY...
Step 1: Design and create the tables You must create additional tables to hold Project and Activity Data. A project represents the construction of a facility with a limited scope of work and financial funding. A Project can be composed of many activities which indicate the different phases in the construction cycle. Example Project Name: Bobba Fett’s Bounty Chase Ride An activity represents the work that must be done to complete the project. Example Activity Name: For Example activity name...
Topic: Inventory Manangement Part A. Database Creation Your database should have a minimum of 4 tables and include both one-to-many and many-to-many relationships. Be sure to include some numeric and/or date fields. Define all appropriate constraints, using the proper naming conventions (see Structure Notes below). Populate your database with at least 30 records in the main table(s), and whatever is needed in related tables. Submit the following: • a short description of the purpose of the database and what the...
ONLY ODD NUMBERS. YOU MUST USE ORACLE OR MY SQL.
THANKS
Chapter 3 TAL Distributors Use SQL to complete the following exercises 1. Create a table named SALES_ REP. The table has the same structure as the REP table shown in Figure 3-11 except the LAST_NAME column should use the VARCHAR data type and the COMMISSION and RATE columns should use the NUMBER data type. Execute the command to describe the layout and characteristics of the SALES_REP table. Add the...
Create a procedure to update the sales history table following the requirements below. A table creation script is provided below. a) Call the procedure: UPDATE_SALES_HISTORY (The procedure name is important for our scripts to test and grade your code; please do not rename it (otherwise our scripts will not run and your score will be 0). b) The procedure takes 2 parameters: (4-digit-year, 2-digit-month). Both parameters will be numeric, e.g., (2019, 11) will denote 2019 (year) and November (month). The...
Instructions Try to answer all the questions using what you have learned in class. Please make your query general not data related This schema is used for inventory management for an OEM Part Inventory p_id Name Cost Supplier Location 1 Traction motor 200 Melco Japan 2 Alternator 400 kato USA 3 HVAC 300 Melco Japan p_id Warehouse_id quantity 1 A1 100 2 A2 250 3 B1 300 Customer Model c_id Name Location CN Canada National Canada UP Union Pacific USA...