Provide Query to create Database
In this database at least a table of customers, sales, employees, suppliers, products, the detail of the sale, and the equipment (Laptop and Destop) which facilitates billing and inventory management by the database is needed. number of brands and units of computers sold at retail or wholesale. The company does not have a database and they use an old way of information that can also be easily lost. They need a database to have organized all the information about the employees who do the work, the client who purchases the services, the sales that are made and what type of sale was made, the peripherals of the computers. The products that are buy.
DR Computers is a company dedicated of sales. This company focuses on the Installation and Computer repair. In addition, they work with air sales repair and maintenance. Currently, they do not have a database.
Specific objectives:
Provide Query to create Database
//Creating a Database for DR computers.
CREATE DATABASE DRCDb
//Create first Table for storing customer details.
CREATE TABLE customers (customer_id INT ,
first_name VARCHAR (100) NOT NULL,
last_name VARCHAR (100) NOT NULL,
phone VARCHAR (20),
email VARCHAR (25) NOT NULL UNIQUE,
street VARCHAR (25),
city VARCHAR (50),
state VARCHAR (25),
zip_code VARCHAR (5), CONSTRAINT PRIMARY KEY(customer_id)
);
//Create employee table for storing employee details
CREATE TABLE employees (emp_id INT ,
first_name VARCHAR (100) NOT NULL,
last_name VARCHAR (100) NOT NULL,
email VARCHAR (25) NOT NULL UNIQUE,
phone VARCHAR (25),CONSTRAINT PRIMARY KEY(emp_id));
//Create table for products to store details about each and every
products
CREATE TABLE products (
product_id INT ,
product_name VARCHAR (25) NOT NULL,
brand_id INT NOT NULL,
category_id INT NOT NULL,
model INT NOT NULL,
product_price DECIMAL (12, 2) NOT NULL,CONSTRAINT PRIMARY
KEY(product_id)
FOREIGN KEY (category_id)
REFERENCES categories (category_id),
FOREIGN KEY (brand_id)
REFERENCES brands (brand_id)
);
//Create table for category to store details about the product
belongs to which category of computer peripherals
CREATE TABLE categories (
category_id INT ,
category_name VARCHAR (25) NOT NULL,CONSTRAINT PRIMARY
KEY(category_id)
);
CREATE TABLE brands(
brand_id INT ,
brand_name VARCHAR (25) NOT NULL),CONSTRAINT PRIMARY
KEY(brand_id);
//Create table for sales category to store details about the sale
either the sale is a retail sale or a wholesale sale
CREATE TABLE sale_categories (
scategory_id INT,
scategory_name VARCHAR (25) NOT NULL,CONSTRAINT PRIMARY
KEY(scategory_id)
);
//Create table for various suppliers
CREATE TABLE suppliers(supplier_id INT ,
supplier_name VARCHAR (25) NOT NULL,
brand_id INT NOT NULL,
category_id INT NOT NULL,
product_id INT NOT NULL,
prdct_qnty INT NOT NULL,CONSTRAINT PRIMARY KEY(supplier_id)
FOREIGN KEY (category_id)
REFERENCES categories (category_id),
FOREIGN KEY (brand_id)
REFERENCES brands(brand_id),
FOREIGN KEY (product_id)
REFERENCES products(product_id)
);
CREATE TABLE customer_orders (
order_id INT PRIMARY KEY,
customer_id INT,
order_date DATE NOT NULL,
emp_id INT NOT NULL,
FOREIGN KEY (customer_id)
REFERENCES customers (customer_id) ,
FOREIGN KEY (emp_id)
REFERENCES employees (emp_id)
);
CREATE TABLE sales_details (
sale_id INT PRIMARY KEY,
order_id INT NOT NULL
emp_id INT NOT NULL,
scategory_id INT NOT NULL,
FOREIGN KEY (customer_id)
REFERENCES customers (customer_id) ,
FOREIGN KEY (emp_id)
REFERENCES employees (emp_id) ,
FOREIGN KEY (scategory_id)
REFERENCES sale_categories ( scategory_id) );
Provide Query to create Database In this database at least a table of customers, sales, employees,...
You will develop an E-Commerce database used to maintain
customers, products and sales information. You are required to 1)
gather and analyze requirements 2) design logical structure of the
database 3) create stored procedures to develop the tables and
insert the data 4) write SQL statements for data extraction and
reporting.
Throughout the course of this semester you have analyzed the
requirements for an eCommerce database, designed and developed your
database. As a class we have gone through the process...
The Papa Car Service & Repair Centers are owned by the Silent Car Dealership; Papa services and repairs only silent cars. Three Papa centers provide service and repair for the entire state. Each of the three centers is independently managed and operated by a shop manager, a receptionist, and at least eight mechanics. Each center maintains a fully stocked parts inventory. Each center also maintains a manual file system in which each car’s maintenance history is kept: repairs made, parts used, costs,...
Create a crows foot erd using a specialization hierarchy if appropriate. Granite sales company keeps information on its employees and the departments in which they work. For each department, the department name,internal mailbox server, and office phone extension are kept. A department can have many assigned employees, and each employee is assigned to only one department. Employees can be salaried, hourly, or work on contract. All employees are assigned an employee number, which is kept along with the employee's name...
The body of the negative news announcement to employees needs to provide the reasons behind the bad news. Which of the following information should be included in the message? a. Although technology provides effective ways to share information, face-to-face interactions fuel creativity and innovation. b. We need to meet tight deadlines and to work together productively to create the promised work, from storyboards to finished product. c. Staff members who telecommute have not been logging into the company network and that's unacceptable.
The ‘SALES - Sunshine’ department has unfortunately run into a
technical issue and is temporarily unable to process any ‘Credit’
or ‘Debit’ transactions. As a result, it only accepts ‘Cash’
transactions. Besides, the department is offering a 30% discount on
‘Data Recovery’ at the moment. Write a SQL statement to create an
Oracle trigger SUNSHINE_DEPT that will set the PaymentType to
always be ‘Cash’ for any purchases where the client is served by an
employee of this department, and if...
A relational database is to be designed for a medium sized Company named Global Support Solutions (GSS) dealing with industrial applications of computers. The Company delivers various products to its customers ranging from a single application program through to complete installation of hardware with customized software. The Company employs various experts, consultants and supporting staff. All personnel are employed on long-term basis, i.e. there are no short-term or temporary staff. Although the Company is somehow structured for administrative purposes (that...
Create an ERD using Lucid Chart for the following description. Be sure to include all necessary entities, attributes, and correct cardinality in relationships between entities. Don’t forget foreign keys. You have been asked to build a database for a technology company called TechNow. The company owner needs to keep track of the customers that buy their products, the employees that work at TechNow, the offices that the employees use, the vendors that provide them with products, and the products themselves....
484 Core Concepts of Accounting Information Systems a. Using Access, create an employee table sim- ilar to the one shown in Figure 15-4. Create created. (Hint You can use the aforemen- tioned expression for the department code as a validation rule.) at least one record for this table b. Create validation rules for the listed restric tions and an accompanying validation text for each. Document your work by provid- ing a table outlining exactly what rules you c. Test each...
SQL
I have a database
CREATE TABLE vendor
( vid CHAR(2) NOT NULL,
vname VARCHAR(25) NOT NULL,
PRIMARY KEY (vid) );
CREATE TABLE category
( catid CHAR(2) NOT NULL,
catname VARCHAR(25) NOT NULL,
PRIMARY KEY (catid) );
CREATE TABLE product
( pid CHAR(3) NOT NULL,
pname VARCHAR(25) NOT NULL,
price NUMERIC (7,2) NOT NULL,
vid CHAR(2) NOT NULL,
categoryid CHAR(2) NOT NULL,
PRIMARY KEY (pid));
CREATE TABLE region
( rid CHAR NOT NULL,
rname VARCHAR(25) NOT NULL,
PRIMARY KEY (rid)...
Write an SQL query against the Chinook Database v1.4. Each query
must run successfully using DB Browser for SQLite. Create the exact
query below. Must use sub query. I saw that a
similar solution for this question used IF and CONCAT functions
which do not work and return errors. If it is possible to use the
CASE function in place of IF that would be greatly appreciated.
Also I really hate to ask but if it could be organized neatly...